diff --git a/.devcontainer/README.md b/.devcontainer/README.md index bd769fa4..1838593b 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -1,4 +1,9 @@ +
+ +
+
+ > **Remember to shutdown a GitHub Codespace when it is not in use!** # Dev Containers Quick Start diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 3c91fdcd..4c6cd7cd 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,21 @@ lockVersion: 2.0.0 id: fca0ac3a-5f4e-452c-bbc7-2311afa8da40 management: - docChecksum: e0a152df239fd8497c0b664a85c58056 - docVersion: 10.8.3 - speakeasyVersion: 1.453.8 - generationVersion: 2.474.15 - releaseVersion: 0.1.7 - configChecksum: cea5b059544e6c210b438ae697b2f2c9 + docChecksum: 2c1240637436833a37fb51eb9386a22d + docVersion: 10.9.0 + speakeasyVersion: 1.455.7 + generationVersion: 2.480.1 + releaseVersion: 0.2.0 + configChecksum: 7b169bf0238b9fbdb0efd6204f997851 + repoURL: https://github.com/apideck-libraries/sdk-python.git + installationURL: https://github.com/apideck-libraries/sdk-python.git published: true features: python: acceptHeaders: 3.0.0 additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.6.11 + core: 5.7.4 deepObjectParams: 0.1.0 defaultEnabledRetries: 0.2.0 deprecations: 3.0.0 @@ -22,19 +24,21 @@ features: enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 errors: 3.2.0 + flatRequests: 1.0.1 flattening: 3.1.0 globalSecurity: 3.0.2 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 - globalServerURLs: 3.0.0 + globalServerURLs: 3.1.0 globals: 3.0.0 groups: 3.0.0 hiddenGlobals: 1.0.0 inputOutputModels: 3.0.0 methodArguments: 1.0.2 - methodServerURLs: 3.0.0 + methodServerURLs: 3.1.0 nameOverrides: 3.0.0 nullables: 1.0.0 + pagination: 3.0.1 responseFormat: 1.0.1 retries: 3.0.2 sdkHooks: 1.0.0 @@ -49,9 +53,16 @@ generatedFiles: - .vscode/settings.json - CONTRIBUTING.md - USAGE.md + - docs/models/accountingagedcreditorsoneglobals.md + - docs/models/accountingagedcreditorsonerequest.md + - docs/models/accountingagedcreditorsoneresponse.md + - docs/models/accountingageddebtorsoneglobals.md + - docs/models/accountingageddebtorsonerequest.md + - docs/models/accountingageddebtorsoneresponse.md - docs/models/accountingattachmentsallglobals.md - docs/models/accountingattachmentsallrequest.md - docs/models/accountingattachmentsallresponse.md + - docs/models/accountingattachmentsallresponseresult.md - docs/models/accountingattachmentsdeleteglobals.md - docs/models/accountingattachmentsdeleterequest.md - docs/models/accountingattachmentsdeleteresponse.md @@ -70,6 +81,7 @@ generatedFiles: - docs/models/accountingbillpaymentsallglobals.md - docs/models/accountingbillpaymentsallrequest.md - docs/models/accountingbillpaymentsallresponse.md + - docs/models/accountingbillpaymentsallresponseresult.md - docs/models/accountingbillpaymentsdeleteglobals.md - docs/models/accountingbillpaymentsdeleterequest.md - docs/models/accountingbillpaymentsdeleteresponse.md @@ -85,6 +97,7 @@ generatedFiles: - docs/models/accountingbillsallglobals.md - docs/models/accountingbillsallrequest.md - docs/models/accountingbillsallresponse.md + - docs/models/accountingbillsallresponseresult.md - docs/models/accountingbillsdeleteglobals.md - docs/models/accountingbillsdeleterequest.md - docs/models/accountingbillsdeleteresponse.md @@ -103,6 +116,7 @@ generatedFiles: - docs/models/accountingcreditnotesallglobals.md - docs/models/accountingcreditnotesallrequest.md - docs/models/accountingcreditnotesallresponse.md + - docs/models/accountingcreditnotesallresponseresult.md - docs/models/accountingcreditnotesdeleteglobals.md - docs/models/accountingcreditnotesdeleterequest.md - docs/models/accountingcreditnotesdeleteresponse.md @@ -118,6 +132,7 @@ generatedFiles: - docs/models/accountingcustomersallglobals.md - docs/models/accountingcustomersallrequest.md - docs/models/accountingcustomersallresponse.md + - docs/models/accountingcustomersallresponseresult.md - docs/models/accountingcustomersdeleteglobals.md - docs/models/accountingcustomersdeleterequest.md - docs/models/accountingcustomersdeleteresponse.md @@ -135,6 +150,7 @@ generatedFiles: - docs/models/accountingdepartmentsallglobals.md - docs/models/accountingdepartmentsallrequest.md - docs/models/accountingdepartmentsallresponse.md + - docs/models/accountingdepartmentsallresponseresult.md - docs/models/accountingdepartmentsdeleteglobals.md - docs/models/accountingdepartmentsdeleterequest.md - docs/models/accountingdepartmentsdeleteresponse.md @@ -151,6 +167,7 @@ generatedFiles: - docs/models/accountingexpensesallglobals.md - docs/models/accountingexpensesallrequest.md - docs/models/accountingexpensesallresponse.md + - docs/models/accountingexpensesallresponseresult.md - docs/models/accountingexpensesdeleteglobals.md - docs/models/accountingexpensesdeleterequest.md - docs/models/accountingexpensesdeleteresponse.md @@ -166,6 +183,7 @@ generatedFiles: - docs/models/accountinginvoiceitemsallglobals.md - docs/models/accountinginvoiceitemsallrequest.md - docs/models/accountinginvoiceitemsallresponse.md + - docs/models/accountinginvoiceitemsallresponseresult.md - docs/models/accountinginvoiceitemsdeleteglobals.md - docs/models/accountinginvoiceitemsdeleterequest.md - docs/models/accountinginvoiceitemsdeleteresponse.md @@ -181,6 +199,7 @@ generatedFiles: - docs/models/accountinginvoicesallglobals.md - docs/models/accountinginvoicesallrequest.md - docs/models/accountinginvoicesallresponse.md + - docs/models/accountinginvoicesallresponseresult.md - docs/models/accountinginvoicesdeleteglobals.md - docs/models/accountinginvoicesdeleterequest.md - docs/models/accountinginvoicesdeleteresponse.md @@ -196,6 +215,7 @@ generatedFiles: - docs/models/accountingjournalentriesallglobals.md - docs/models/accountingjournalentriesallrequest.md - docs/models/accountingjournalentriesallresponse.md + - docs/models/accountingjournalentriesallresponseresult.md - docs/models/accountingjournalentriesdeleteglobals.md - docs/models/accountingjournalentriesdeleterequest.md - docs/models/accountingjournalentriesdeleteresponse.md @@ -211,6 +231,7 @@ generatedFiles: - docs/models/accountingledgeraccountsallglobals.md - docs/models/accountingledgeraccountsallrequest.md - docs/models/accountingledgeraccountsallresponse.md + - docs/models/accountingledgeraccountsallresponseresult.md - docs/models/accountingledgeraccountsdeleteglobals.md - docs/models/accountingledgeraccountsdeleterequest.md - docs/models/accountingledgeraccountsdeleteresponse.md @@ -228,6 +249,7 @@ generatedFiles: - docs/models/accountinglocationsallglobals.md - docs/models/accountinglocationsallrequest.md - docs/models/accountinglocationsallresponse.md + - docs/models/accountinglocationsallresponseresult.md - docs/models/accountinglocationsdeleteglobals.md - docs/models/accountinglocationsdeleterequest.md - docs/models/accountinglocationsdeleteresponse.md @@ -244,6 +266,7 @@ generatedFiles: - docs/models/accountingpaymentsallglobals.md - docs/models/accountingpaymentsallrequest.md - docs/models/accountingpaymentsallresponse.md + - docs/models/accountingpaymentsallresponseresult.md - docs/models/accountingpaymentsdeleteglobals.md - docs/models/accountingpaymentsdeleterequest.md - docs/models/accountingpaymentsdeleteresponse.md @@ -262,6 +285,7 @@ generatedFiles: - docs/models/accountingpurchaseordersallglobals.md - docs/models/accountingpurchaseordersallrequest.md - docs/models/accountingpurchaseordersallresponse.md + - docs/models/accountingpurchaseordersallresponseresult.md - docs/models/accountingpurchaseordersdeleteglobals.md - docs/models/accountingpurchaseordersdeleterequest.md - docs/models/accountingpurchaseordersdeleteresponse.md @@ -277,6 +301,7 @@ generatedFiles: - docs/models/accountingsubsidiariesallglobals.md - docs/models/accountingsubsidiariesallrequest.md - docs/models/accountingsubsidiariesallresponse.md + - docs/models/accountingsubsidiariesallresponseresult.md - docs/models/accountingsubsidiariesdeleteglobals.md - docs/models/accountingsubsidiariesdeleterequest.md - docs/models/accountingsubsidiariesdeleteresponse.md @@ -292,6 +317,7 @@ generatedFiles: - docs/models/accountingsuppliersallglobals.md - docs/models/accountingsuppliersallrequest.md - docs/models/accountingsuppliersallresponse.md + - docs/models/accountingsuppliersallresponseresult.md - docs/models/accountingsuppliersdeleteglobals.md - docs/models/accountingsuppliersdeleterequest.md - docs/models/accountingsuppliersdeleteresponse.md @@ -307,6 +333,7 @@ generatedFiles: - docs/models/accountingtaxratesallglobals.md - docs/models/accountingtaxratesallrequest.md - docs/models/accountingtaxratesallresponse.md + - docs/models/accountingtaxratesallresponseresult.md - docs/models/accountingtaxratesdeleteglobals.md - docs/models/accountingtaxratesdeleterequest.md - docs/models/accountingtaxratesdeleteresponse.md @@ -322,6 +349,7 @@ generatedFiles: - docs/models/accountingtrackingcategoriesallglobals.md - docs/models/accountingtrackingcategoriesallrequest.md - docs/models/accountingtrackingcategoriesallresponse.md + - docs/models/accountingtrackingcategoriesallresponseresult.md - docs/models/accountingtrackingcategoriesdeleteglobals.md - docs/models/accountingtrackingcategoriesdeleterequest.md - docs/models/accountingtrackingcategoriesdeleteresponse.md @@ -344,6 +372,9 @@ generatedFiles: - docs/models/activitytype.md - docs/models/address.md - docs/models/addresses.md + - docs/models/agedcreditors.md + - docs/models/ageddebtors.md + - docs/models/agedreportfilter.md - docs/models/allocation.md - docs/models/allocationinput.md - docs/models/allocations.md @@ -370,6 +401,7 @@ generatedFiles: - docs/models/atsapplicantsallglobals.md - docs/models/atsapplicantsallrequest.md - docs/models/atsapplicantsallresponse.md + - docs/models/atsapplicantsallresponseresult.md - docs/models/atsapplicantsdeleteglobals.md - docs/models/atsapplicantsdeleterequest.md - docs/models/atsapplicantsdeleteresponse.md @@ -385,6 +417,7 @@ generatedFiles: - docs/models/atsapplicationsallglobals.md - docs/models/atsapplicationsallrequest.md - docs/models/atsapplicationsallresponse.md + - docs/models/atsapplicationsallresponseresult.md - docs/models/atsapplicationsdeleteglobals.md - docs/models/atsapplicationsdeleterequest.md - docs/models/atsapplicationsdeleteresponse.md @@ -397,6 +430,7 @@ generatedFiles: - docs/models/atsjobsallglobals.md - docs/models/atsjobsallrequest.md - docs/models/atsjobsallresponse.md + - docs/models/atsjobsallresponseresult.md - docs/models/atsjobsoneglobals.md - docs/models/atsjobsonerequest.md - docs/models/atsjobsoneresponse.md @@ -408,6 +442,8 @@ generatedFiles: - docs/models/authtype.md - docs/models/badrequestresponse.md - docs/models/badrequestresponsedetail.md + - docs/models/balancebyperiod.md + - docs/models/balancebytransaction.md - docs/models/balancesheet.md - docs/models/balancesheetassetsaccount.md - docs/models/balancesheetequityaccount.md @@ -474,6 +510,7 @@ generatedFiles: - docs/models/connectorapisallglobals.md - docs/models/connectorapisallrequest.md - docs/models/connectorapisallresponse.md + - docs/models/connectorapisallresponseresult.md - docs/models/connectorapisoneglobals.md - docs/models/connectorapisonerequest.md - docs/models/connectorapisoneresponse.md @@ -487,6 +524,7 @@ generatedFiles: - docs/models/connectorconnectorsallglobals.md - docs/models/connectorconnectorsallrequest.md - docs/models/connectorconnectorsallresponse.md + - docs/models/connectorconnectorsallresponseresult.md - docs/models/connectorconnectorsoneglobals.md - docs/models/connectorconnectorsonerequest.md - docs/models/connectorconnectorsoneresponse.md @@ -578,6 +616,7 @@ generatedFiles: - docs/models/crmactivitiesallglobals.md - docs/models/crmactivitiesallrequest.md - docs/models/crmactivitiesallresponse.md + - docs/models/crmactivitiesallresponseresult.md - docs/models/crmactivitiesdeleteglobals.md - docs/models/crmactivitiesdeleterequest.md - docs/models/crmactivitiesdeleteresponse.md @@ -593,6 +632,7 @@ generatedFiles: - docs/models/crmcompaniesallglobals.md - docs/models/crmcompaniesallrequest.md - docs/models/crmcompaniesallresponse.md + - docs/models/crmcompaniesallresponseresult.md - docs/models/crmcompaniesdeleteglobals.md - docs/models/crmcompaniesdeleterequest.md - docs/models/crmcompaniesdeleteresponse.md @@ -608,6 +648,7 @@ generatedFiles: - docs/models/crmcontactsallglobals.md - docs/models/crmcontactsallrequest.md - docs/models/crmcontactsallresponse.md + - docs/models/crmcontactsallresponseresult.md - docs/models/crmcontactsdeleteglobals.md - docs/models/crmcontactsdeleterequest.md - docs/models/crmcontactsdeleteresponse.md @@ -623,6 +664,7 @@ generatedFiles: - docs/models/crmleadsallglobals.md - docs/models/crmleadsallrequest.md - docs/models/crmleadsallresponse.md + - docs/models/crmleadsallresponseresult.md - docs/models/crmleadsdeleteglobals.md - docs/models/crmleadsdeleterequest.md - docs/models/crmleadsdeleteresponse.md @@ -638,6 +680,7 @@ generatedFiles: - docs/models/crmnotesallglobals.md - docs/models/crmnotesallrequest.md - docs/models/crmnotesallresponse.md + - docs/models/crmnotesallresponseresult.md - docs/models/crmnotesdeleteglobals.md - docs/models/crmnotesdeleterequest.md - docs/models/crmnotesdeleteresponse.md @@ -653,6 +696,7 @@ generatedFiles: - docs/models/crmopportunitiesallglobals.md - docs/models/crmopportunitiesallrequest.md - docs/models/crmopportunitiesallresponse.md + - docs/models/crmopportunitiesallresponseresult.md - docs/models/crmopportunitiesdeleteglobals.md - docs/models/crmopportunitiesdeleterequest.md - docs/models/crmopportunitiesdeleteresponse.md @@ -668,6 +712,7 @@ generatedFiles: - docs/models/crmpipelinesallglobals.md - docs/models/crmpipelinesallrequest.md - docs/models/crmpipelinesallresponse.md + - docs/models/crmpipelinesallresponseresult.md - docs/models/crmpipelinesdeleteglobals.md - docs/models/crmpipelinesdeleterequest.md - docs/models/crmpipelinesdeleteresponse.md @@ -683,6 +728,7 @@ generatedFiles: - docs/models/crmusersallglobals.md - docs/models/crmusersallrequest.md - docs/models/crmusersallresponse.md + - docs/models/crmusersallresponseresult.md - docs/models/crmusersdeleteglobals.md - docs/models/crmusersdeleterequest.md - docs/models/crmusersdeleteresponse.md @@ -773,6 +819,7 @@ generatedFiles: - docs/models/ecommercecustomersallglobals.md - docs/models/ecommercecustomersallrequest.md - docs/models/ecommercecustomersallresponse.md + - docs/models/ecommercecustomersallresponseresult.md - docs/models/ecommercecustomersfilter.md - docs/models/ecommercecustomersoneglobals.md - docs/models/ecommercecustomersonerequest.md @@ -785,6 +832,7 @@ generatedFiles: - docs/models/ecommerceordersallglobals.md - docs/models/ecommerceordersallrequest.md - docs/models/ecommerceordersallresponse.md + - docs/models/ecommerceordersallresponseresult.md - docs/models/ecommerceordersfilter.md - docs/models/ecommerceordersoneglobals.md - docs/models/ecommerceordersonerequest.md @@ -797,6 +845,7 @@ generatedFiles: - docs/models/ecommerceproductsallglobals.md - docs/models/ecommerceproductsallrequest.md - docs/models/ecommerceproductsallresponse.md + - docs/models/ecommerceproductsallresponseresult.md - docs/models/ecommerceproductsoneglobals.md - docs/models/ecommerceproductsonerequest.md - docs/models/ecommerceproductsoneresponse.md @@ -847,6 +896,7 @@ generatedFiles: - docs/models/filestoragedrivegroupsallglobals.md - docs/models/filestoragedrivegroupsallrequest.md - docs/models/filestoragedrivegroupsallresponse.md + - docs/models/filestoragedrivegroupsallresponseresult.md - docs/models/filestoragedrivegroupsdeleteglobals.md - docs/models/filestoragedrivegroupsdeleterequest.md - docs/models/filestoragedrivegroupsdeleteresponse.md @@ -862,6 +912,7 @@ generatedFiles: - docs/models/filestoragedrivesallglobals.md - docs/models/filestoragedrivesallrequest.md - docs/models/filestoragedrivesallresponse.md + - docs/models/filestoragedrivesallresponseresult.md - docs/models/filestoragedrivesdeleteglobals.md - docs/models/filestoragedrivesdeleterequest.md - docs/models/filestoragedrivesdeleteresponse.md @@ -874,6 +925,7 @@ generatedFiles: - docs/models/filestoragefilesallglobals.md - docs/models/filestoragefilesallrequest.md - docs/models/filestoragefilesallresponse.md + - docs/models/filestoragefilesallresponseresult.md - docs/models/filestoragefilesdeleteglobals.md - docs/models/filestoragefilesdeleterequest.md - docs/models/filestoragefilesdeleteresponse.md @@ -913,6 +965,7 @@ generatedFiles: - docs/models/filestoragesharedlinksallglobals.md - docs/models/filestoragesharedlinksallrequest.md - docs/models/filestoragesharedlinksallresponse.md + - docs/models/filestoragesharedlinksallresponseresult.md - docs/models/filestoragesharedlinksdeleteglobals.md - docs/models/filestoragesharedlinksdeleterequest.md - docs/models/filestoragesharedlinksdeleteresponse.md @@ -953,6 +1006,8 @@ generatedFiles: - docs/models/getaccountinglocationsresponse.md - docs/models/getactivitiesresponse.md - docs/models/getactivityresponse.md + - docs/models/getagedcreditorsresponse.md + - docs/models/getageddebtorsresponse.md - docs/models/getapiresourcecoverageresponse.md - docs/models/getapiresourceresponse.md - docs/models/getapiresponse.md @@ -1073,6 +1128,7 @@ generatedFiles: - docs/models/hriscompaniesallglobals.md - docs/models/hriscompaniesallrequest.md - docs/models/hriscompaniesallresponse.md + - docs/models/hriscompaniesallresponseresult.md - docs/models/hriscompaniesdeleteglobals.md - docs/models/hriscompaniesdeleterequest.md - docs/models/hriscompaniesdeleteresponse.md @@ -1091,6 +1147,7 @@ generatedFiles: - docs/models/hrisdepartmentsallglobals.md - docs/models/hrisdepartmentsallrequest.md - docs/models/hrisdepartmentsallresponse.md + - docs/models/hrisdepartmentsallresponseresult.md - docs/models/hrisdepartmentsdeleteglobals.md - docs/models/hrisdepartmentsdeleterequest.md - docs/models/hrisdepartmentsdeleteresponse.md @@ -1112,6 +1169,7 @@ generatedFiles: - docs/models/hrisemployeesallglobals.md - docs/models/hrisemployeesallrequest.md - docs/models/hrisemployeesallresponse.md + - docs/models/hrisemployeesallresponseresult.md - docs/models/hrisemployeeschedulesallglobals.md - docs/models/hrisemployeeschedulesallrequest.md - docs/models/hrisemployeeschedulesallresponse.md @@ -1136,6 +1194,7 @@ generatedFiles: - docs/models/hristimeoffrequestsallglobals.md - docs/models/hristimeoffrequestsallrequest.md - docs/models/hristimeoffrequestsallresponse.md + - docs/models/hristimeoffrequestsallresponseresult.md - docs/models/hristimeoffrequestsdeleteglobals.md - docs/models/hristimeoffrequestsdeleterequest.md - docs/models/hristimeoffrequestsdeleteresponse.md @@ -1173,24 +1232,28 @@ generatedFiles: - docs/models/issuetrackingcollectionsallglobals.md - docs/models/issuetrackingcollectionsallrequest.md - docs/models/issuetrackingcollectionsallresponse.md + - docs/models/issuetrackingcollectionsallresponseresult.md - docs/models/issuetrackingcollectionsoneglobals.md - docs/models/issuetrackingcollectionsonerequest.md - docs/models/issuetrackingcollectionsoneresponse.md - docs/models/issuetrackingcollectiontagsallglobals.md - docs/models/issuetrackingcollectiontagsallrequest.md - docs/models/issuetrackingcollectiontagsallresponse.md + - docs/models/issuetrackingcollectiontagsallresponseresult.md - docs/models/issuetrackingcollectionticketcommentsaddglobals.md - docs/models/issuetrackingcollectionticketcommentsaddrequest.md - docs/models/issuetrackingcollectionticketcommentsaddresponse.md - docs/models/issuetrackingcollectionticketcommentsallglobals.md - docs/models/issuetrackingcollectionticketcommentsallrequest.md - docs/models/issuetrackingcollectionticketcommentsallresponse.md + - docs/models/issuetrackingcollectionticketcommentsallresponseresult.md - docs/models/issuetrackingcollectionticketcommentsdeleteglobals.md - docs/models/issuetrackingcollectionticketcommentsdeleterequest.md - docs/models/issuetrackingcollectionticketcommentsdeleteresponse.md - docs/models/issuetrackingcollectionticketcommentsoneglobals.md - docs/models/issuetrackingcollectionticketcommentsonerequest.md - docs/models/issuetrackingcollectionticketcommentsoneresponse.md + - docs/models/issuetrackingcollectionticketcommentsoneresponseresult.md - docs/models/issuetrackingcollectionticketcommentsupdateglobals.md - docs/models/issuetrackingcollectionticketcommentsupdaterequest.md - docs/models/issuetrackingcollectionticketcommentsupdateresponse.md @@ -1200,6 +1263,7 @@ generatedFiles: - docs/models/issuetrackingcollectionticketsallglobals.md - docs/models/issuetrackingcollectionticketsallrequest.md - docs/models/issuetrackingcollectionticketsallresponse.md + - docs/models/issuetrackingcollectionticketsallresponseresult.md - docs/models/issuetrackingcollectionticketsdeleteglobals.md - docs/models/issuetrackingcollectionticketsdeleterequest.md - docs/models/issuetrackingcollectionticketsdeleteresponse.md @@ -1212,6 +1276,7 @@ generatedFiles: - docs/models/issuetrackingcollectionusersallglobals.md - docs/models/issuetrackingcollectionusersallrequest.md - docs/models/issuetrackingcollectionusersallresponse.md + - docs/models/issuetrackingcollectionusersallresponseresult.md - docs/models/issuetrackingcollectionusersoneglobals.md - docs/models/issuetrackingcollectionusersonerequest.md - docs/models/issuetrackingcollectionusersoneresponse.md @@ -1288,6 +1353,8 @@ generatedFiles: - docs/models/options.md - docs/models/orderssort.md - docs/models/orderssortby.md + - docs/models/outstandingbalance.md + - docs/models/outstandingbalancebycurrency.md - docs/models/owner.md - docs/models/paginationcoverage.md - docs/models/paginationcoveragemode.md @@ -1358,6 +1425,7 @@ generatedFiles: - docs/models/smsmessagesallglobals.md - docs/models/smsmessagesallrequest.md - docs/models/smsmessagesallresponse.md + - docs/models/smsmessagesallresponseresult.md - docs/models/smsmessagesdeleteglobals.md - docs/models/smsmessagesdeleterequest.md - docs/models/smsmessagesdeleteresponse.md @@ -1412,6 +1480,7 @@ generatedFiles: - docs/models/trackingcategorystatus.md - docs/models/trackingcategorysubsidiaries.md - docs/models/trackingitem.md + - docs/models/transactiontype.md - docs/models/type.md - docs/models/unauthorizedresponse.md - docs/models/unauthorizedresponsedetail.md @@ -1515,6 +1584,7 @@ generatedFiles: - docs/models/vaultconsumersallglobals.md - docs/models/vaultconsumersallrequest.md - docs/models/vaultconsumersallresponse.md + - docs/models/vaultconsumersallresponseresult.md - docs/models/vaultconsumersdeleteglobals.md - docs/models/vaultconsumersdeleterequest.md - docs/models/vaultconsumersdeleteresponse.md @@ -1536,6 +1606,7 @@ generatedFiles: - docs/models/vaultlogsallglobals.md - docs/models/vaultlogsallrequest.md - docs/models/vaultlogsallresponse.md + - docs/models/vaultlogsallresponseresult.md - docs/models/vaultsessionscreateglobals.md - docs/models/vaultsessionscreateresponse.md - docs/models/vaultvalidateconnectionstateglobals.md @@ -1549,6 +1620,7 @@ generatedFiles: - docs/models/webhookeventlogsallglobals.md - docs/models/webhookeventlogsallrequest.md - docs/models/webhookeventlogsallresponse.md + - docs/models/webhookeventlogsallresponseresult.md - docs/models/webhookeventlogservice.md - docs/models/webhookeventlogsfilter.md - docs/models/webhookeventlogsfilterservice.md @@ -1561,6 +1633,7 @@ generatedFiles: - docs/models/webhookwebhooksallglobals.md - docs/models/webhookwebhooksallrequest.md - docs/models/webhookwebhooksallresponse.md + - docs/models/webhookwebhooksallresponseresult.md - docs/models/webhookwebhooksdeleteglobals.md - docs/models/webhookwebhooksdeleterequest.md - docs/models/webhookwebhooksdeleteresponse.md @@ -1576,6 +1649,8 @@ generatedFiles: - docs/models/workpattern.md - docs/sdks/accounting/README.md - docs/sdks/activities/README.md + - docs/sdks/agedcreditorssdk/README.md + - docs/sdks/ageddebtorssdk/README.md - docs/sdks/apideck/README.md - docs/sdks/apideckcompanies/README.md - docs/sdks/apideckcustomers/README.md @@ -1673,6 +1748,8 @@ generatedFiles: - src/apideck_unify/_version.py - src/apideck_unify/accounting.py - src/apideck_unify/activities.py + - src/apideck_unify/agedcreditors_sdk.py + - src/apideck_unify/ageddebtors_sdk.py - src/apideck_unify/apideck_companies.py - src/apideck_unify/apideck_customers.py - src/apideck_unify/apideck_departments.py @@ -1735,6 +1812,8 @@ generatedFiles: - src/apideck_unify/logs.py - src/apideck_unify/messages.py - src/apideck_unify/models/__init__.py + - src/apideck_unify/models/accounting_agedcreditorsoneop.py + - src/apideck_unify/models/accounting_ageddebtorsoneop.py - src/apideck_unify/models/accounting_attachmentsallop.py - src/apideck_unify/models/accounting_attachmentsdeleteop.py - src/apideck_unify/models/accounting_attachmentsdownloadop.py @@ -1836,6 +1915,9 @@ generatedFiles: - src/apideck_unify/models/activity.py - src/apideck_unify/models/activityattendee.py - src/apideck_unify/models/address.py + - src/apideck_unify/models/agedcreditors.py + - src/apideck_unify/models/ageddebtors.py + - src/apideck_unify/models/agedreportfilter.py - src/apideck_unify/models/allocation.py - src/apideck_unify/models/api.py - src/apideck_unify/models/apierror.py @@ -1865,6 +1947,8 @@ generatedFiles: - src/apideck_unify/models/attachmentreferencetype.py - src/apideck_unify/models/authtype.py - src/apideck_unify/models/badrequestresponse.py + - src/apideck_unify/models/balancebyperiod.py + - src/apideck_unify/models/balancebytransaction.py - src/apideck_unify/models/balancesheet.py - src/apideck_unify/models/balancesheetfilter.py - src/apideck_unify/models/bankaccount.py @@ -2144,6 +2228,8 @@ generatedFiles: - src/apideck_unify/models/getaccountinglocationsresponse.py - src/apideck_unify/models/getactivitiesresponse.py - src/apideck_unify/models/getactivityresponse.py + - src/apideck_unify/models/getagedcreditorsresponse.py + - src/apideck_unify/models/getageddebtorsresponse.py - src/apideck_unify/models/getapiresourcecoverageresponse.py - src/apideck_unify/models/getapiresourceresponse.py - src/apideck_unify/models/getapiresponse.py @@ -2353,6 +2439,8 @@ generatedFiles: - src/apideck_unify/models/opportunity.py - src/apideck_unify/models/opportunity_input.py - src/apideck_unify/models/orderssort.py + - src/apideck_unify/models/outstandingbalance.py + - src/apideck_unify/models/outstandingbalancebycurrency.py - src/apideck_unify/models/owner.py - src/apideck_unify/models/paginationcoverage.py - src/apideck_unify/models/passthroughbody.py @@ -2593,7 +2681,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -2675,7 +2763,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.billsAll: "": parameters: @@ -2723,7 +2811,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -2805,7 +2893,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.invoicesAll: "": parameters: @@ -2935,7 +3023,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.ledgerAccountsAll: "": parameters: @@ -2987,7 +3075,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.ledgerAccountsOne: "": parameters: @@ -3065,7 +3153,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.invoiceItemsAll: "": parameters: @@ -3112,7 +3200,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -3195,7 +3283,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.creditNotesAll: "": parameters: @@ -3325,7 +3413,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.customersAll: "": parameters: @@ -3373,7 +3461,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -3455,7 +3543,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.suppliersAll: "": parameters: @@ -3503,7 +3591,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -3585,7 +3673,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.paymentsAll: "": parameters: @@ -3629,7 +3717,7 @@ examples: "400": application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} "401": - application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": {"statusCode": 401, "error": "Unauthorized", "message": "Missing authentication"}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": @@ -3715,7 +3803,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.companyInfoOne: "": parameters: @@ -3838,7 +3926,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -3920,7 +4008,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.purchaseOrdersAll: "": parameters: @@ -3967,7 +4055,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -4048,7 +4136,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.subsidiariesAll: "": parameters: @@ -4097,7 +4185,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.subsidiariesOne: "": parameters: @@ -4175,7 +4263,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.locationsAll: "": parameters: @@ -4221,7 +4309,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -4303,7 +4391,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.departmentsAll: "": parameters: @@ -4349,7 +4437,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -4431,7 +4519,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.attachmentsAll: "": parameters: @@ -4513,7 +4601,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.attachmentsDownload: "": parameters: @@ -4590,7 +4678,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.trackingCategoriesOne: "": parameters: @@ -4668,7 +4756,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.billPaymentsAll: "": parameters: @@ -4712,7 +4800,7 @@ examples: "400": application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} "401": - application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": {"statusCode": 401, "error": "Unauthorized", "message": "Missing authentication"}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": @@ -4798,7 +4886,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} accounting.expensesAll: "": parameters: @@ -4838,7 +4926,7 @@ examples: "400": application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} "401": - application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": {"statusCode": 401, "error": "Unauthorized", "message": "Missing authentication"}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": @@ -4923,7 +5011,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} ats.jobsAll: "": parameters: @@ -5021,7 +5109,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -5103,7 +5191,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} ats.applicationsAll: "": parameters: @@ -5152,7 +5240,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} ats.applicationsOne: "": parameters: @@ -5229,7 +5317,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.companiesAll: "": parameters: @@ -5359,7 +5447,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.contactsAll: "": parameters: @@ -5490,7 +5578,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.opportunitiesAll: "": parameters: @@ -5538,7 +5626,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -5620,7 +5708,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.leadsAll: "": parameters: @@ -5750,7 +5838,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.pipelinesAll: "": parameters: @@ -5796,7 +5884,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -5878,7 +5966,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.notesAll: "": parameters: @@ -5928,7 +6016,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.notesOne: "": parameters: @@ -6006,7 +6094,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.usersAll: "": parameters: @@ -6052,7 +6140,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -6134,7 +6222,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} crm.activitiesAll: "": parameters: @@ -6182,7 +6270,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -6264,7 +6352,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} ecommerce.ordersAll: "": parameters: @@ -6577,7 +6665,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.filesDownload: "": parameters: @@ -6655,7 +6743,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.foldersOne: "": parameters: @@ -6733,7 +6821,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.foldersCopy: "": parameters: @@ -6811,7 +6899,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.sharedLinksOne: "": parameters: @@ -6889,7 +6977,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.uploadSessionsAdd: "": parameters: @@ -6914,7 +7002,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.uploadSessionsOne: "": parameters: @@ -6965,7 +7053,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.uploadSessionsFinish: "": parameters: @@ -7041,7 +7129,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.drivesOne: "": parameters: @@ -7119,7 +7207,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.driveGroupsAll: "": parameters: @@ -7170,7 +7258,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} fileStorage.driveGroupsOne: "": parameters: @@ -7248,7 +7336,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} hris.employeesAll: "": parameters: @@ -7298,7 +7386,7 @@ examples: "404": application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": - application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": {"error": "Unprocessable", "message": "Unprocessable request, please verify your request headers and body."}, "ref": "https://developers.apideck.com/errors#invalidstateerror"} + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} hris.employeesOne: @@ -7380,7 +7468,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} hris.companiesAll: "": parameters: @@ -7422,7 +7510,7 @@ examples: "400": application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} "401": - application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": {"statusCode": 401, "error": "Unauthorized", "message": "Missing authentication"}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": @@ -7508,7 +7596,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} hris.departmentsAll: "": parameters: @@ -7558,7 +7646,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} hris.departmentsOne: "": parameters: @@ -7636,7 +7724,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} hris.payrollsAll: "": parameters: @@ -7821,7 +7909,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} hris.timeOffRequestsOne: "": parameters: @@ -7902,7 +7990,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} sms.messagesAll: "": parameters: @@ -7951,7 +8039,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} sms.messagesOne: "": parameters: @@ -8029,7 +8117,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} issueTracking.collectionsAll: "": parameters: @@ -8133,7 +8221,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -8218,7 +8306,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} issueTracking.collectionTicketCommentsAll: "": parameters: @@ -8275,7 +8363,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} issueTracking.collectionTicketCommentsOne: "": parameters: @@ -8359,7 +8447,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} issueTracking.collectionUsersAll: "": parameters: @@ -8612,7 +8700,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} vault.consumersAll: "": parameters: @@ -8701,7 +8789,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} vault.consumerRequestCountsAll: "": parameters: @@ -8822,7 +8910,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} vault.connectionsImport: "": parameters: @@ -8870,7 +8958,7 @@ examples: "404": application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": - application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": {"error": "Unprocessable", "message": "Unprocessable request, please verify your request headers and body."}, "ref": "https://developers.apideck.com/errors#invalidstateerror"} + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} vault.validateConnectionState: @@ -8892,7 +8980,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": {"error": "Unprocessable", "message": "Unprocessable request, please verify your request headers and body."}, "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -8918,7 +9006,7 @@ examples: "402": application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} "404": - application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": {"error": "Unprocessable", "message": "Unprocessable request, please verify your request headers and body."}, "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: @@ -9187,7 +9275,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} webhook.webhooksDelete: "": parameters: @@ -9209,7 +9297,7 @@ examples: "422": application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: - application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": {"missing": [{"x-apideck-consumer-id": "required"}]}, "ref": "https://developers.apideck.com/errors#unauthorizederror"} + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} webhook.eventLogsAll: "": parameters: @@ -9232,4 +9320,56 @@ examples: application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": {"error": "Unprocessable", "message": "Unprocessable request, please verify your request headers and body."}, "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.agedCreditorsOne: + "": + parameters: + query: + filter: {"customer_id": "123abc", "report_as_of_date": "2024-01-01", "period_count": 3, "period_length": 30} + pass_through: {"search": "San Francisco"} + fields: "id,updated_at" + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "AgedCreditors", "operation": "one", "data": {"report_generated_at": "2024-11-14T12:00:00.000Z", "report_as_of_date": "2024-11-13", "period_count": 4, "period_length": 30, "outstanding_balances": [{"customer_id": "123", "customer_name": "Super Store", "outstanding_balances_by_currency": [{"currency": "USD", "balances_by_period": [{"start_date": "2024-01-01", "end_date": "2024-01-30", "total_amount": 1500, "balances_by_transaction": [{"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}, {"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}]}, {"start_date": "2024-01-01", "end_date": "2024-01-30", "total_amount": 1500, "balances_by_transaction": [{"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}, {"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}, {"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}]}]}, {"currency": "USD", "balances_by_period": [{"start_date": "2024-01-01", "end_date": "2024-01-30", "total_amount": 1500, "balances_by_transaction": [{"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}]}]}]}, {"customer_id": "123", "customer_name": "Super Store", "outstanding_balances_by_currency": [{"currency": "USD", "balances_by_period": []}]}]}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": {"missing": [{"foobar": "required"}]}, "ref": "https://developers.apideck.com/errors#requestvalidationerror"} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.agedDebtorsOne: + "": + parameters: + query: + filter: {"customer_id": "123abc", "report_as_of_date": "2024-01-01", "period_count": 3, "period_length": 30} + pass_through: {"search": "San Francisco"} + fields: "id,updated_at" + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "AgedDebtors", "operation": "one", "data": {"report_generated_at": "2024-11-14T12:00:00.000Z", "report_as_of_date": "2024-11-13", "period_count": 4, "period_length": 30, "outstanding_balances": [{"customer_id": "123", "customer_name": "Super Store", "outstanding_balances_by_currency": [{"currency": "USD", "balances_by_period": [{"start_date": "2024-01-01", "end_date": "2024-01-30", "total_amount": 1500, "balances_by_transaction": [{"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}, {"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}]}, {"start_date": "2024-01-01", "end_date": "2024-01-30", "total_amount": 1500, "balances_by_transaction": [{"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}, {"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}, {"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}]}]}, {"currency": "USD", "balances_by_period": [{"start_date": "2024-01-01", "end_date": "2024-01-30", "total_amount": 1500, "balances_by_transaction": [{"transaction_id": "INV-1001", "transaction_date": "2024-01-15", "transaction_type": "invoice", "due_date": "2024-02-15", "original_amount": 1000, "outstanding_balance": 800}]}]}]}, {"customer_id": "123", "customer_name": "Super Store", "outstanding_balances_by_currency": [{"currency": "USD", "balances_by_period": []}]}]}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": {"missing": [{"foobar": "required"}]}, "ref": "https://developers.apideck.com/errors#requestvalidationerror"} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": {"not_found": {"entity": "widget", "id": "123"}}, "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2a8cc718..80200126 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,7 +16,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true python: - version: 0.1.7 + version: 0.2.0 additionalDependencies: dev: {} main: {} @@ -30,7 +30,7 @@ python: fixFlags: responseRequiredSep2024: true flattenGlobalSecurity: true - flattenRequests: true # keyword arguments are more idiomatic in python + flattenRequests: true flatteningOrder: parameters-first imports: option: openapi @@ -41,7 +41,7 @@ python: shared: "" webhooks: "" inputModelSuffix: input - maxMethodParams: 999 # an arbitrarily high number, keyword arguments are more idiomatic in python + maxMethodParams: 999 methodArguments: infer-optional-args outputModelSuffix: output packageName: apideck-unify diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f5e2e107..fd09ce49 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,20 +1,21 @@ -speakeasyVersion: 1.453.8 +speakeasyVersion: 1.455.7 sources: Apideck: sourceNamespace: apideck - sourceRevisionDigest: sha256:4370f91648df925a9cd5ee51f82e76448642303ca9fde1ea6aadf656bfe5694e - sourceBlobDigest: sha256:19939b73f05d1c30fba2779c43866e9c4d163b4e97a074b3a8961a34e04e5e8f + sourceRevisionDigest: sha256:7ad98940134a0b924d775969413213f4b1482c45c5c9d403e320b0ce7bb53497 + sourceBlobDigest: sha256:9bef0e086cb2350115d5a1ae42a521b9afd171752d7b9a5628ee0eab8c7e3ca0 tags: - latest - - 10.8.3 + - speakeasy-sdk-regen-1734394679 + - 10.9.0 targets: apideck: source: Apideck sourceNamespace: apideck - sourceRevisionDigest: sha256:4370f91648df925a9cd5ee51f82e76448642303ca9fde1ea6aadf656bfe5694e - sourceBlobDigest: sha256:19939b73f05d1c30fba2779c43866e9c4d163b4e97a074b3a8961a34e04e5e8f + sourceRevisionDigest: sha256:7ad98940134a0b924d775969413213f4b1482c45c5c9d403e320b0ce7bb53497 + sourceBlobDigest: sha256:9bef0e086cb2350115d5a1ae42a521b9afd171752d7b9a5628ee0eab8c7e3ca0 codeSamplesNamespace: apideck-python-code-samples - codeSamplesRevisionDigest: sha256:3e9b2e781657df8ba931972b4537cab054eedda9568491c6d850f139a1b9c52b + codeSamplesRevisionDigest: sha256:35106c07382fcda3b0d6ce19e116943fdf606a8bb7d1fc4a6d3b7bc31927c171 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index e16ba403..020d1831 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ For more information about the API: [Apideck Developer Docs](https://developers. * [SDK Example Usage](#sdk-example-usage) * [Authentication](#authentication) * [Available Resources and Operations](#available-resources-and-operations) + * [Pagination](#pagination) * [Retries](#retries) * [Error Handling](#error-handling) * [Server Selection](#server-selection) @@ -89,24 +90,21 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.list(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ```
@@ -124,24 +122,21 @@ async def main(): consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = await apideck.accounting.tax_rates.list_async(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = await apideck.accounting.tax_rates.list_async(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() asyncio.run(main()) ``` @@ -168,24 +163,21 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.list(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` @@ -199,6 +191,14 @@ with Apideck( ### [accounting](docs/sdks/accounting/README.md) +#### [accounting.aged_creditors](docs/sdks/agedcreditorssdk/README.md) + +* [get](docs/sdks/agedcreditorssdk/README.md#get) - Get Aged Creditors + +#### [accounting.aged_debtors](docs/sdks/ageddebtorssdk/README.md) + +* [get](docs/sdks/ageddebtorssdk/README.md#get) - Get Aged Debtors + #### [accounting.attachments](docs/sdks/attachments/README.md) * [list](docs/sdks/attachments/README.md#list) - List Attachments @@ -717,6 +717,42 @@ with Apideck( + +## Pagination + +Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the +returned response object will have a `Next` method that can be called to pull down the next group of results. If the +return value of `Next` is `None`, then there are no more pages to be fetched. + +Here's an example of one such pagination call: +```python +from apideck_unify import Apideck +import os + +with Apideck( + api_key=os.getenv("APIDECK_API_KEY", ""), + consumer_id="test-consumer", + app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", +) as apideck: + + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() + +``` + + ## Retries @@ -733,25 +769,22 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.list(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }, + + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at", RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` @@ -767,24 +800,21 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.list(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` @@ -827,24 +857,21 @@ with Apideck( ) as apideck: res = None try: - res = apideck.accounting.tax_rates.list(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() except models.BadRequestResponse as e: # handle e.data: models.BadRequestResponseData @@ -883,24 +910,21 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.list(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` @@ -916,39 +940,33 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.upload_sessions.create(create_upload_session_request={ - "name": "Documents", - "parent_folder_id": "1234", - "size": 1810673, - "drive_id": "1234", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.upload_sessions.create(name="Documents", parent_folder_id="1234", size=1810673, service_id="salesforce", drive_id="1234", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce", server_url="https://upload.apideck.com") - - if res is not None: - # handle response - pass + }, + ], + }, + ], server_url="https://upload.apideck.com") + + # Handle response + print(res) ``` diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 00000000..dd7a9322 --- /dev/null +++ b/RELEASES.md @@ -0,0 +1,11 @@ + + +## 2024-12-17 00:17:55 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.455.7 (2.480.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.2.0] . +### Releases +- [PyPI v0.2.0] https://pypi.org/project/apideck-unify/0.2.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 3897ae4e..4740e4bb 100644 --- a/USAGE.md +++ b/USAGE.md @@ -9,24 +9,21 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.list(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ```
@@ -44,24 +41,21 @@ async def main(): consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = await apideck.accounting.tax_rates.list_async(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = await apideck.accounting.tax_rates.list_async(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() asyncio.run(main()) ``` diff --git a/docs/models/accountingagedcreditorsoneglobals.md b/docs/models/accountingagedcreditorsoneglobals.md new file mode 100644 index 00000000..75b5cafc --- /dev/null +++ b/docs/models/accountingagedcreditorsoneglobals.md @@ -0,0 +1,9 @@ +# AccountingAgedCreditorsOneGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `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 | \ No newline at end of file diff --git a/docs/models/accountingagedcreditorsonerequest.md b/docs/models/accountingagedcreditorsonerequest.md new file mode 100644 index 00000000..40ccf114 --- /dev/null +++ b/docs/models/accountingagedcreditorsonerequest.md @@ -0,0 +1,12 @@ +# AccountingAgedCreditorsOneRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `filter_` | [Optional[models.AgedReportFilter]](../models/agedreportfilter.md) | :heavy_minus_sign: | Apply filters | {
"customer_id": "123abc",
"report_as_of_date": "2024-01-01",
"period_count": 3,
"period_length": 30
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file diff --git a/docs/models/accountingagedcreditorsoneresponse.md b/docs/models/accountingagedcreditorsoneresponse.md new file mode 100644 index 00000000..de2976ff --- /dev/null +++ b/docs/models/accountingagedcreditorsoneresponse.md @@ -0,0 +1,17 @@ +# AccountingAgedCreditorsOneResponse + + +## Supported Types + +### `models.GetAgedCreditorsResponse` + +```python +value: models.GetAgedCreditorsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingageddebtorsoneglobals.md b/docs/models/accountingageddebtorsoneglobals.md new file mode 100644 index 00000000..86c3330b --- /dev/null +++ b/docs/models/accountingageddebtorsoneglobals.md @@ -0,0 +1,9 @@ +# AccountingAgedDebtorsOneGlobals + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `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 | \ No newline at end of file diff --git a/docs/models/accountingageddebtorsonerequest.md b/docs/models/accountingageddebtorsonerequest.md new file mode 100644 index 00000000..3464963a --- /dev/null +++ b/docs/models/accountingageddebtorsonerequest.md @@ -0,0 +1,12 @@ +# AccountingAgedDebtorsOneRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `filter_` | [Optional[models.AgedReportFilter]](../models/agedreportfilter.md) | :heavy_minus_sign: | Apply filters | {
"customer_id": "123abc",
"report_as_of_date": "2024-01-01",
"period_count": 3,
"period_length": 30
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file diff --git a/docs/models/accountingageddebtorsoneresponse.md b/docs/models/accountingageddebtorsoneresponse.md new file mode 100644 index 00000000..fc51e073 --- /dev/null +++ b/docs/models/accountingageddebtorsoneresponse.md @@ -0,0 +1,17 @@ +# AccountingAgedDebtorsOneResponse + + +## Supported Types + +### `models.GetAgedDebtorsResponse` + +```python +value: models.GetAgedDebtorsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingattachmentsallresponse.md b/docs/models/accountingattachmentsallresponse.md index 557a01ab..a1fcd0ed 100644 --- a/docs/models/accountingattachmentsallresponse.md +++ b/docs/models/accountingattachmentsallresponse.md @@ -1,17 +1,8 @@ # AccountingAttachmentsAllResponse -## Supported Types - -### `models.GetAttachmentsResponse` - -```python -value: models.GetAttachmentsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingAttachmentsAllResponseResult](../models/accountingattachmentsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingattachmentsallresponseresult.md b/docs/models/accountingattachmentsallresponseresult.md new file mode 100644 index 00000000..218fed77 --- /dev/null +++ b/docs/models/accountingattachmentsallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingAttachmentsAllResponseResult + + +## Supported Types + +### `models.GetAttachmentsResponse` + +```python +value: models.GetAttachmentsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingbillpaymentsallresponse.md b/docs/models/accountingbillpaymentsallresponse.md index 51f2c203..7530c647 100644 --- a/docs/models/accountingbillpaymentsallresponse.md +++ b/docs/models/accountingbillpaymentsallresponse.md @@ -1,17 +1,8 @@ # AccountingBillPaymentsAllResponse -## Supported Types - -### `models.GetBillPaymentsResponse` - -```python -value: models.GetBillPaymentsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [models.AccountingBillPaymentsAllResponseResult](../models/accountingbillpaymentsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingbillpaymentsallresponseresult.md b/docs/models/accountingbillpaymentsallresponseresult.md new file mode 100644 index 00000000..1748663a --- /dev/null +++ b/docs/models/accountingbillpaymentsallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingBillPaymentsAllResponseResult + + +## Supported Types + +### `models.GetBillPaymentsResponse` + +```python +value: models.GetBillPaymentsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingbillsallresponse.md b/docs/models/accountingbillsallresponse.md index f1ae11a2..6fcfe650 100644 --- a/docs/models/accountingbillsallresponse.md +++ b/docs/models/accountingbillsallresponse.md @@ -1,17 +1,8 @@ # AccountingBillsAllResponse -## Supported Types - -### `models.GetBillsResponse` - -```python -value: models.GetBillsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `result` | [models.AccountingBillsAllResponseResult](../models/accountingbillsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingbillsallresponseresult.md b/docs/models/accountingbillsallresponseresult.md new file mode 100644 index 00000000..90378232 --- /dev/null +++ b/docs/models/accountingbillsallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingBillsAllResponseResult + + +## Supported Types + +### `models.GetBillsResponse` + +```python +value: models.GetBillsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingcreditnotesallresponse.md b/docs/models/accountingcreditnotesallresponse.md index 47dce138..2b72e116 100644 --- a/docs/models/accountingcreditnotesallresponse.md +++ b/docs/models/accountingcreditnotesallresponse.md @@ -1,17 +1,8 @@ # AccountingCreditNotesAllResponse -## Supported Types - -### `models.GetCreditNotesResponse` - -```python -value: models.GetCreditNotesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingCreditNotesAllResponseResult](../models/accountingcreditnotesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingcreditnotesallresponseresult.md b/docs/models/accountingcreditnotesallresponseresult.md new file mode 100644 index 00000000..e3ca80cd --- /dev/null +++ b/docs/models/accountingcreditnotesallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingCreditNotesAllResponseResult + + +## Supported Types + +### `models.GetCreditNotesResponse` + +```python +value: models.GetCreditNotesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingcustomersallresponse.md b/docs/models/accountingcustomersallresponse.md index fe6f2466..c9ec73c4 100644 --- a/docs/models/accountingcustomersallresponse.md +++ b/docs/models/accountingcustomersallresponse.md @@ -1,17 +1,8 @@ # AccountingCustomersAllResponse -## Supported Types - -### `models.GetCustomersResponse` - -```python -value: models.GetCustomersResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `result` | [models.AccountingCustomersAllResponseResult](../models/accountingcustomersallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingcustomersallresponseresult.md b/docs/models/accountingcustomersallresponseresult.md new file mode 100644 index 00000000..a4e0abdd --- /dev/null +++ b/docs/models/accountingcustomersallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingCustomersAllResponseResult + + +## Supported Types + +### `models.GetCustomersResponse` + +```python +value: models.GetCustomersResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingdepartmentsallresponse.md b/docs/models/accountingdepartmentsallresponse.md index 95602f57..967966a8 100644 --- a/docs/models/accountingdepartmentsallresponse.md +++ b/docs/models/accountingdepartmentsallresponse.md @@ -1,17 +1,8 @@ # AccountingDepartmentsAllResponse -## Supported Types - -### `models.GetAccountingDepartmentsResponse` - -```python -value: models.GetAccountingDepartmentsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingDepartmentsAllResponseResult](../models/accountingdepartmentsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingdepartmentsallresponseresult.md b/docs/models/accountingdepartmentsallresponseresult.md new file mode 100644 index 00000000..30c7fe22 --- /dev/null +++ b/docs/models/accountingdepartmentsallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingDepartmentsAllResponseResult + + +## Supported Types + +### `models.GetAccountingDepartmentsResponse` + +```python +value: models.GetAccountingDepartmentsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingexpensesallresponse.md b/docs/models/accountingexpensesallresponse.md index 5b4e32eb..04a092a6 100644 --- a/docs/models/accountingexpensesallresponse.md +++ b/docs/models/accountingexpensesallresponse.md @@ -1,17 +1,8 @@ # AccountingExpensesAllResponse -## Supported Types - -### `models.GetExpensesResponse` - -```python -value: models.GetExpensesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingExpensesAllResponseResult](../models/accountingexpensesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingexpensesallresponseresult.md b/docs/models/accountingexpensesallresponseresult.md new file mode 100644 index 00000000..c92b26e2 --- /dev/null +++ b/docs/models/accountingexpensesallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingExpensesAllResponseResult + + +## Supported Types + +### `models.GetExpensesResponse` + +```python +value: models.GetExpensesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountinginvoiceitemsallresponse.md b/docs/models/accountinginvoiceitemsallresponse.md index c9d5fe2e..2b137db1 100644 --- a/docs/models/accountinginvoiceitemsallresponse.md +++ b/docs/models/accountinginvoiceitemsallresponse.md @@ -1,17 +1,8 @@ # AccountingInvoiceItemsAllResponse -## Supported Types - -### `models.GetInvoiceItemsResponse` - -```python -value: models.GetInvoiceItemsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [models.AccountingInvoiceItemsAllResponseResult](../models/accountinginvoiceitemsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountinginvoiceitemsallresponseresult.md b/docs/models/accountinginvoiceitemsallresponseresult.md new file mode 100644 index 00000000..80b109fe --- /dev/null +++ b/docs/models/accountinginvoiceitemsallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingInvoiceItemsAllResponseResult + + +## Supported Types + +### `models.GetInvoiceItemsResponse` + +```python +value: models.GetInvoiceItemsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountinginvoicesallresponse.md b/docs/models/accountinginvoicesallresponse.md index 48361ce5..1db36567 100644 --- a/docs/models/accountinginvoicesallresponse.md +++ b/docs/models/accountinginvoicesallresponse.md @@ -1,17 +1,8 @@ # AccountingInvoicesAllResponse -## Supported Types - -### `models.GetInvoicesResponse` - -```python -value: models.GetInvoicesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingInvoicesAllResponseResult](../models/accountinginvoicesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountinginvoicesallresponseresult.md b/docs/models/accountinginvoicesallresponseresult.md new file mode 100644 index 00000000..1e725b98 --- /dev/null +++ b/docs/models/accountinginvoicesallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingInvoicesAllResponseResult + + +## Supported Types + +### `models.GetInvoicesResponse` + +```python +value: models.GetInvoicesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingjournalentriesallresponse.md b/docs/models/accountingjournalentriesallresponse.md index 427eba2c..6205ed97 100644 --- a/docs/models/accountingjournalentriesallresponse.md +++ b/docs/models/accountingjournalentriesallresponse.md @@ -1,17 +1,8 @@ # AccountingJournalEntriesAllResponse -## Supported Types - -### `models.GetJournalEntriesResponse` - -```python -value: models.GetJournalEntriesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingJournalEntriesAllResponseResult](../models/accountingjournalentriesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingjournalentriesallresponseresult.md b/docs/models/accountingjournalentriesallresponseresult.md new file mode 100644 index 00000000..e3327105 --- /dev/null +++ b/docs/models/accountingjournalentriesallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingJournalEntriesAllResponseResult + + +## Supported Types + +### `models.GetJournalEntriesResponse` + +```python +value: models.GetJournalEntriesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingledgeraccountsallresponse.md b/docs/models/accountingledgeraccountsallresponse.md index 57e274f4..684dc1c8 100644 --- a/docs/models/accountingledgeraccountsallresponse.md +++ b/docs/models/accountingledgeraccountsallresponse.md @@ -1,17 +1,8 @@ # AccountingLedgerAccountsAllResponse -## Supported Types - -### `models.GetLedgerAccountsResponse` - -```python -value: models.GetLedgerAccountsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingLedgerAccountsAllResponseResult](../models/accountingledgeraccountsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingledgeraccountsallresponseresult.md b/docs/models/accountingledgeraccountsallresponseresult.md new file mode 100644 index 00000000..79ed47b6 --- /dev/null +++ b/docs/models/accountingledgeraccountsallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingLedgerAccountsAllResponseResult + + +## Supported Types + +### `models.GetLedgerAccountsResponse` + +```python +value: models.GetLedgerAccountsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountinglocationsallresponse.md b/docs/models/accountinglocationsallresponse.md index 3fc2ee6b..53f0c01b 100644 --- a/docs/models/accountinglocationsallresponse.md +++ b/docs/models/accountinglocationsallresponse.md @@ -1,17 +1,8 @@ # AccountingLocationsAllResponse -## Supported Types - -### `models.GetAccountingLocationsResponse` - -```python -value: models.GetAccountingLocationsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `result` | [models.AccountingLocationsAllResponseResult](../models/accountinglocationsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountinglocationsallresponseresult.md b/docs/models/accountinglocationsallresponseresult.md new file mode 100644 index 00000000..7a227878 --- /dev/null +++ b/docs/models/accountinglocationsallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingLocationsAllResponseResult + + +## Supported Types + +### `models.GetAccountingLocationsResponse` + +```python +value: models.GetAccountingLocationsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingpaymentsallresponse.md b/docs/models/accountingpaymentsallresponse.md index a019370d..4f89514d 100644 --- a/docs/models/accountingpaymentsallresponse.md +++ b/docs/models/accountingpaymentsallresponse.md @@ -1,17 +1,8 @@ # AccountingPaymentsAllResponse -## Supported Types - -### `models.GetPaymentsResponse` - -```python -value: models.GetPaymentsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingPaymentsAllResponseResult](../models/accountingpaymentsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingpaymentsallresponseresult.md b/docs/models/accountingpaymentsallresponseresult.md new file mode 100644 index 00000000..ae3d1b48 --- /dev/null +++ b/docs/models/accountingpaymentsallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingPaymentsAllResponseResult + + +## Supported Types + +### `models.GetPaymentsResponse` + +```python +value: models.GetPaymentsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingpurchaseordersallresponse.md b/docs/models/accountingpurchaseordersallresponse.md index 64b6ab35..bf974173 100644 --- a/docs/models/accountingpurchaseordersallresponse.md +++ b/docs/models/accountingpurchaseordersallresponse.md @@ -1,17 +1,8 @@ # AccountingPurchaseOrdersAllResponse -## Supported Types - -### `models.GetPurchaseOrdersResponse` - -```python -value: models.GetPurchaseOrdersResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingPurchaseOrdersAllResponseResult](../models/accountingpurchaseordersallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingpurchaseordersallresponseresult.md b/docs/models/accountingpurchaseordersallresponseresult.md new file mode 100644 index 00000000..f585c998 --- /dev/null +++ b/docs/models/accountingpurchaseordersallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingPurchaseOrdersAllResponseResult + + +## Supported Types + +### `models.GetPurchaseOrdersResponse` + +```python +value: models.GetPurchaseOrdersResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingsubsidiariesallresponse.md b/docs/models/accountingsubsidiariesallresponse.md index f188b118..ee218816 100644 --- a/docs/models/accountingsubsidiariesallresponse.md +++ b/docs/models/accountingsubsidiariesallresponse.md @@ -1,17 +1,8 @@ # AccountingSubsidiariesAllResponse -## Supported Types - -### `models.GetSubsidiariesResponse` - -```python -value: models.GetSubsidiariesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [models.AccountingSubsidiariesAllResponseResult](../models/accountingsubsidiariesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingsubsidiariesallresponseresult.md b/docs/models/accountingsubsidiariesallresponseresult.md new file mode 100644 index 00000000..e5e18053 --- /dev/null +++ b/docs/models/accountingsubsidiariesallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingSubsidiariesAllResponseResult + + +## Supported Types + +### `models.GetSubsidiariesResponse` + +```python +value: models.GetSubsidiariesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingsuppliersallresponse.md b/docs/models/accountingsuppliersallresponse.md index a29135fe..80e45ffd 100644 --- a/docs/models/accountingsuppliersallresponse.md +++ b/docs/models/accountingsuppliersallresponse.md @@ -1,17 +1,8 @@ # AccountingSuppliersAllResponse -## Supported Types - -### `models.GetSuppliersResponse` - -```python -value: models.GetSuppliersResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `result` | [models.AccountingSuppliersAllResponseResult](../models/accountingsuppliersallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingsuppliersallresponseresult.md b/docs/models/accountingsuppliersallresponseresult.md new file mode 100644 index 00000000..0dbc6c95 --- /dev/null +++ b/docs/models/accountingsuppliersallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingSuppliersAllResponseResult + + +## Supported Types + +### `models.GetSuppliersResponse` + +```python +value: models.GetSuppliersResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingtaxratesallresponse.md b/docs/models/accountingtaxratesallresponse.md index 7c7b024d..3988cf71 100644 --- a/docs/models/accountingtaxratesallresponse.md +++ b/docs/models/accountingtaxratesallresponse.md @@ -1,17 +1,8 @@ # AccountingTaxRatesAllResponse -## Supported Types - -### `models.GetTaxRatesResponse` - -```python -value: models.GetTaxRatesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [models.AccountingTaxRatesAllResponseResult](../models/accountingtaxratesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingtaxratesallresponseresult.md b/docs/models/accountingtaxratesallresponseresult.md new file mode 100644 index 00000000..5ffc119d --- /dev/null +++ b/docs/models/accountingtaxratesallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingTaxRatesAllResponseResult + + +## Supported Types + +### `models.GetTaxRatesResponse` + +```python +value: models.GetTaxRatesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/accountingtaxratesupdaterequest.md b/docs/models/accountingtaxratesupdaterequest.md index 88a16402..8ce2d33c 100644 --- a/docs/models/accountingtaxratesupdaterequest.md +++ b/docs/models/accountingtaxratesupdaterequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `id_param` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | | `tax_rate` | [models.TaxRateInput](../models/taxrateinput.md) | :heavy_check_mark: | N/A | | | `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 | | `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/accountingtrackingcategoriesallresponse.md b/docs/models/accountingtrackingcategoriesallresponse.md index 51c1d1e0..f308cc40 100644 --- a/docs/models/accountingtrackingcategoriesallresponse.md +++ b/docs/models/accountingtrackingcategoriesallresponse.md @@ -1,17 +1,8 @@ # AccountingTrackingCategoriesAllResponse -## Supported Types - -### `models.GetTrackingCategoriesResponse` - -```python -value: models.GetTrackingCategoriesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `result` | [models.AccountingTrackingCategoriesAllResponseResult](../models/accountingtrackingcategoriesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/accountingtrackingcategoriesallresponseresult.md b/docs/models/accountingtrackingcategoriesallresponseresult.md new file mode 100644 index 00000000..9c4c669d --- /dev/null +++ b/docs/models/accountingtrackingcategoriesallresponseresult.md @@ -0,0 +1,17 @@ +# AccountingTrackingCategoriesAllResponseResult + + +## Supported Types + +### `models.GetTrackingCategoriesResponse` + +```python +value: models.GetTrackingCategoriesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/agedcreditors.md b/docs/models/agedcreditors.md new file mode 100644 index 00000000..7efa6774 --- /dev/null +++ b/docs/models/agedcreditors.md @@ -0,0 +1,12 @@ +# AgedCreditors + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `report_generated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The exact date and time the report was generated. | 2024-11-14T12:00:00.000Z | +| `report_as_of_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The cutoff date for transactions included in the report. | 2024-11-13 | +| `period_count` | *Optional[int]* | :heavy_minus_sign: | Number of aging periods shown in the report. | 4 | +| `period_length` | *Optional[int]* | :heavy_minus_sign: | Length of each aging period in days. | 30 | +| `outstanding_balances` | List[[models.OutstandingBalance](../models/outstandingbalance.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/ageddebtors.md b/docs/models/ageddebtors.md new file mode 100644 index 00000000..839212e7 --- /dev/null +++ b/docs/models/ageddebtors.md @@ -0,0 +1,12 @@ +# AgedDebtors + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `report_generated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The exact date and time the report was generated. | 2024-11-14T12:00:00.000Z | +| `report_as_of_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The cutoff date for transactions included in the report. | 2024-11-13 | +| `period_count` | *Optional[int]* | :heavy_minus_sign: | Number of aging periods shown in the report. | 4 | +| `period_length` | *Optional[int]* | :heavy_minus_sign: | Length of each aging period in days. | 30 | +| `outstanding_balances` | List[[models.OutstandingBalance](../models/outstandingbalance.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/agedreportfilter.md b/docs/models/agedreportfilter.md new file mode 100644 index 00000000..dac27542 --- /dev/null +++ b/docs/models/agedreportfilter.md @@ -0,0 +1,11 @@ +# AgedReportFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `customer_id` | *Optional[str]* | :heavy_minus_sign: | Filter by customer id | 123abc | +| `report_as_of_date` | *Optional[str]* | :heavy_minus_sign: | The cutoff date for considering transactions | 2024-01-01 | +| `period_count` | *Optional[int]* | :heavy_minus_sign: | Number of periods to split the aged creditors report into | 3 | +| `period_length` | *Optional[int]* | :heavy_minus_sign: | Length of each period in days | 30 | \ No newline at end of file diff --git a/docs/models/atsapplicantsallresponse.md b/docs/models/atsapplicantsallresponse.md index bad0b647..05d49d12 100644 --- a/docs/models/atsapplicantsallresponse.md +++ b/docs/models/atsapplicantsallresponse.md @@ -1,17 +1,8 @@ # AtsApplicantsAllResponse -## Supported Types - -### `models.GetApplicantsResponse` - -```python -value: models.GetApplicantsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `result` | [models.AtsApplicantsAllResponseResult](../models/atsapplicantsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/atsapplicantsallresponseresult.md b/docs/models/atsapplicantsallresponseresult.md new file mode 100644 index 00000000..39f1980a --- /dev/null +++ b/docs/models/atsapplicantsallresponseresult.md @@ -0,0 +1,17 @@ +# AtsApplicantsAllResponseResult + + +## Supported Types + +### `models.GetApplicantsResponse` + +```python +value: models.GetApplicantsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/atsapplicationsallresponse.md b/docs/models/atsapplicationsallresponse.md index 59d4aafa..02ac0972 100644 --- a/docs/models/atsapplicationsallresponse.md +++ b/docs/models/atsapplicationsallresponse.md @@ -1,17 +1,8 @@ # AtsApplicationsAllResponse -## Supported Types - -### `models.GetApplicationsResponse` - -```python -value: models.GetApplicationsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `result` | [models.AtsApplicationsAllResponseResult](../models/atsapplicationsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/atsapplicationsallresponseresult.md b/docs/models/atsapplicationsallresponseresult.md new file mode 100644 index 00000000..41bc2a9f --- /dev/null +++ b/docs/models/atsapplicationsallresponseresult.md @@ -0,0 +1,17 @@ +# AtsApplicationsAllResponseResult + + +## Supported Types + +### `models.GetApplicationsResponse` + +```python +value: models.GetApplicationsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/atsjobsallresponse.md b/docs/models/atsjobsallresponse.md index 4c27f29f..77c2ed14 100644 --- a/docs/models/atsjobsallresponse.md +++ b/docs/models/atsjobsallresponse.md @@ -1,17 +1,8 @@ # AtsJobsAllResponse -## Supported Types - -### `models.GetJobsResponse` - -```python -value: models.GetJobsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `result` | [models.AtsJobsAllResponseResult](../models/atsjobsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/atsjobsallresponseresult.md b/docs/models/atsjobsallresponseresult.md new file mode 100644 index 00000000..a372e21d --- /dev/null +++ b/docs/models/atsjobsallresponseresult.md @@ -0,0 +1,17 @@ +# AtsJobsAllResponseResult + + +## Supported Types + +### `models.GetJobsResponse` + +```python +value: models.GetJobsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/balancebyperiod.md b/docs/models/balancebyperiod.md new file mode 100644 index 00000000..802d96e7 --- /dev/null +++ b/docs/models/balancebyperiod.md @@ -0,0 +1,11 @@ +# BalanceByPeriod + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `start_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Start date of the period. | 2024-01-01 | +| `end_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | End date of the period. | 2024-01-30 | +| `total_amount` | *Optional[float]* | :heavy_minus_sign: | Total amount of the period. | 1500 | +| `balances_by_transaction` | List[[models.BalanceByTransaction](../models/balancebytransaction.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/balancebytransaction.md b/docs/models/balancebytransaction.md new file mode 100644 index 00000000..c10df041 --- /dev/null +++ b/docs/models/balancebytransaction.md @@ -0,0 +1,13 @@ +# BalanceByTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `transaction_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the transaction. | INV-1001 | +| `transaction_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Date of the transaction. | 2024-01-15 | +| `transaction_type` | [Optional[models.TransactionType]](../models/transactiontype.md) | :heavy_minus_sign: | Type of the transaction. | invoice | +| `due_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Due date of the transaction. | 2024-02-15 | +| `original_amount` | *Optional[float]* | :heavy_minus_sign: | Original amount of the transaction. | 1000 | +| `outstanding_balance` | *Optional[float]* | :heavy_minus_sign: | Outstanding balance of the transaction. | 800 | \ No newline at end of file diff --git a/docs/models/connectorapisallresponse.md b/docs/models/connectorapisallresponse.md index 0a6a51c4..b10e14e9 100644 --- a/docs/models/connectorapisallresponse.md +++ b/docs/models/connectorapisallresponse.md @@ -1,17 +1,8 @@ # ConnectorApisAllResponse -## Supported Types - -### `models.GetApisResponse` - -```python -value: models.GetApisResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `result` | [models.ConnectorApisAllResponseResult](../models/connectorapisallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorapisallresponseresult.md b/docs/models/connectorapisallresponseresult.md new file mode 100644 index 00000000..53ca1b50 --- /dev/null +++ b/docs/models/connectorapisallresponseresult.md @@ -0,0 +1,17 @@ +# ConnectorApisAllResponseResult + + +## Supported Types + +### `models.GetApisResponse` + +```python +value: models.GetApisResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/connectorconnectorsallresponse.md b/docs/models/connectorconnectorsallresponse.md index 99a1e4c4..236b1c78 100644 --- a/docs/models/connectorconnectorsallresponse.md +++ b/docs/models/connectorconnectorsallresponse.md @@ -1,17 +1,8 @@ # ConnectorConnectorsAllResponse -## Supported Types - -### `models.GetConnectorsResponse` - -```python -value: models.GetConnectorsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `result` | [models.ConnectorConnectorsAllResponseResult](../models/connectorconnectorsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/connectorconnectorsallresponseresult.md b/docs/models/connectorconnectorsallresponseresult.md new file mode 100644 index 00000000..bfb0a936 --- /dev/null +++ b/docs/models/connectorconnectorsallresponseresult.md @@ -0,0 +1,17 @@ +# ConnectorConnectorsAllResponseResult + + +## Supported Types + +### `models.GetConnectorsResponse` + +```python +value: models.GetConnectorsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/crmactivitiesallresponse.md b/docs/models/crmactivitiesallresponse.md index 681b1e74..cfcee817 100644 --- a/docs/models/crmactivitiesallresponse.md +++ b/docs/models/crmactivitiesallresponse.md @@ -1,17 +1,8 @@ # CrmActivitiesAllResponse -## Supported Types - -### `models.GetActivitiesResponse` - -```python -value: models.GetActivitiesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `result` | [models.CrmActivitiesAllResponseResult](../models/crmactivitiesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/crmactivitiesallresponseresult.md b/docs/models/crmactivitiesallresponseresult.md new file mode 100644 index 00000000..1649730b --- /dev/null +++ b/docs/models/crmactivitiesallresponseresult.md @@ -0,0 +1,17 @@ +# CrmActivitiesAllResponseResult + + +## Supported Types + +### `models.GetActivitiesResponse` + +```python +value: models.GetActivitiesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/crmcompaniesallresponse.md b/docs/models/crmcompaniesallresponse.md index e9a07aee..8c1a0be5 100644 --- a/docs/models/crmcompaniesallresponse.md +++ b/docs/models/crmcompaniesallresponse.md @@ -1,17 +1,8 @@ # CrmCompaniesAllResponse -## Supported Types - -### `models.GetCompaniesResponse` - -```python -value: models.GetCompaniesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `result` | [models.CrmCompaniesAllResponseResult](../models/crmcompaniesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/crmcompaniesallresponseresult.md b/docs/models/crmcompaniesallresponseresult.md new file mode 100644 index 00000000..10c1a175 --- /dev/null +++ b/docs/models/crmcompaniesallresponseresult.md @@ -0,0 +1,17 @@ +# CrmCompaniesAllResponseResult + + +## Supported Types + +### `models.GetCompaniesResponse` + +```python +value: models.GetCompaniesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/crmcontactsallresponse.md b/docs/models/crmcontactsallresponse.md index b401d056..4015a392 100644 --- a/docs/models/crmcontactsallresponse.md +++ b/docs/models/crmcontactsallresponse.md @@ -1,17 +1,8 @@ # CrmContactsAllResponse -## Supported Types - -### `models.GetContactsResponse` - -```python -value: models.GetContactsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `result` | [models.CrmContactsAllResponseResult](../models/crmcontactsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/crmcontactsallresponseresult.md b/docs/models/crmcontactsallresponseresult.md new file mode 100644 index 00000000..8388bab1 --- /dev/null +++ b/docs/models/crmcontactsallresponseresult.md @@ -0,0 +1,17 @@ +# CrmContactsAllResponseResult + + +## Supported Types + +### `models.GetContactsResponse` + +```python +value: models.GetContactsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/crmleadsallresponse.md b/docs/models/crmleadsallresponse.md index fea2e9a2..2edb7025 100644 --- a/docs/models/crmleadsallresponse.md +++ b/docs/models/crmleadsallresponse.md @@ -1,17 +1,8 @@ # CrmLeadsAllResponse -## Supported Types - -### `models.GetLeadsResponse` - -```python -value: models.GetLeadsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `result` | [models.CrmLeadsAllResponseResult](../models/crmleadsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/crmleadsallresponseresult.md b/docs/models/crmleadsallresponseresult.md new file mode 100644 index 00000000..7cce29ba --- /dev/null +++ b/docs/models/crmleadsallresponseresult.md @@ -0,0 +1,17 @@ +# CrmLeadsAllResponseResult + + +## Supported Types + +### `models.GetLeadsResponse` + +```python +value: models.GetLeadsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/crmnotesallresponse.md b/docs/models/crmnotesallresponse.md index 9bcf0250..bff74576 100644 --- a/docs/models/crmnotesallresponse.md +++ b/docs/models/crmnotesallresponse.md @@ -1,17 +1,8 @@ # CrmNotesAllResponse -## Supported Types - -### `models.GetNotesResponse` - -```python -value: models.GetNotesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `result` | [models.CrmNotesAllResponseResult](../models/crmnotesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/crmnotesallresponseresult.md b/docs/models/crmnotesallresponseresult.md new file mode 100644 index 00000000..b9a4d50d --- /dev/null +++ b/docs/models/crmnotesallresponseresult.md @@ -0,0 +1,17 @@ +# CrmNotesAllResponseResult + + +## Supported Types + +### `models.GetNotesResponse` + +```python +value: models.GetNotesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/crmopportunitiesallresponse.md b/docs/models/crmopportunitiesallresponse.md index 8a5bd699..cacb3b9d 100644 --- a/docs/models/crmopportunitiesallresponse.md +++ b/docs/models/crmopportunitiesallresponse.md @@ -1,17 +1,8 @@ # CrmOpportunitiesAllResponse -## Supported Types - -### `models.GetOpportunitiesResponse` - -```python -value: models.GetOpportunitiesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `result` | [models.CrmOpportunitiesAllResponseResult](../models/crmopportunitiesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/crmopportunitiesallresponseresult.md b/docs/models/crmopportunitiesallresponseresult.md new file mode 100644 index 00000000..455f6dc2 --- /dev/null +++ b/docs/models/crmopportunitiesallresponseresult.md @@ -0,0 +1,17 @@ +# CrmOpportunitiesAllResponseResult + + +## Supported Types + +### `models.GetOpportunitiesResponse` + +```python +value: models.GetOpportunitiesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/crmpipelinesallresponse.md b/docs/models/crmpipelinesallresponse.md index 083b1523..39cdeb66 100644 --- a/docs/models/crmpipelinesallresponse.md +++ b/docs/models/crmpipelinesallresponse.md @@ -1,17 +1,8 @@ # CrmPipelinesAllResponse -## Supported Types - -### `models.GetPipelinesResponse` - -```python -value: models.GetPipelinesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `result` | [models.CrmPipelinesAllResponseResult](../models/crmpipelinesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/crmpipelinesallresponseresult.md b/docs/models/crmpipelinesallresponseresult.md new file mode 100644 index 00000000..54f4d5bb --- /dev/null +++ b/docs/models/crmpipelinesallresponseresult.md @@ -0,0 +1,17 @@ +# CrmPipelinesAllResponseResult + + +## Supported Types + +### `models.GetPipelinesResponse` + +```python +value: models.GetPipelinesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/crmpipelinesupdaterequest.md b/docs/models/crmpipelinesupdaterequest.md index 26299b10..966a278e 100644 --- a/docs/models/crmpipelinesupdaterequest.md +++ b/docs/models/crmpipelinesupdaterequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `id_param` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | | `pipeline` | [models.PipelineInput](../models/pipelineinput.md) | :heavy_check_mark: | N/A | | | `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 | | `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/crmusersallresponse.md b/docs/models/crmusersallresponse.md index b7824bfb..47191e1f 100644 --- a/docs/models/crmusersallresponse.md +++ b/docs/models/crmusersallresponse.md @@ -1,17 +1,8 @@ # CrmUsersAllResponse -## Supported Types - -### `models.GetUsersResponse` - -```python -value: models.GetUsersResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `result` | [models.CrmUsersAllResponseResult](../models/crmusersallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/crmusersallresponseresult.md b/docs/models/crmusersallresponseresult.md new file mode 100644 index 00000000..38b8e219 --- /dev/null +++ b/docs/models/crmusersallresponseresult.md @@ -0,0 +1,17 @@ +# CrmUsersAllResponseResult + + +## Supported Types + +### `models.GetUsersResponse` + +```python +value: models.GetUsersResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/ecommercecustomersallresponse.md b/docs/models/ecommercecustomersallresponse.md index 114fb32f..4eb8b487 100644 --- a/docs/models/ecommercecustomersallresponse.md +++ b/docs/models/ecommercecustomersallresponse.md @@ -1,17 +1,8 @@ # EcommerceCustomersAllResponse -## Supported Types - -### `models.GetEcommerceCustomersResponse` - -```python -value: models.GetEcommerceCustomersResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `result` | [models.EcommerceCustomersAllResponseResult](../models/ecommercecustomersallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/ecommercecustomersallresponseresult.md b/docs/models/ecommercecustomersallresponseresult.md new file mode 100644 index 00000000..2b05c236 --- /dev/null +++ b/docs/models/ecommercecustomersallresponseresult.md @@ -0,0 +1,17 @@ +# EcommerceCustomersAllResponseResult + + +## Supported Types + +### `models.GetEcommerceCustomersResponse` + +```python +value: models.GetEcommerceCustomersResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/ecommerceordersallresponse.md b/docs/models/ecommerceordersallresponse.md index 182762c0..19293dbb 100644 --- a/docs/models/ecommerceordersallresponse.md +++ b/docs/models/ecommerceordersallresponse.md @@ -1,17 +1,8 @@ # EcommerceOrdersAllResponse -## Supported Types - -### `models.GetEcommerceOrdersResponse` - -```python -value: models.GetEcommerceOrdersResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `result` | [models.EcommerceOrdersAllResponseResult](../models/ecommerceordersallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/ecommerceordersallresponseresult.md b/docs/models/ecommerceordersallresponseresult.md new file mode 100644 index 00000000..007edc5a --- /dev/null +++ b/docs/models/ecommerceordersallresponseresult.md @@ -0,0 +1,17 @@ +# EcommerceOrdersAllResponseResult + + +## Supported Types + +### `models.GetEcommerceOrdersResponse` + +```python +value: models.GetEcommerceOrdersResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/ecommerceproductsallresponse.md b/docs/models/ecommerceproductsallresponse.md index 20af03bd..dddfa848 100644 --- a/docs/models/ecommerceproductsallresponse.md +++ b/docs/models/ecommerceproductsallresponse.md @@ -1,17 +1,8 @@ # EcommerceProductsAllResponse -## Supported Types - -### `models.GetProductsResponse` - -```python -value: models.GetProductsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `result` | [models.EcommerceProductsAllResponseResult](../models/ecommerceproductsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/ecommerceproductsallresponseresult.md b/docs/models/ecommerceproductsallresponseresult.md new file mode 100644 index 00000000..75ee04b4 --- /dev/null +++ b/docs/models/ecommerceproductsallresponseresult.md @@ -0,0 +1,17 @@ +# EcommerceProductsAllResponseResult + + +## Supported Types + +### `models.GetProductsResponse` + +```python +value: models.GetProductsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/filestoragedrivegroupsallresponse.md b/docs/models/filestoragedrivegroupsallresponse.md index 1d4949b2..4079295c 100644 --- a/docs/models/filestoragedrivegroupsallresponse.md +++ b/docs/models/filestoragedrivegroupsallresponse.md @@ -1,17 +1,8 @@ # FileStorageDriveGroupsAllResponse -## Supported Types - -### `models.GetDriveGroupsResponse` - -```python -value: models.GetDriveGroupsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [models.FileStorageDriveGroupsAllResponseResult](../models/filestoragedrivegroupsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filestoragedrivegroupsallresponseresult.md b/docs/models/filestoragedrivegroupsallresponseresult.md new file mode 100644 index 00000000..709b6636 --- /dev/null +++ b/docs/models/filestoragedrivegroupsallresponseresult.md @@ -0,0 +1,17 @@ +# FileStorageDriveGroupsAllResponseResult + + +## Supported Types + +### `models.GetDriveGroupsResponse` + +```python +value: models.GetDriveGroupsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/filestoragedrivesallresponse.md b/docs/models/filestoragedrivesallresponse.md index 04620299..af0b3af7 100644 --- a/docs/models/filestoragedrivesallresponse.md +++ b/docs/models/filestoragedrivesallresponse.md @@ -1,17 +1,8 @@ # FileStorageDrivesAllResponse -## Supported Types - -### `models.GetDrivesResponse` - -```python -value: models.GetDrivesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `result` | [models.FileStorageDrivesAllResponseResult](../models/filestoragedrivesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filestoragedrivesallresponseresult.md b/docs/models/filestoragedrivesallresponseresult.md new file mode 100644 index 00000000..fa2d3fab --- /dev/null +++ b/docs/models/filestoragedrivesallresponseresult.md @@ -0,0 +1,17 @@ +# FileStorageDrivesAllResponseResult + + +## Supported Types + +### `models.GetDrivesResponse` + +```python +value: models.GetDrivesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/filestoragefilesallresponse.md b/docs/models/filestoragefilesallresponse.md index b03d6ebf..26465fce 100644 --- a/docs/models/filestoragefilesallresponse.md +++ b/docs/models/filestoragefilesallresponse.md @@ -1,17 +1,8 @@ # FileStorageFilesAllResponse -## Supported Types - -### `models.GetFilesResponse` - -```python -value: models.GetFilesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `result` | [models.FileStorageFilesAllResponseResult](../models/filestoragefilesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filestoragefilesallresponseresult.md b/docs/models/filestoragefilesallresponseresult.md new file mode 100644 index 00000000..ce7a93b7 --- /dev/null +++ b/docs/models/filestoragefilesallresponseresult.md @@ -0,0 +1,17 @@ +# FileStorageFilesAllResponseResult + + +## Supported Types + +### `models.GetFilesResponse` + +```python +value: models.GetFilesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/filestoragefilessearchrequest.md b/docs/models/filestoragefilessearchrequest.md index d696eab4..b757c812 100644 --- a/docs/models/filestoragefilessearchrequest.md +++ b/docs/models/filestoragefilessearchrequest.md @@ -7,7 +7,7 @@ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `files_search` | [models.FilesSearch](../models/filessearch.md) | :heavy_check_mark: | N/A | {
"query": "logo jpg"
} | | `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 | -| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `pass_through_param` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | | `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | | `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | | `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | diff --git a/docs/models/filestoragesharedlinksallresponse.md b/docs/models/filestoragesharedlinksallresponse.md index 4eddfd68..36654439 100644 --- a/docs/models/filestoragesharedlinksallresponse.md +++ b/docs/models/filestoragesharedlinksallresponse.md @@ -1,17 +1,8 @@ # FileStorageSharedLinksAllResponse -## Supported Types - -### `models.GetSharedLinksResponse` - -```python -value: models.GetSharedLinksResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `result` | [models.FileStorageSharedLinksAllResponseResult](../models/filestoragesharedlinksallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/filestoragesharedlinksallresponseresult.md b/docs/models/filestoragesharedlinksallresponseresult.md new file mode 100644 index 00000000..a0b4d883 --- /dev/null +++ b/docs/models/filestoragesharedlinksallresponseresult.md @@ -0,0 +1,17 @@ +# FileStorageSharedLinksAllResponseResult + + +## Supported Types + +### `models.GetSharedLinksResponse` + +```python +value: models.GetSharedLinksResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/getagedcreditorsresponse.md b/docs/models/getagedcreditorsresponse.md new file mode 100644 index 00000000..eaa911b4 --- /dev/null +++ b/docs/models/getagedcreditorsresponse.md @@ -0,0 +1,15 @@ +# GetAgedCreditorsResponse + +Aged Creditors + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `status_code` | *int* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *str* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *str* | :heavy_check_mark: | Apideck ID of service provider | quickbooks | +| `resource` | *str* | :heavy_check_mark: | Unified API resource name | AgedCreditors | +| `operation` | *str* | :heavy_check_mark: | Operation performed | one | +| `data` | [models.AgedCreditors](../models/agedcreditors.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/getageddebtorsresponse.md b/docs/models/getageddebtorsresponse.md new file mode 100644 index 00000000..190937cd --- /dev/null +++ b/docs/models/getageddebtorsresponse.md @@ -0,0 +1,15 @@ +# GetAgedDebtorsResponse + +Aged Debtors + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `status_code` | *int* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *str* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *str* | :heavy_check_mark: | Apideck ID of service provider | quickbooks | +| `resource` | *str* | :heavy_check_mark: | Unified API resource name | AgedDebtors | +| `operation` | *str* | :heavy_check_mark: | Operation performed | one | +| `data` | [models.AgedDebtors](../models/ageddebtors.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/hriscompaniesallresponse.md b/docs/models/hriscompaniesallresponse.md index 4f4c1f48..17a19820 100644 --- a/docs/models/hriscompaniesallresponse.md +++ b/docs/models/hriscompaniesallresponse.md @@ -1,17 +1,8 @@ # HrisCompaniesAllResponse -## Supported Types - -### `models.GetHrisCompaniesResponse` - -```python -value: models.GetHrisCompaniesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `result` | [models.HrisCompaniesAllResponseResult](../models/hriscompaniesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/hriscompaniesallresponseresult.md b/docs/models/hriscompaniesallresponseresult.md new file mode 100644 index 00000000..3d6a8a7f --- /dev/null +++ b/docs/models/hriscompaniesallresponseresult.md @@ -0,0 +1,17 @@ +# HrisCompaniesAllResponseResult + + +## Supported Types + +### `models.GetHrisCompaniesResponse` + +```python +value: models.GetHrisCompaniesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/hrisdepartmentsallresponse.md b/docs/models/hrisdepartmentsallresponse.md index 3f44e84d..9d622833 100644 --- a/docs/models/hrisdepartmentsallresponse.md +++ b/docs/models/hrisdepartmentsallresponse.md @@ -1,17 +1,8 @@ # HrisDepartmentsAllResponse -## Supported Types - -### `models.GetDepartmentsResponse` - -```python -value: models.GetDepartmentsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `result` | [models.HrisDepartmentsAllResponseResult](../models/hrisdepartmentsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/hrisdepartmentsallresponseresult.md b/docs/models/hrisdepartmentsallresponseresult.md new file mode 100644 index 00000000..1736ea43 --- /dev/null +++ b/docs/models/hrisdepartmentsallresponseresult.md @@ -0,0 +1,17 @@ +# HrisDepartmentsAllResponseResult + + +## Supported Types + +### `models.GetDepartmentsResponse` + +```python +value: models.GetDepartmentsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/hrisemployeesallresponse.md b/docs/models/hrisemployeesallresponse.md index cd47b5ca..31c5040e 100644 --- a/docs/models/hrisemployeesallresponse.md +++ b/docs/models/hrisemployeesallresponse.md @@ -1,17 +1,8 @@ # HrisEmployeesAllResponse -## Supported Types - -### `models.GetEmployeesResponse` - -```python -value: models.GetEmployeesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `result` | [models.HrisEmployeesAllResponseResult](../models/hrisemployeesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/hrisemployeesallresponseresult.md b/docs/models/hrisemployeesallresponseresult.md new file mode 100644 index 00000000..6e685b8b --- /dev/null +++ b/docs/models/hrisemployeesallresponseresult.md @@ -0,0 +1,17 @@ +# HrisEmployeesAllResponseResult + + +## Supported Types + +### `models.GetEmployeesResponse` + +```python +value: models.GetEmployeesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/hrisemployeesupdaterequest.md b/docs/models/hrisemployeesupdaterequest.md index 5f739f4f..9c41c58f 100644 --- a/docs/models/hrisemployeesupdaterequest.md +++ b/docs/models/hrisemployeesupdaterequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `id_param` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | | `employee` | [models.EmployeeInput](../models/employeeinput.md) | :heavy_check_mark: | N/A | | | `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 | | `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/hristimeoffrequestsallresponse.md b/docs/models/hristimeoffrequestsallresponse.md index 5c922e4f..3b009949 100644 --- a/docs/models/hristimeoffrequestsallresponse.md +++ b/docs/models/hristimeoffrequestsallresponse.md @@ -1,17 +1,8 @@ # HrisTimeOffRequestsAllResponse -## Supported Types - -### `models.GetTimeOffRequestsResponse` - -```python -value: models.GetTimeOffRequestsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `result` | [models.HrisTimeOffRequestsAllResponseResult](../models/hristimeoffrequestsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/hristimeoffrequestsallresponseresult.md b/docs/models/hristimeoffrequestsallresponseresult.md new file mode 100644 index 00000000..cf916aac --- /dev/null +++ b/docs/models/hristimeoffrequestsallresponseresult.md @@ -0,0 +1,17 @@ +# HrisTimeOffRequestsAllResponseResult + + +## Supported Types + +### `models.GetTimeOffRequestsResponse` + +```python +value: models.GetTimeOffRequestsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/hristimeoffrequestsupdaterequest.md b/docs/models/hristimeoffrequestsupdaterequest.md index ab1e15df..db0d0a7a 100644 --- a/docs/models/hristimeoffrequestsupdaterequest.md +++ b/docs/models/hristimeoffrequestsupdaterequest.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `employee_id` | *str* | :heavy_check_mark: | ID of the employee you are acting upon. | | +| `employee_id_param` | *str* | :heavy_check_mark: | ID of the employee you are acting upon. | | | `time_off_request` | [models.TimeOffRequestInput](../models/timeoffrequestinput.md) | :heavy_check_mark: | N/A | | | `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 | | `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/issuetrackingcollectionsallresponse.md b/docs/models/issuetrackingcollectionsallresponse.md index e49a901a..1533e801 100644 --- a/docs/models/issuetrackingcollectionsallresponse.md +++ b/docs/models/issuetrackingcollectionsallresponse.md @@ -1,17 +1,8 @@ # IssueTrackingCollectionsAllResponse -## Supported Types - -### `models.GetCollectionsResponse` - -```python -value: models.GetCollectionsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `result` | [models.IssueTrackingCollectionsAllResponseResult](../models/issuetrackingcollectionsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/issuetrackingcollectionsallresponseresult.md b/docs/models/issuetrackingcollectionsallresponseresult.md new file mode 100644 index 00000000..308e17b3 --- /dev/null +++ b/docs/models/issuetrackingcollectionsallresponseresult.md @@ -0,0 +1,17 @@ +# IssueTrackingCollectionsAllResponseResult + + +## Supported Types + +### `models.GetCollectionsResponse` + +```python +value: models.GetCollectionsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/issuetrackingcollectiontagsallresponse.md b/docs/models/issuetrackingcollectiontagsallresponse.md index 71c01e8e..954b28f7 100644 --- a/docs/models/issuetrackingcollectiontagsallresponse.md +++ b/docs/models/issuetrackingcollectiontagsallresponse.md @@ -1,17 +1,8 @@ # IssueTrackingCollectionTagsAllResponse -## Supported Types - -### `models.GetCollectionTagsResponse` - -```python -value: models.GetCollectionTagsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `result` | [models.IssueTrackingCollectionTagsAllResponseResult](../models/issuetrackingcollectiontagsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/issuetrackingcollectiontagsallresponseresult.md b/docs/models/issuetrackingcollectiontagsallresponseresult.md new file mode 100644 index 00000000..caa1be61 --- /dev/null +++ b/docs/models/issuetrackingcollectiontagsallresponseresult.md @@ -0,0 +1,17 @@ +# IssueTrackingCollectionTagsAllResponseResult + + +## Supported Types + +### `models.GetCollectionTagsResponse` + +```python +value: models.GetCollectionTagsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/issuetrackingcollectionticketcommentsallresponse.md b/docs/models/issuetrackingcollectionticketcommentsallresponse.md index 5fda726c..7e0bc539 100644 --- a/docs/models/issuetrackingcollectionticketcommentsallresponse.md +++ b/docs/models/issuetrackingcollectionticketcommentsallresponse.md @@ -1,17 +1,8 @@ # IssueTrackingCollectionTicketCommentsAllResponse -## Supported Types - -### `models.GetCommentsResponse` - -```python -value: models.GetCommentsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `result` | [models.IssueTrackingCollectionTicketCommentsAllResponseResult](../models/issuetrackingcollectionticketcommentsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/issuetrackingcollectionticketcommentsallresponseresult.md b/docs/models/issuetrackingcollectionticketcommentsallresponseresult.md new file mode 100644 index 00000000..7b898bf6 --- /dev/null +++ b/docs/models/issuetrackingcollectionticketcommentsallresponseresult.md @@ -0,0 +1,17 @@ +# IssueTrackingCollectionTicketCommentsAllResponseResult + + +## Supported Types + +### `models.GetCommentsResponse` + +```python +value: models.GetCommentsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/issuetrackingcollectionticketcommentsoneresponse.md b/docs/models/issuetrackingcollectionticketcommentsoneresponse.md index 724ae305..14c16b85 100644 --- a/docs/models/issuetrackingcollectionticketcommentsoneresponse.md +++ b/docs/models/issuetrackingcollectionticketcommentsoneresponse.md @@ -1,17 +1,8 @@ # IssueTrackingCollectionTicketCommentsOneResponse -## Supported Types - -### `models.GetCommentResponse` - -```python -value: models.GetCommentResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `result` | [models.IssueTrackingCollectionTicketCommentsOneResponseResult](../models/issuetrackingcollectionticketcommentsoneresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/issuetrackingcollectionticketcommentsoneresponseresult.md b/docs/models/issuetrackingcollectionticketcommentsoneresponseresult.md new file mode 100644 index 00000000..70e96a5e --- /dev/null +++ b/docs/models/issuetrackingcollectionticketcommentsoneresponseresult.md @@ -0,0 +1,17 @@ +# IssueTrackingCollectionTicketCommentsOneResponseResult + + +## Supported Types + +### `models.GetCommentResponse` + +```python +value: models.GetCommentResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/issuetrackingcollectionticketsallresponse.md b/docs/models/issuetrackingcollectionticketsallresponse.md index c02bdb6f..d47ecdda 100644 --- a/docs/models/issuetrackingcollectionticketsallresponse.md +++ b/docs/models/issuetrackingcollectionticketsallresponse.md @@ -1,17 +1,8 @@ # IssueTrackingCollectionTicketsAllResponse -## Supported Types - -### `models.GetTicketsResponse` - -```python -value: models.GetTicketsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `result` | [models.IssueTrackingCollectionTicketsAllResponseResult](../models/issuetrackingcollectionticketsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/issuetrackingcollectionticketsallresponseresult.md b/docs/models/issuetrackingcollectionticketsallresponseresult.md new file mode 100644 index 00000000..1814377f --- /dev/null +++ b/docs/models/issuetrackingcollectionticketsallresponseresult.md @@ -0,0 +1,17 @@ +# IssueTrackingCollectionTicketsAllResponseResult + + +## Supported Types + +### `models.GetTicketsResponse` + +```python +value: models.GetTicketsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/issuetrackingcollectionusersallresponse.md b/docs/models/issuetrackingcollectionusersallresponse.md index 1e2557a5..d0cf6473 100644 --- a/docs/models/issuetrackingcollectionusersallresponse.md +++ b/docs/models/issuetrackingcollectionusersallresponse.md @@ -1,17 +1,8 @@ # IssueTrackingCollectionUsersAllResponse -## Supported Types - -### `models.GetCollectionUsersResponse` - -```python -value: models.GetCollectionUsersResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `result` | [models.IssueTrackingCollectionUsersAllResponseResult](../models/issuetrackingcollectionusersallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/issuetrackingcollectionusersallresponseresult.md b/docs/models/issuetrackingcollectionusersallresponseresult.md new file mode 100644 index 00000000..389c2a9c --- /dev/null +++ b/docs/models/issuetrackingcollectionusersallresponseresult.md @@ -0,0 +1,17 @@ +# IssueTrackingCollectionUsersAllResponseResult + + +## Supported Types + +### `models.GetCollectionUsersResponse` + +```python +value: models.GetCollectionUsersResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/outstandingbalance.md b/docs/models/outstandingbalance.md new file mode 100644 index 00000000..728257fb --- /dev/null +++ b/docs/models/outstandingbalance.md @@ -0,0 +1,10 @@ +# OutstandingBalance + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `customer_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the customer or supplier. | 123 | +| `customer_name` | *Optional[str]* | :heavy_minus_sign: | Full name of the customer or supplier. | Super Store | +| `outstanding_balances_by_currency` | List[[models.OutstandingBalanceByCurrency](../models/outstandingbalancebycurrency.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/outstandingbalancebycurrency.md b/docs/models/outstandingbalancebycurrency.md new file mode 100644 index 00000000..874ba9d3 --- /dev/null +++ b/docs/models/outstandingbalancebycurrency.md @@ -0,0 +1,9 @@ +# OutstandingBalanceByCurrency + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `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 | +| `balances_by_period` | List[[models.BalanceByPeriod](../models/balancebyperiod.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/smsmessagesallresponse.md b/docs/models/smsmessagesallresponse.md index a508978d..115129a5 100644 --- a/docs/models/smsmessagesallresponse.md +++ b/docs/models/smsmessagesallresponse.md @@ -1,17 +1,8 @@ # SmsMessagesAllResponse -## Supported Types - -### `models.GetMessagesResponse` - -```python -value: models.GetMessagesResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `result` | [models.SmsMessagesAllResponseResult](../models/smsmessagesallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/smsmessagesallresponseresult.md b/docs/models/smsmessagesallresponseresult.md new file mode 100644 index 00000000..7b019f2e --- /dev/null +++ b/docs/models/smsmessagesallresponseresult.md @@ -0,0 +1,17 @@ +# SmsMessagesAllResponseResult + + +## Supported Types + +### `models.GetMessagesResponse` + +```python +value: models.GetMessagesResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/transactiontype.md b/docs/models/transactiontype.md new file mode 100644 index 00000000..d2869a11 --- /dev/null +++ b/docs/models/transactiontype.md @@ -0,0 +1,14 @@ +# TransactionType + +Type of the transaction. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `INVOICE` | invoice | +| `CREDIT_NOTE` | credit_note | +| `BILL` | bill | +| `PAYMENT` | payment | +| `BILL_PAYMENT` | bill-payment | \ No newline at end of file diff --git a/docs/models/vaultconsumersallresponse.md b/docs/models/vaultconsumersallresponse.md index fe9789a6..1cf14dd5 100644 --- a/docs/models/vaultconsumersallresponse.md +++ b/docs/models/vaultconsumersallresponse.md @@ -1,17 +1,8 @@ # VaultConsumersAllResponse -## Supported Types - -### `models.GetConsumersResponse` - -```python -value: models.GetConsumersResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `result` | [models.VaultConsumersAllResponseResult](../models/vaultconsumersallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/vaultconsumersallresponseresult.md b/docs/models/vaultconsumersallresponseresult.md new file mode 100644 index 00000000..841645ae --- /dev/null +++ b/docs/models/vaultconsumersallresponseresult.md @@ -0,0 +1,17 @@ +# VaultConsumersAllResponseResult + + +## Supported Types + +### `models.GetConsumersResponse` + +```python +value: models.GetConsumersResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/vaultlogsallresponse.md b/docs/models/vaultlogsallresponse.md index 34f8bc7b..13d80995 100644 --- a/docs/models/vaultlogsallresponse.md +++ b/docs/models/vaultlogsallresponse.md @@ -1,17 +1,8 @@ # VaultLogsAllResponse -## Supported Types - -### `models.GetLogsResponse` - -```python -value: models.GetLogsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `result` | [models.VaultLogsAllResponseResult](../models/vaultlogsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/vaultlogsallresponseresult.md b/docs/models/vaultlogsallresponseresult.md new file mode 100644 index 00000000..d6a5136b --- /dev/null +++ b/docs/models/vaultlogsallresponseresult.md @@ -0,0 +1,17 @@ +# VaultLogsAllResponseResult + + +## Supported Types + +### `models.GetLogsResponse` + +```python +value: models.GetLogsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/webhookeventlogsallresponse.md b/docs/models/webhookeventlogsallresponse.md index 212274aa..29f5b298 100644 --- a/docs/models/webhookeventlogsallresponse.md +++ b/docs/models/webhookeventlogsallresponse.md @@ -1,17 +1,8 @@ # WebhookEventLogsAllResponse -## Supported Types - -### `models.GetWebhookEventLogsResponse` - -```python -value: models.GetWebhookEventLogsResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `result` | [models.WebhookEventLogsAllResponseResult](../models/webhookeventlogsallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/webhookeventlogsallresponseresult.md b/docs/models/webhookeventlogsallresponseresult.md new file mode 100644 index 00000000..97682500 --- /dev/null +++ b/docs/models/webhookeventlogsallresponseresult.md @@ -0,0 +1,17 @@ +# WebhookEventLogsAllResponseResult + + +## Supported Types + +### `models.GetWebhookEventLogsResponse` + +```python +value: models.GetWebhookEventLogsResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/models/webhookwebhooksallresponse.md b/docs/models/webhookwebhooksallresponse.md index d3f737a1..f3dcb570 100644 --- a/docs/models/webhookwebhooksallresponse.md +++ b/docs/models/webhookwebhooksallresponse.md @@ -1,17 +1,8 @@ # WebhookWebhooksAllResponse -## Supported Types - -### `models.GetWebhooksResponse` - -```python -value: models.GetWebhooksResponse = /* values here */ -``` - -### `models.UnexpectedErrorResponse` - -```python -value: models.UnexpectedErrorResponse = /* values here */ -``` +## Fields +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `result` | [models.WebhookWebhooksAllResponseResult](../models/webhookwebhooksallresponseresult.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/webhookwebhooksallresponseresult.md b/docs/models/webhookwebhooksallresponseresult.md new file mode 100644 index 00000000..cdb96f7c --- /dev/null +++ b/docs/models/webhookwebhooksallresponseresult.md @@ -0,0 +1,17 @@ +# WebhookWebhooksAllResponseResult + + +## Supported Types + +### `models.GetWebhooksResponse` + +```python +value: models.GetWebhooksResponse = /* values here */ +``` + +### `models.UnexpectedErrorResponse` + +```python +value: models.UnexpectedErrorResponse = /* values here */ +``` + diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index 6fc4f05d..6a13cfbd 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -28,33 +28,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.activities.list(request={ - "service_id": "salesforce", - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.ActivitiesSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.crm.activities.list(service_id="salesforce", filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.ActivitiesSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `request` | [models.CrmActivitiesAllRequest](../../models/crmactivitiesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.ActivitiesFilter]](../../models/activitiesfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.ActivitiesSort]](../../models/activitiessort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -87,124 +90,122 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.activities.create(activity={ - "type": apideck_unify.ActivityType.MEETING, - "activity_datetime": "2021-05-01T12:00:00.000Z", - "duration_seconds": 1800, - "user_id": "12345", - "account_id": "12345", - "contact_id": "12345", - "company_id": "12345", - "opportunity_id": "12345", - "lead_id": "12345", - "owner_id": "12345", - "campaign_id": "12345", - "case_id": "12345", - "asset_id": "12345", - "contract_id": "12345", - "product_id": "12345", - "solution_id": "12345", - "custom_object_id": "12345", - "title": "Meeting", - "description": "More info about the meeting", - "note": "An internal note about the meeting", - "location": "Space", - "location_address": { - "id": "123", - "type": apideck_unify.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", + + res = apideck.crm.activities.create(type_=apideck_unify.ActivityType.MEETING, service_id="salesforce", activity_datetime="2021-05-01T12:00:00.000Z", duration_seconds=1800, user_id="12345", account_id="12345", contact_id="12345", company_id="12345", opportunity_id="12345", lead_id="12345", owner_id="12345", campaign_id="12345", case_id="12345", asset_id="12345", contract_id="12345", product_id="12345", solution_id="12345", custom_object_id="12345", title="Meeting", description="More info about the meeting", note="An internal note about the meeting", location="Space", location_address={ + "id": "123", + "type": apideck_unify.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", + }, all_day_event=False, private=True, group_event=True, event_sub_type="debrief", group_event_type="Proposed", child=False, archived=False, deleted=False, show_as=apideck_unify.ShowAs.BUSY, done=False, start_datetime="2021-05-01T12:00:00.000Z", end_datetime="2021-05-01T12:30:00.000Z", activity_date="2021-05-01", end_date="2021-05-01", recurrent=False, reminder_datetime="2021-05-01T17:00:00.000Z", reminder_set=False, video_conference_url="https://us02web.zoom.us/j/88120759396", video_conference_id="zoom:88120759396", custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + ], attendees=[ + { + "name": "Elon Musk", + "first_name": "Elon", + "middle_name": "D.", + "last_name": "Musk", + "prefix": "Mr.", + "suffix": "PhD", + "email_address": "elon@musk.com", + "is_organizer": True, + "status": apideck_unify.ActivityAttendeeStatus.ACCEPTED, }, - "all_day_event": False, - "private": True, - "group_event": True, - "event_sub_type": "debrief", - "group_event_type": "Proposed", - "child": False, - "archived": False, - "deleted": False, - "show_as": apideck_unify.ShowAs.BUSY, - "done": False, - "start_datetime": "2021-05-01T12:00:00.000Z", - "end_datetime": "2021-05-01T12:30:00.000Z", - "activity_date": "2021-05-01", - "end_date": "2021-05-01", - "recurrent": False, - "reminder_datetime": "2021-05-01T17:00:00.000Z", - "reminder_set": False, - "video_conference_url": "https://us02web.zoom.us/j/88120759396", - "video_conference_id": "zoom:88120759396", - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "attendees": [ - { - "name": "Elon Musk", - "first_name": "Elon", - "middle_name": "D.", - "last_name": "Musk", - "prefix": "Mr.", - "suffix": "PhD", - "email_address": "elon@musk.com", - "is_organizer": True, - "status": apideck_unify.ActivityAttendeeStatus.ACCEPTED, - }, - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `activity` | [models.ActivityInput](../../models/activityinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [Nullable[models.ActivityType]](../../models/activitytype.md) | :heavy_check_mark: | The type of the activity | meeting | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `activity_datetime` | *OptionalNullable[str]* | :heavy_minus_sign: | The date and time of the activity | 2021-05-01T12:00:00.000Z | +| `duration_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | The duration of the activity in seconds | 1800 | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The user related to the activity | 12345 | +| `account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The account related to the activity | 12345 | +| `contact_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The contact related to the activity | 12345 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company related to the activity | 12345 | +| `opportunity_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The opportunity related to the activity | 12345 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The lead related to the activity | 12345 | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The owner of the activity | 12345 | +| `campaign_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The campaign related to the activity | 12345 | +| `case_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The case related to the activity | 12345 | +| `asset_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The asset related to the activity | 12345 | +| `contract_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The contract related to the activity | 12345 | +| `product_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The product related to the activity | 12345 | +| `solution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The solution related to the activity | 12345 | +| `custom_object_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The custom object related to the activity | 12345 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The title of the activity | Meeting | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the activity | More info about the meeting | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | An internal note about the activity | An internal note about the meeting | +| `location` | *OptionalNullable[str]* | :heavy_minus_sign: | The location of the activity | Space | +| `location_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `all_day_event` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Activity is an all day event or not | false | +| `private` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Activity is private or not | true | +| `group_event` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Activity is a group event or not | true | +| `event_sub_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The sub type of the group event | debrief | +| `group_event_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the group event | Proposed | +| `child` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the activity is a child of another activity or not | false | +| `archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the activity is archived or not | false | +| `deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the activity is deleted or not | false | +| `show_as` | [OptionalNullable[models.ShowAs]](../../models/showas.md) | :heavy_minus_sign: | N/A | busy | +| `done` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Activity is done or not | false | +| `start_datetime` | *OptionalNullable[str]* | :heavy_minus_sign: | The start date and time of the activity | 2021-05-01T12:00:00.000Z | +| `end_datetime` | *OptionalNullable[str]* | :heavy_minus_sign: | The end date and time of the activity | 2021-05-01T12:30:00.000Z | +| `activity_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The date of the activity | 2021-05-01 | +| `end_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The end date of the activity | 2021-05-01 | +| `recurrent` | *Optional[bool]* | :heavy_minus_sign: | Whether the activity is recurrent or not | false | +| `reminder_datetime` | *OptionalNullable[str]* | :heavy_minus_sign: | The date and time of the reminder | 2021-05-01T17:00:00.000Z | +| `reminder_set` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the reminder is set or not | false | +| `video_conference_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the video conference | https://us02web.zoom.us/j/88120759396 | +| `video_conference_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the video conference | zoom:88120759396 | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | Custom fields of the activity | | +| `attendees` | List[[models.ActivityAttendeeInput](../../models/activityattendeeinput.md)] | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -236,11 +237,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.activities.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -285,178 +286,176 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.activities.update(id="", activity={ - "type": apideck_unify.ActivityType.MEETING, - "activity_datetime": "2021-05-01T12:00:00.000Z", - "duration_seconds": 1800, - "user_id": "12345", - "account_id": "12345", - "contact_id": "12345", - "company_id": "12345", - "opportunity_id": "12345", - "lead_id": "12345", - "owner_id": "12345", - "campaign_id": "12345", - "case_id": "12345", - "asset_id": "12345", - "contract_id": "12345", - "product_id": "12345", - "solution_id": "12345", - "custom_object_id": "12345", - "title": "Meeting", - "description": "More info about the meeting", - "note": "An internal note about the meeting", - "location": "Space", - "location_address": { - "id": "123", - "type": apideck_unify.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", + + res = apideck.crm.activities.update(id="", type_=apideck_unify.ActivityType.MEETING, service_id="salesforce", activity_datetime="2021-05-01T12:00:00.000Z", duration_seconds=1800, user_id="12345", account_id="12345", contact_id="12345", company_id="12345", opportunity_id="12345", lead_id="12345", owner_id="12345", campaign_id="12345", case_id="12345", asset_id="12345", contract_id="12345", product_id="12345", solution_id="12345", custom_object_id="12345", title="Meeting", description="More info about the meeting", note="An internal note about the meeting", location="Space", location_address={ + "id": "123", + "type": apideck_unify.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", + }, all_day_event=False, private=True, group_event=True, event_sub_type="debrief", group_event_type="Proposed", child=False, archived=False, deleted=False, show_as=apideck_unify.ShowAs.BUSY, done=False, start_datetime="2021-05-01T12:00:00.000Z", end_datetime="2021-05-01T12:30:00.000Z", activity_date="2021-05-01", end_date="2021-05-01", recurrent=False, reminder_datetime="2021-05-01T17:00:00.000Z", reminder_set=False, video_conference_url="https://us02web.zoom.us/j/88120759396", video_conference_id="zoom:88120759396", custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, }, - "all_day_event": False, - "private": True, - "group_event": True, - "event_sub_type": "debrief", - "group_event_type": "Proposed", - "child": False, - "archived": False, - "deleted": False, - "show_as": apideck_unify.ShowAs.BUSY, - "done": False, - "start_datetime": "2021-05-01T12:00:00.000Z", - "end_datetime": "2021-05-01T12:30:00.000Z", - "activity_date": "2021-05-01", - "end_date": "2021-05-01", - "recurrent": False, - "reminder_datetime": "2021-05-01T17:00:00.000Z", - "reminder_set": False, - "video_conference_url": "https://us02web.zoom.us/j/88120759396", - "video_conference_id": "zoom:88120759396", - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "attendees": [ - { - "name": "Elon Musk", - "first_name": "Elon", - "middle_name": "D.", - "last_name": "Musk", - "prefix": "Mr.", - "suffix": "PhD", - "email_address": "elon@musk.com", - "is_organizer": True, - "status": apideck_unify.ActivityAttendeeStatus.ACCEPTED, - }, - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + ], attendees=[ + { + "name": "Elon Musk", + "first_name": "Elon", + "middle_name": "D.", + "last_name": "Musk", + "prefix": "Mr.", + "suffix": "PhD", + "email_address": "elon@musk.com", + "is_organizer": True, + "status": apideck_unify.ActivityAttendeeStatus.ACCEPTED, + }, + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `activity` | [models.ActivityInput](../../models/activityinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `type` | [Nullable[models.ActivityType]](../../models/activitytype.md) | :heavy_check_mark: | The type of the activity | meeting | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `activity_datetime` | *OptionalNullable[str]* | :heavy_minus_sign: | The date and time of the activity | 2021-05-01T12:00:00.000Z | +| `duration_seconds` | *OptionalNullable[int]* | :heavy_minus_sign: | The duration of the activity in seconds | 1800 | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The user related to the activity | 12345 | +| `account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The account related to the activity | 12345 | +| `contact_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The contact related to the activity | 12345 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company related to the activity | 12345 | +| `opportunity_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The opportunity related to the activity | 12345 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The lead related to the activity | 12345 | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The owner of the activity | 12345 | +| `campaign_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The campaign related to the activity | 12345 | +| `case_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The case related to the activity | 12345 | +| `asset_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The asset related to the activity | 12345 | +| `contract_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The contract related to the activity | 12345 | +| `product_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The product related to the activity | 12345 | +| `solution_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The solution related to the activity | 12345 | +| `custom_object_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The custom object related to the activity | 12345 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The title of the activity | Meeting | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the activity | More info about the meeting | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | An internal note about the activity | An internal note about the meeting | +| `location` | *OptionalNullable[str]* | :heavy_minus_sign: | The location of the activity | Space | +| `location_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `all_day_event` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Activity is an all day event or not | false | +| `private` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Activity is private or not | true | +| `group_event` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Activity is a group event or not | true | +| `event_sub_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The sub type of the group event | debrief | +| `group_event_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the group event | Proposed | +| `child` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the activity is a child of another activity or not | false | +| `archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the activity is archived or not | false | +| `deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the activity is deleted or not | false | +| `show_as` | [OptionalNullable[models.ShowAs]](../../models/showas.md) | :heavy_minus_sign: | N/A | busy | +| `done` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Activity is done or not | false | +| `start_datetime` | *OptionalNullable[str]* | :heavy_minus_sign: | The start date and time of the activity | 2021-05-01T12:00:00.000Z | +| `end_datetime` | *OptionalNullable[str]* | :heavy_minus_sign: | The end date and time of the activity | 2021-05-01T12:30:00.000Z | +| `activity_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The date of the activity | 2021-05-01 | +| `end_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The end date of the activity | 2021-05-01 | +| `recurrent` | *Optional[bool]* | :heavy_minus_sign: | Whether the activity is recurrent or not | false | +| `reminder_datetime` | *OptionalNullable[str]* | :heavy_minus_sign: | The date and time of the reminder | 2021-05-01T17:00:00.000Z | +| `reminder_set` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the reminder is set or not | false | +| `video_conference_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the video conference | https://us02web.zoom.us/j/88120759396 | +| `video_conference_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ID of the video conference | zoom:88120759396 | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | Custom fields of the activity | | +| `attendees` | List[[models.ActivityAttendeeInput](../../models/activityattendeeinput.md)] | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -488,11 +487,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.activities.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/agedcreditorssdk/README.md b/docs/sdks/agedcreditorssdk/README.md new file mode 100644 index 00000000..8b9e6ed1 --- /dev/null +++ b/docs/sdks/agedcreditorssdk/README.md @@ -0,0 +1,64 @@ +# AgedCreditorsSDK +(*accounting.aged_creditors*) + +## Overview + +### Available Operations + +* [get](#get) - Get Aged Creditors + +## get + +Get Aged Creditors + +### Example Usage + +```python +from apideck_unify import Apideck +import os + +with Apideck( + api_key=os.getenv("APIDECK_API_KEY", ""), + consumer_id="test-consumer", + app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", +) as apideck: + + res = apideck.accounting.aged_creditors.get(service_id="salesforce", filter_={ + "customer_id": "123abc", + "report_as_of_date": "2024-01-01", + "period_count": 3, + "period_length": 30, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `filter_` | [Optional[models.AgedReportFilter]](../../models/agedreportfilter.md) | :heavy_minus_sign: | Apply filters | {
"customer_id": "123abc",
"report_as_of_date": "2024-01-01",
"period_count": 3,
"period_length": 30
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.AccountingAgedCreditorsOneResponse](../../models/accountingagedcreditorsoneresponse.md)** + +### Errors + +| 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 | \*/\* | \ No newline at end of file diff --git a/docs/sdks/ageddebtorssdk/README.md b/docs/sdks/ageddebtorssdk/README.md new file mode 100644 index 00000000..647bc8c4 --- /dev/null +++ b/docs/sdks/ageddebtorssdk/README.md @@ -0,0 +1,64 @@ +# AgedDebtorsSDK +(*accounting.aged_debtors*) + +## Overview + +### Available Operations + +* [get](#get) - Get Aged Debtors + +## get + +Get Aged Debtors + +### Example Usage + +```python +from apideck_unify import Apideck +import os + +with Apideck( + api_key=os.getenv("APIDECK_API_KEY", ""), + consumer_id="test-consumer", + app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", +) as apideck: + + res = apideck.accounting.aged_debtors.get(service_id="salesforce", filter_={ + "customer_id": "123abc", + "report_as_of_date": "2024-01-01", + "period_count": 3, + "period_length": 30, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `filter_` | [Optional[models.AgedReportFilter]](../../models/agedreportfilter.md) | :heavy_minus_sign: | Apply filters | {
"customer_id": "123abc",
"report_as_of_date": "2024-01-01",
"period_count": 3,
"period_length": 30
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.AccountingAgedDebtorsOneResponse](../../models/accountingageddebtorsoneresponse.md)** + +### Errors + +| 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 | \*/\* | \ No newline at end of file diff --git a/docs/sdks/apideckcompanies/README.md b/docs/sdks/apideckcompanies/README.md index 53f07d97..05a4733e 100644 --- a/docs/sdks/apideckcompanies/README.md +++ b/docs/sdks/apideckcompanies/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.companies.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.hris.companies.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `request` | [models.HrisCompaniesAllRequest](../../models/hriscompaniesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,105 +81,103 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.companies.create(hris_company={ - "legal_name": "SpaceX", - "display_name": "SpaceX", - "subdomain": "company", - "status": apideck_unify.HrisCompanyStatus.ACTIVE, - "company_number": "123456-AB", - "currency": apideck_unify.Currency.USD, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "debtor_id": "12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.hris.companies.create(legal_name="SpaceX", service_id="salesforce", display_name="SpaceX", subdomain="company", status=apideck_unify.HrisCompanyStatus.ACTIVE, company_number="123456-AB", currency=apideck_unify.Currency.USD, addresses=[ + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], debtor_id="12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `hris_company` | [models.HrisCompanyInput](../../models/hriscompanyinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `legal_name` | *Nullable[str]* | :heavy_check_mark: | N/A | SpaceX | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | SpaceX | +| `subdomain` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | company | +| `status` | [Optional[models.HrisCompanyStatus]](../../models/hriscompanystatus.md) | :heavy_minus_sign: | N/A | active | +| `company_number` | *OptionalNullable[str]* | :heavy_minus_sign: | An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. | 123456-AB | +| `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 | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `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 | | +| `websites` | List[[models.Website](../../models/website.md)] | :heavy_minus_sign: | N/A | | +| `debtor_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 12345 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -208,11 +209,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.hris.companies.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -257,197 +258,195 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.companies.update(id="", hris_company={ - "legal_name": "SpaceX", - "display_name": "SpaceX", - "subdomain": "company", - "status": apideck_unify.HrisCompanyStatus.ACTIVE, - "company_number": "123456-AB", - "currency": apideck_unify.Currency.USD, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "debtor_id": "12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.hris.companies.update(id="", legal_name="SpaceX", service_id="salesforce", display_name="SpaceX", subdomain="company", status=apideck_unify.HrisCompanyStatus.ACTIVE, company_number="123456-AB", currency=apideck_unify.Currency.USD, addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], debtor_id="12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `hris_company` | [models.HrisCompanyInput](../../models/hriscompanyinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `legal_name` | *Nullable[str]* | :heavy_check_mark: | N/A | SpaceX | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | SpaceX | +| `subdomain` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | company | +| `status` | [Optional[models.HrisCompanyStatus]](../../models/hriscompanystatus.md) | :heavy_minus_sign: | N/A | active | +| `company_number` | *OptionalNullable[str]* | :heavy_minus_sign: | An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. | 123456-AB | +| `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 | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `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 | | +| `websites` | List[[models.Website](../../models/website.md)] | :heavy_minus_sign: | N/A | | +| `debtor_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 12345 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -479,11 +478,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.hris.companies.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/apideckcustomers/README.md b/docs/sdks/apideckcustomers/README.md index 729ba9e5..b3766781 100644 --- a/docs/sdks/apideckcustomers/README.md +++ b/docs/sdks/apideckcustomers/README.md @@ -23,30 +23,33 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ecommerce.customers.list(request={ - "service_id": "salesforce", - "filter_": { - "email": "elon@musk.com", - "phone_number": "111-111-1111", - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.ecommerce.customers.list(service_id="salesforce", filter_={ + "email": "elon@musk.com", + "phone_number": "111-111-1111", + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `request` | [models.EcommerceCustomersAllRequest](../../models/ecommercecustomersallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.EcommerceCustomersFilter]](../../models/ecommercecustomersfilter.md) | :heavy_minus_sign: | Apply filters | {
"email": "elon@musk.com",
"phone_number": "111-111-1111"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,11 +81,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ecommerce.customers.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/apideckdepartments/README.md b/docs/sdks/apideckdepartments/README.md index e160f809..160da66d 100644 --- a/docs/sdks/apideckdepartments/README.md +++ b/docs/sdks/apideckdepartments/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.departments.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.hris.departments.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `request` | [models.HrisDepartmentsAllRequest](../../models/hrisdepartmentsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -77,49 +80,47 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.departments.create(department={ - "name": "R&D", - "code": "2", - "description": "R&D", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.hris.departments.create(service_id="salesforce", name="R&D", code="2", description="R&D", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `department` | [models.DepartmentInput](../../models/departmentinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Department name | R&D | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 2 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | R&D | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -151,11 +152,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.hris.departments.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -199,92 +200,90 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.departments.update(id="", department={ - "name": "R&D", - "code": "2", - "description": "R&D", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.hris.departments.update(id="", service_id="salesforce", name="R&D", code="2", description="R&D", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `department` | [models.DepartmentInput](../../models/departmentinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Department name | R&D | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 2 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | R&D | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -316,11 +315,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.hris.departments.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/apiresourcecoveragesdk/README.md b/docs/sdks/apiresourcecoveragesdk/README.md index ba6dab7b..fe4a5bcd 100644 --- a/docs/sdks/apiresourcecoveragesdk/README.md +++ b/docs/sdks/apiresourcecoveragesdk/README.md @@ -22,11 +22,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.connector.api_resource_coverage.get(id="", resource_id="") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/apiresources/README.md b/docs/sdks/apiresources/README.md index 2f38dc8f..f7a754ee 100644 --- a/docs/sdks/apiresources/README.md +++ b/docs/sdks/apiresources/README.md @@ -22,11 +22,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.connector.api_resources.get(id="", resource_id="") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/apis/README.md b/docs/sdks/apis/README.md index a4023685..ca2aec86 100644 --- a/docs/sdks/apis/README.md +++ b/docs/sdks/apis/README.md @@ -24,13 +24,15 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.connector.apis.list(filter_={ "status": apideck_unify.APIStatus.BETA, }) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` @@ -71,11 +73,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.connector.apis.get(id="") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/applicants/README.md b/docs/sdks/applicants/README.md index 4cf0d64e..8635c0d2 100644 --- a/docs/sdks/applicants/README.md +++ b/docs/sdks/applicants/README.md @@ -26,29 +26,32 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ats.applicants.list(request={ - "service_id": "salesforce", - "filter_": { - "job_id": "1234", - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.ats.applicants.list(service_id="salesforce", filter_={ + "job_id": "1234", + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `request` | [models.AtsApplicantsAllRequest](../../models/atsapplicantsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.ApplicantsFilter]](../../models/applicantsfilter.md) | :heavy_minus_sign: | Apply filters | {
"job_id": "1234"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -82,210 +85,208 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ats.applicants.create(applicant={ - "name": "Elon Musk", - "first_name": "Elon", - "last_name": "Musk", - "middle_name": "D.", - "initials": "EM", - "birthday": dateutil.parser.parse("2000-08-12").date(), - "cover_letter": "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", - "photo_url": "https://unavatar.io/elon-musk", - "headline": "PepsiCo, Inc, Central Perk", - "title": "CEO", - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.ApplicantType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.ApplicantType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.ApplicantType.PRIMARY, - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "stage_id": "12345", - "recruiter_id": "12345", - "coordinator_id": "12345", - "application_ids": [ - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6", - ], - "applications": [ - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6", - ], - "followers": [ - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6", - ], - "sources": [ - "Job site", - ], - "confidential": False, - "anonymized": True, - "tags": [ - "New", - ], - "archived": False, - "owner_id": "54321", - "record_url": "https://app.intercom.io/contacts/12345", - "deleted": True, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.ats.applicants.create(service_id="salesforce", name="Elon Musk", first_name="Elon", last_name="Musk", middle_name="D.", initials="EM", birthday=dateutil.parser.parse("2000-08-12").date(), cover_letter="I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", photo_url="https://unavatar.io/elon-musk", headline="PepsiCo, Inc, Central Perk", title="CEO", emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.ApplicantType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.ApplicantType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.ApplicantType.PRIMARY, + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], stage_id="12345", recruiter_id="12345", coordinator_id="12345", application_ids=[ + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6", + ], applications=[ + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6", + ], followers=[ + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6", + ], sources=[ + "Job site", + ], confidential=False, anonymized=True, tags=[ + "New", + ], archived=False, owner_id="54321", record_url="https://app.intercom.io/contacts/12345", deleted=True, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `applicant` | [models.ApplicantInput](../../models/applicantinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of an applicant. | Elon Musk | +| `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 | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Middle name of the person. | D. | +| `initials` | *OptionalNullable[str]* | :heavy_minus_sign: | The initials of the person, usually derived from their first, middle, and last names. | EM | +| `birthday` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date of birth of the person. | 2000-08-12 | +| `cover_letter` | *Optional[str]* | :heavy_minus_sign: | N/A | I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ... | +| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the photo of a person. | https://unavatar.io/elon-musk | +| `headline` | *Optional[str]* | :heavy_minus_sign: | Typically a list of previous companies where the contact has worked or schools that the contact has attended | PepsiCo, Inc, Central Perk | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `emails` | List[[models.Email](../../models/email.md)] | :heavy_minus_sign: | N/A | | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `phone_numbers` | List[[models.PhoneNumber](../../models/phonenumber.md)] | :heavy_minus_sign: | N/A | | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `websites` | List[[models.Websites](../../models/websites.md)] | :heavy_minus_sign: | N/A | | +| `social_links` | List[[models.SocialLinks](../../models/sociallinks.md)] | :heavy_minus_sign: | N/A | | +| `stage_id` | *Optional[str]* | :heavy_minus_sign: | N/A | 12345 | +| `recruiter_id` | *Optional[str]* | :heavy_minus_sign: | N/A | 12345 | +| `coordinator_id` | *Optional[str]* | :heavy_minus_sign: | N/A | 12345 | +| `application_ids` | List[*str*] | :heavy_minus_sign: | N/A | [
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6"
] | +| `applications` | List[*str*] | :heavy_minus_sign: | N/A | [
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6"
] | +| `followers` | List[*str*] | :heavy_minus_sign: | N/A | [
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6"
] | +| `sources` | List[*str*] | :heavy_minus_sign: | N/A | [
"Job site"
] | +| `confidential` | *Optional[bool]* | :heavy_minus_sign: | N/A | false | +| `anonymized` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | false | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 54321 | +| `record_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | https://app.intercom.io/contacts/12345 | +| `deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Flag to indicate if the object is deleted. | true | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -317,11 +318,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ats.applicants.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -367,220 +368,218 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ats.applicants.update(id="", applicant={ - "name": "Elon Musk", - "first_name": "Elon", - "last_name": "Musk", - "middle_name": "D.", - "initials": "EM", - "birthday": dateutil.parser.parse("2000-08-12").date(), - "cover_letter": "I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", - "photo_url": "https://unavatar.io/elon-musk", - "headline": "PepsiCo, Inc, Central Perk", - "title": "CEO", - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.ApplicantType.PRIMARY, - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "stage_id": "12345", - "recruiter_id": "12345", - "coordinator_id": "12345", - "application_ids": [ - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6", - ], - "applications": [ - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6", - ], - "followers": [ - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6", - ], - "sources": [ - "Job site", - ], - "confidential": False, - "anonymized": True, - "tags": [ - "New", - ], - "archived": False, - "owner_id": "54321", - "record_url": "https://app.intercom.io/contacts/12345", - "deleted": True, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.ats.applicants.update(id="", service_id="salesforce", name="Elon Musk", first_name="Elon", last_name="Musk", middle_name="D.", initials="EM", birthday=dateutil.parser.parse("2000-08-12").date(), cover_letter="I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ...", photo_url="https://unavatar.io/elon-musk", headline="PepsiCo, Inc, Central Perk", title="CEO", emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.ApplicantType.PRIMARY, + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], stage_id="12345", recruiter_id="12345", coordinator_id="12345", application_ids=[ + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6", + ], applications=[ + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6", + ], followers=[ + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6", + ], sources=[ + "Job site", + ], confidential=False, anonymized=True, tags=[ + "New", + ], archived=False, owner_id="54321", record_url="https://app.intercom.io/contacts/12345", deleted=True, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `applicant` | [models.ApplicantInput](../../models/applicantinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of an applicant. | Elon Musk | +| `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 | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Middle name of the person. | D. | +| `initials` | *OptionalNullable[str]* | :heavy_minus_sign: | The initials of the person, usually derived from their first, middle, and last names. | EM | +| `birthday` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date of birth of the person. | 2000-08-12 | +| `cover_letter` | *Optional[str]* | :heavy_minus_sign: | N/A | I submit this application to express my sincere interest in the API developer position. In the previous role, I was responsible for leadership and ... | +| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the photo of a person. | https://unavatar.io/elon-musk | +| `headline` | *Optional[str]* | :heavy_minus_sign: | Typically a list of previous companies where the contact has worked or schools that the contact has attended | PepsiCo, Inc, Central Perk | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `emails` | List[[models.Email](../../models/email.md)] | :heavy_minus_sign: | N/A | | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `phone_numbers` | List[[models.PhoneNumber](../../models/phonenumber.md)] | :heavy_minus_sign: | N/A | | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `websites` | List[[models.Websites](../../models/websites.md)] | :heavy_minus_sign: | N/A | | +| `social_links` | List[[models.SocialLinks](../../models/sociallinks.md)] | :heavy_minus_sign: | N/A | | +| `stage_id` | *Optional[str]* | :heavy_minus_sign: | N/A | 12345 | +| `recruiter_id` | *Optional[str]* | :heavy_minus_sign: | N/A | 12345 | +| `coordinator_id` | *Optional[str]* | :heavy_minus_sign: | N/A | 12345 | +| `application_ids` | List[*str*] | :heavy_minus_sign: | N/A | [
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6"
] | +| `applications` | List[*str*] | :heavy_minus_sign: | N/A | [
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6"
] | +| `followers` | List[*str*] | :heavy_minus_sign: | N/A | [
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6"
] | +| `sources` | List[*str*] | :heavy_minus_sign: | N/A | [
"Job site"
] | +| `confidential` | *Optional[bool]* | :heavy_minus_sign: | N/A | false | +| `anonymized` | *Optional[bool]* | :heavy_minus_sign: | N/A | true | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `archived` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | false | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 54321 | +| `record_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | https://app.intercom.io/contacts/12345 | +| `deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Flag to indicate if the object is deleted. | true | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -612,11 +611,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ats.applicants.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/applications/README.md b/docs/sdks/applications/README.md index 992a2bb4..35540f38 100644 --- a/docs/sdks/applications/README.md +++ b/docs/sdks/applications/README.md @@ -26,25 +26,28 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ats.applications.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, + + res = apideck.ats.applications.list(service_id="salesforce", pass_through={ + "search": "San Francisco", }) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `request` | [models.AtsApplicationsAllRequest](../../models/atsapplicationsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -77,53 +80,51 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ats.applications.create(application={ - "applicant_id": "12345", - "job_id": "12345", - "status": apideck_unify.ApplicationStatus.OPEN, - "stage": { - "id": "12345", - "name": "12345", - }, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.ats.applications.create(applicant_id="12345", job_id="12345", service_id="salesforce", status=apideck_unify.ApplicationStatus.OPEN, stage={ + "id": "12345", + "name": "12345", + }, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `application` | [models.ApplicationInput](../../models/applicationinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `applicant_id` | *Nullable[str]* | :heavy_check_mark: | N/A | 12345 | +| `job_id` | *Nullable[str]* | :heavy_check_mark: | N/A | 12345 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `status` | [OptionalNullable[models.ApplicationStatus]](../../models/applicationstatus.md) | :heavy_minus_sign: | N/A | open | +| `stage` | [Optional[models.Stage]](../../models/stage.md) | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -155,11 +156,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ats.applications.get(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -203,96 +204,94 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ats.applications.update(id="", application={ - "applicant_id": "12345", - "job_id": "12345", - "status": apideck_unify.ApplicationStatus.OPEN, - "stage": { - "id": "12345", - "name": "12345", - }, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.ats.applications.update(id="", applicant_id="12345", job_id="12345", service_id="salesforce", status=apideck_unify.ApplicationStatus.OPEN, stage={ + "id": "12345", + "name": "12345", + }, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `application` | [models.ApplicationInput](../../models/applicationinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `applicant_id` | *Nullable[str]* | :heavy_check_mark: | N/A | 12345 | +| `job_id` | *Nullable[str]* | :heavy_check_mark: | N/A | 12345 | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `status` | [OptionalNullable[models.ApplicationStatus]](../../models/applicationstatus.md) | :heavy_minus_sign: | N/A | open | +| `stage` | [Optional[models.Stage]](../../models/stage.md) | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -324,11 +323,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ats.applications.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/attachments/README.md b/docs/sdks/attachments/README.md index 1ec902e3..995e5d2e 100644 --- a/docs/sdks/attachments/README.md +++ b/docs/sdks/attachments/README.md @@ -26,25 +26,28 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.attachments.list(request={ - "reference_type": apideck_unify.AttachmentReferenceType.INVOICE, - "reference_id": "123456", - "service_id": "salesforce", - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.attachments.list(reference_type=apideck_unify.AttachmentReferenceType.INVOICE, reference_id="123456", service_id="salesforce", fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `request` | [models.AccountingAttachmentsAllRequest](../../models/accountingattachmentsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reference_type` | [models.AttachmentReferenceType](../../models/attachmentreferencetype.md) | :heavy_check_mark: | The reference type of the document. | invoice | +| `reference_id` | *str* | :heavy_check_mark: | The reference id of the object to retrieve. | 12345 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -77,26 +80,25 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.attachments.get(request={ - "reference_type": apideck_unify.AttachmentReferenceType.INVOICE, - "reference_id": "123456", - "id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.accounting.attachments.get(reference_type=apideck_unify.AttachmentReferenceType.INVOICE, reference_id="123456", id="", service_id="salesforce", fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `request` | [models.AccountingAttachmentsOneRequest](../../models/accountingattachmentsonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reference_type` | [models.AttachmentReferenceType](../../models/attachmentreferencetype.md) | :heavy_check_mark: | The reference type of the document. | invoice | +| `reference_id` | *str* | :heavy_check_mark: | The reference id of the object to retrieve. | 12345 | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -129,25 +131,24 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.attachments.delete(request={ - "reference_type": apideck_unify.AttachmentReferenceType.INVOICE, - "reference_id": "123456", - "id": "", - "service_id": "salesforce", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.attachments.delete(reference_type=apideck_unify.AttachmentReferenceType.INVOICE, reference_id="123456", id="", service_id="salesforce") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingAttachmentsDeleteRequest](../../models/accountingattachmentsdeleterequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `reference_type` | [models.AttachmentReferenceType](../../models/attachmentreferencetype.md) | :heavy_check_mark: | The reference type of the document. | invoice | +| `reference_id` | *str* | :heavy_check_mark: | The reference id of the object to retrieve. | 12345 | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -180,26 +181,24 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.attachments.download(request={ - "reference_type": apideck_unify.AttachmentReferenceType.INVOICE, - "reference_id": "123456", - "id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.accounting.attachments.download(reference_type=apideck_unify.AttachmentReferenceType.INVOICE, reference_id="123456", id="", service_id="salesforce", fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingAttachmentsDownloadRequest](../../models/accountingattachmentsdownloadrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reference_type` | [models.AttachmentReferenceType](../../models/attachmentreferencetype.md) | :heavy_check_mark: | The reference type of the document. | invoice | +| `reference_id` | *str* | :heavy_check_mark: | The reference id of the object to retrieve. | 12345 | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/balancesheetsdk/README.md b/docs/sdks/balancesheetsdk/README.md index b2d6bd53..ca8b0bf0 100644 --- a/docs/sdks/balancesheetsdk/README.md +++ b/docs/sdks/balancesheetsdk/README.md @@ -23,6 +23,7 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.balance_sheet.get(service_id="salesforce", pass_through={ "search": "San Francisco", }, filter_={ @@ -32,9 +33,8 @@ with Apideck( "period_type": apideck_unify.PeriodType.MONTH, }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/billpayments/README.md b/docs/sdks/billpayments/README.md index f7cbe8f5..8a87d360 100644 --- a/docs/sdks/billpayments/README.md +++ b/docs/sdks/billpayments/README.md @@ -28,33 +28,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.bill_payments.list(request={ - "service_id": "salesforce", - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.PaymentsSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.bill_payments.list(service_id="salesforce", filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.PaymentsSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingBillPaymentsAllRequest](../../models/accountingbillpaymentsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.PaymentsFilter]](../../models/paymentsfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.PaymentsSort]](../../models/paymentssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -88,115 +91,113 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.bill_payments.create(bill_payment={ - "total_amount": 49.99, - "transaction_date": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "currency": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "reference": "123456", - "payment_method": "cash", - "payment_method_reference": "123456", - "payment_method_id": "12345", - "account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + + res = apideck.accounting.bill_payments.create(total_amount=49.99, transaction_date=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), service_id="salesforce", currency=apideck_unify.Currency.USD, currency_rate=0.69, reference="123456", payment_method="cash", payment_method_reference="123456", payment_method_id="12345", account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, supplier={ + "id": "12345", + "display_name": "Windsurf Shop", + "address": { + "id": "123", + "type": apideck_unify.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", }, - "supplier": { + }, company_id="12345", reconciled=True, status=apideck_unify.PaymentStatus.AUTHORISED, type_=apideck_unify.BillPaymentType.ACCOUNTS_PAYABLE, allocations=[ + { "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - }, + "type": apideck_unify.BillPaymentAllocationType.BILL, + "amount": 49.99, + "allocation_id": "123456", + }, + ], note="Some notes about this transaction", number="123456", tracking_categories=[ + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", }, - "company_id": "12345", - "reconciled": True, - "status": apideck_unify.PaymentStatus.AUTHORISED, - "type": apideck_unify.BillPaymentType.ACCOUNTS_PAYABLE, - "allocations": [ - { - "id": "12345", - "type": apideck_unify.BillPaymentAllocationType.BILL, - "amount": 49.99, - "allocation_id": "123456", - }, - ], - "note": "Some notes about this transaction", - "number": "123456", - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], - "row_version": "1-12345", - "display_id": "123456", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], row_version="1-12345", display_id="123456", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `bill_payment` | [models.BillPaymentInput](../../models/billpaymentinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `total_amount` | *Nullable[float]* | :heavy_check_mark: | The total amount of the transaction | 49.99 | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional transaction reference message ie: Debit remittance detail. | 123456 | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `payment_method_reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message returned by payment method on processing | 123456 | +| `payment_method_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `supplier` | [OptionalNullable[models.LinkedSupplierInput]](../../models/linkedsupplierinput.md) | :heavy_minus_sign: | The supplier this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `reconciled` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates if the transaction has been reconciled. | true | +| `status` | [Optional[models.PaymentStatus]](../../models/paymentstatus.md) | :heavy_minus_sign: | Status of payment | authorised | +| `type` | [Optional[models.BillPaymentType]](../../models/billpaymenttype.md) | :heavy_minus_sign: | Type of payment | accounts_payable | +| `allocations` | List[[models.BillPaymentAllocations](../../models/billpaymentallocations.md)] | :heavy_minus_sign: | N/A | | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Note associated with the transaction | Some notes about this transaction | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Number associated with the transaction | 123456 | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `display_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -228,11 +229,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.bill_payments.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -278,143 +279,141 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.bill_payments.update(id="", bill_payment={ - "total_amount": 49.99, - "transaction_date": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "currency": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "reference": "123456", - "payment_method": "cash", - "payment_method_reference": "123456", - "payment_method_id": "12345", - "account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + + res = apideck.accounting.bill_payments.update(id="", total_amount=49.99, transaction_date=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), service_id="salesforce", currency=apideck_unify.Currency.USD, currency_rate=0.69, reference="123456", payment_method="cash", payment_method_reference="123456", payment_method_id="12345", account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, supplier={ + "id": "12345", + "display_name": "Windsurf Shop", + "address": { + "id": "123", + "type": apideck_unify.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", }, - "supplier": { + }, company_id="12345", reconciled=True, status=apideck_unify.PaymentStatus.AUTHORISED, type_=apideck_unify.BillPaymentType.ACCOUNTS_PAYABLE, allocations=[ + { "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - }, + "type": apideck_unify.BillPaymentAllocationType.BILL, + "amount": 49.99, + "allocation_id": "123456", + }, + { + "id": "12345", + "type": apideck_unify.BillPaymentAllocationType.BILL, + "amount": 49.99, + "allocation_id": "123456", + }, + { + "id": "12345", + "type": apideck_unify.BillPaymentAllocationType.BILL, + "amount": 49.99, + "allocation_id": "123456", + }, + ], note="Some notes about this transaction", number="123456", tracking_categories=[ + { + "id": "123456", + "name": "New York", }, - "company_id": "12345", - "reconciled": True, - "status": apideck_unify.PaymentStatus.AUTHORISED, - "type": apideck_unify.BillPaymentType.ACCOUNTS_PAYABLE, - "allocations": [ - { - "id": "12345", - "type": apideck_unify.BillPaymentAllocationType.BILL, - "amount": 49.99, - "allocation_id": "123456", - }, - { - "id": "12345", - "type": apideck_unify.BillPaymentAllocationType.BILL, - "amount": 49.99, - "allocation_id": "123456", - }, - { - "id": "12345", - "type": apideck_unify.BillPaymentAllocationType.BILL, - "amount": 49.99, - "allocation_id": "123456", - }, - ], - "note": "Some notes about this transaction", - "number": "123456", - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "row_version": "1-12345", - "display_id": "123456", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + { + "id": "123456", + "name": "New York", + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + ], row_version="1-12345", display_id="123456", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `bill_payment` | [models.BillPaymentInput](../../models/billpaymentinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `total_amount` | *Nullable[float]* | :heavy_check_mark: | The total amount of the transaction | 49.99 | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional transaction reference message ie: Debit remittance detail. | 123456 | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `payment_method_reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message returned by payment method on processing | 123456 | +| `payment_method_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `supplier` | [OptionalNullable[models.LinkedSupplierInput]](../../models/linkedsupplierinput.md) | :heavy_minus_sign: | The supplier this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `reconciled` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates if the transaction has been reconciled. | true | +| `status` | [Optional[models.PaymentStatus]](../../models/paymentstatus.md) | :heavy_minus_sign: | Status of payment | authorised | +| `type` | [Optional[models.BillPaymentType]](../../models/billpaymenttype.md) | :heavy_minus_sign: | Type of payment | accounts_payable | +| `allocations` | List[[models.BillPaymentAllocations](../../models/billpaymentallocations.md)] | :heavy_minus_sign: | N/A | | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Note associated with the transaction | Some notes about this transaction | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Number associated with the transaction | 123456 | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `display_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -446,11 +445,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.bill_payments.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/bills/README.md b/docs/sdks/bills/README.md index d73210d6..9d8da22e 100644 --- a/docs/sdks/bills/README.md +++ b/docs/sdks/bills/README.md @@ -28,33 +28,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.bills.list(request={ - "service_id": "salesforce", - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.By.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.bills.list(service_id="salesforce", filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.By.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `request` | [models.AccountingBillsAllRequest](../../models/accountingbillsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.BillsFilter]](../../models/billsfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.BillsSort]](../../models/billssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -88,161 +91,159 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.bills.create(bill={ - "bill_number": "10001", - "supplier": { - "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - }, + + res = apideck.accounting.bills.create(service_id="salesforce", bill_number="10001", supplier={ + "id": "12345", + "display_name": "Windsurf Shop", + "address": { + "id": "123", + "type": apideck_unify.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": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "tax_inclusive": True, - "bill_date": dateutil.parser.parse("2020-09-30").date(), - "due_date": dateutil.parser.parse("2020-10-30").date(), - "paid_date": dateutil.parser.parse("2020-10-30").date(), - "po_number": "90000117", - "reference": "123456", - "line_items": [ - { - "row_id": "12345", + }, company_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, bill_date=dateutil.parser.parse("2020-09-30").date(), due_date=dateutil.parser.parse("2020-10-30").date(), paid_date=dateutil.parser.parse("2020-10-30").date(), po_number="90000117", reference="123456", 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": apideck_unify.BillLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", "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": apideck_unify.BillLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "tracking_categories": [ + { "id": "123456", - "rate": 10, + "name": "New York", }, - "ledger_account": { + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "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": apideck_unify.BillStatus.DRAFT, - "ledger_account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + ], + "row_version": "1-12345", }, - "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": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, + ], 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=apideck_unify.BillStatus.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": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, discount_percentage=5.5, tracking_categories=[ + { + "id": "123456", + "name": "New York", }, - "discount_percentage": 5.5, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - "accounting_period": "01-24", - }, service_id="salesforce") + }, + ], + }, + ], accounting_period="01-24") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `bill` | [models.BillInput](../../models/billinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `bill_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference to supplier bill number | 10001 | +| `supplier` | [OptionalNullable[models.LinkedSupplierInput]](../../models/linkedsupplierinput.md) | :heavy_minus_sign: | The supplier this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `tax_inclusive` | *OptionalNullable[bool]* | :heavy_minus_sign: | Amounts are including tax | true | +| `bill_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Date bill was issued - YYYY-MM-DD. | 2020-09-30 | +| `due_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. | 2020-10-30 | +| `paid_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. | 2020-10-30 | +| `po_number` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | 90000117 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional bill reference. | 123456 | +| `line_items` | List[[models.BillLineItemInput](../../models/billlineiteminput.md)] | :heavy_minus_sign: | N/A | | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Terms of payment. | Net 30 days | +| `balance` | *OptionalNullable[float]* | :heavy_minus_sign: | Balance of bill due. | 27500 | +| `deposit` | *OptionalNullable[float]* | :heavy_minus_sign: | Amount of deposit made to this bill. | 0 | +| `sub_total` | *OptionalNullable[float]* | :heavy_minus_sign: | Sub-total amount, normally before tax. | 27500 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this bill. | 2500 | +| `total` | *OptionalNullable[float]* | :heavy_minus_sign: | Total amount of bill, including tax. | 27500 | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `notes` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Some notes about this bill. | +| `status` | [OptionalNullable[models.BillStatus]](../../models/billstatus.md) | :heavy_minus_sign: | Invoice status | draft | +| `ledger_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `accounting_by_row` | *OptionalNullable[bool]* | :heavy_minus_sign: | 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. | false | +| `bank_account` | [Optional[models.BankAccount]](../../models/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `discount_percentage` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount percentage applied to this transaction. | 5.5 | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `accounting_period` | *OptionalNullable[str]* | :heavy_minus_sign: | Accounting period | 01-24 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -274,11 +275,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.bills.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -324,264 +325,262 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.bills.update(id="", bill={ - "bill_number": "10001", - "supplier": { - "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - }, + + res = apideck.accounting.bills.update(id="", service_id="salesforce", bill_number="10001", supplier={ + "id": "12345", + "display_name": "Windsurf Shop", + "address": { + "id": "123", + "type": apideck_unify.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": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "tax_inclusive": True, - "bill_date": dateutil.parser.parse("2020-09-30").date(), - "due_date": dateutil.parser.parse("2020-10-30").date(), - "paid_date": dateutil.parser.parse("2020-10-30").date(), - "po_number": "90000117", - "reference": "123456", - "line_items": [ - { - "row_id": "12345", + }, company_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, bill_date=dateutil.parser.parse("2020-09-30").date(), due_date=dateutil.parser.parse("2020-10-30").date(), paid_date=dateutil.parser.parse("2020-10-30").date(), po_number="90000117", reference="123456", 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": apideck_unify.BillLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", "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": apideck_unify.BillLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "tracking_categories": [ + { "id": "123456", - "rate": 10, + "name": "New York", }, - "ledger_account": { + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "row_version": "1-12345", - }, - { - "row_id": "12345", + ], + "row_version": "1-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": apideck_unify.BillLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", "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": apideck_unify.BillLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { - "id": "123456", - "rate": 10, - }, - "ledger_account": { + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "tracking_categories": [ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "row_version": "1-12345", - }, - { - "row_id": "12345", + ], + "row_version": "1-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": apideck_unify.BillLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", "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": apideck_unify.BillLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", + "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", }, - "tax_rate": { + { "id": "123456", - "rate": 10, + "name": "New York", }, - "ledger_account": { + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - { - "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": apideck_unify.BillStatus.DRAFT, - "ledger_account": { + ], + "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=apideck_unify.BillStatus.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": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, discount_percentage=5.5, tracking_categories=[ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "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": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, + { + "id": "123456", + "name": "New York", }, - "discount_percentage": 5.5, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - "accounting_period": "01-24", - }, service_id="salesforce") + }, + ], + }, + ], accounting_period="01-24") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `bill` | [models.BillInput](../../models/billinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `bill_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference to supplier bill number | 10001 | +| `supplier` | [OptionalNullable[models.LinkedSupplierInput]](../../models/linkedsupplierinput.md) | :heavy_minus_sign: | The supplier this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `tax_inclusive` | *OptionalNullable[bool]* | :heavy_minus_sign: | Amounts are including tax | true | +| `bill_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Date bill was issued - YYYY-MM-DD. | 2020-09-30 | +| `due_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. | 2020-10-30 | +| `paid_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. | 2020-10-30 | +| `po_number` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | 90000117 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional bill reference. | 123456 | +| `line_items` | List[[models.BillLineItemInput](../../models/billlineiteminput.md)] | :heavy_minus_sign: | N/A | | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Terms of payment. | Net 30 days | +| `balance` | *OptionalNullable[float]* | :heavy_minus_sign: | Balance of bill due. | 27500 | +| `deposit` | *OptionalNullable[float]* | :heavy_minus_sign: | Amount of deposit made to this bill. | 0 | +| `sub_total` | *OptionalNullable[float]* | :heavy_minus_sign: | Sub-total amount, normally before tax. | 27500 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this bill. | 2500 | +| `total` | *OptionalNullable[float]* | :heavy_minus_sign: | Total amount of bill, including tax. | 27500 | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `notes` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Some notes about this bill. | +| `status` | [OptionalNullable[models.BillStatus]](../../models/billstatus.md) | :heavy_minus_sign: | Invoice status | draft | +| `ledger_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `accounting_by_row` | *OptionalNullable[bool]* | :heavy_minus_sign: | 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. | false | +| `bank_account` | [Optional[models.BankAccount]](../../models/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `discount_percentage` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount percentage applied to this transaction. | 5.5 | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `accounting_period` | *OptionalNullable[str]* | :heavy_minus_sign: | Accounting period | 01-24 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -613,11 +612,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.bills.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/collections/README.md b/docs/sdks/collections/README.md index 1e9f0707..5aaa62ff 100644 --- a/docs/sdks/collections/README.md +++ b/docs/sdks/collections/README.md @@ -24,30 +24,33 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collections.list(request={ - "service_id": "salesforce", - "sort": { - "by": apideck_unify.CollectionsSortBy.NAME, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.issue_tracking.collections.list(service_id="salesforce", sort={ + "by": apideck_unify.CollectionsSortBy.NAME, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionsAllRequest](../../models/issuetrackingcollectionsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `sort` | [Optional[models.CollectionsSort]](../../models/collectionssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "name",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -79,11 +82,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.issue_tracking.collections.get(collection_id="apideck-io", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/collectiontags/README.md b/docs/sdks/collectiontags/README.md index f7178d76..c65906ef 100644 --- a/docs/sdks/collectiontags/README.md +++ b/docs/sdks/collectiontags/README.md @@ -22,27 +22,30 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_tags.list(request={ - "collection_id": "apideck-io", - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.issue_tracking.collection_tags.list(collection_id="apideck-io", service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTagsAllRequest](../../models/issuetrackingcollectiontagsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/collectionticketcomments/README.md b/docs/sdks/collectionticketcomments/README.md index 9ecf9180..6d85c13d 100644 --- a/docs/sdks/collectionticketcomments/README.md +++ b/docs/sdks/collectionticketcomments/README.md @@ -27,32 +27,35 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_ticket_comments.list(request={ - "collection_id": "apideck-io", - "ticket_id": "", - "service_id": "salesforce", - "sort": { - "by": apideck_unify.CommentsSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.issue_tracking.collection_ticket_comments.list(collection_id="apideck-io", ticket_id="", service_id="salesforce", sort={ + "by": apideck_unify.CommentsSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTicketCommentsAllRequest](../../models/issuetrackingcollectionticketcommentsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `ticket_id` | *str* | :heavy_check_mark: | ID of the ticket you are acting upon. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `sort` | [Optional[models.CommentsSort]](../../models/commentssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -84,50 +87,47 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_ticket_comments.create(request={ - "collection_id": "apideck-io", - "ticket_id": "", - "collection_ticket_comment": { - "body": "What internet provider do you use?", - "pass_through": [ + + res = apideck.issue_tracking.collection_ticket_comments.create(collection_id="apideck-io", ticket_id="", service_id="salesforce", body="What internet provider do you use?", pass_through=[ + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, ], }, - "service_id": "salesforce", - }) + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTicketCommentsAddRequest](../../models/issuetrackingcollectionticketcommentsaddrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `ticket_id` | *str* | :heavy_check_mark: | ID of the ticket you are acting upon. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `body` | *OptionalNullable[str]* | :heavy_minus_sign: | Body of the comment | What internet provider do you use? | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -159,26 +159,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_ticket_comments.get(request={ - "id": "", - "collection_id": "apideck-io", - "ticket_id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.issue_tracking.collection_ticket_comments.get(id="", collection_id="apideck-io", ticket_id="", service_id="salesforce", fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTicketCommentsOneRequest](../../models/issuetrackingcollectionticketcommentsonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `ticket_id` | *str* | :heavy_check_mark: | ID of the ticket you are acting upon. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -210,93 +213,90 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_ticket_comments.update(request={ - "id": "", - "collection_id": "apideck-io", - "ticket_id": "", - "collection_ticket_comment": { - "body": "What internet provider do you use?", - "pass_through": [ + + res = apideck.issue_tracking.collection_ticket_comments.update(id="", collection_id="apideck-io", ticket_id="", service_id="salesforce", body="What internet provider do you use?", pass_through=[ + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, + ], + }, + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, + ], + }, + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, ], }, - "service_id": "salesforce", - }) + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTicketCommentsUpdateRequest](../../models/issuetrackingcollectionticketcommentsupdaterequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `ticket_id` | *str* | :heavy_check_mark: | ID of the ticket you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `body` | *OptionalNullable[str]* | :heavy_minus_sign: | Body of the comment | What internet provider do you use? | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -328,25 +328,24 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_ticket_comments.delete(request={ - "id": "", - "collection_id": "apideck-io", - "ticket_id": "", - "service_id": "salesforce", - }) - if res is not None: - # handle response - pass + res = apideck.issue_tracking.collection_ticket_comments.delete(id="", collection_id="apideck-io", ticket_id="", service_id="salesforce") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTicketCommentsDeleteRequest](../../models/issuetrackingcollectionticketcommentsdeleterequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `ticket_id` | *str* | :heavy_check_mark: | ID of the ticket you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/collectiontickets/README.md b/docs/sdks/collectiontickets/README.md index 714b58e7..aaa79a49 100644 --- a/docs/sdks/collectiontickets/README.md +++ b/docs/sdks/collectiontickets/README.md @@ -27,36 +27,39 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_tickets.list(request={ - "collection_id": "apideck-io", - "service_id": "salesforce", - "sort": { - "by": apideck_unify.TicketsSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "filter_": { - "status": [ - "open", - ], - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.issue_tracking.collection_tickets.list(collection_id="apideck-io", service_id="salesforce", sort={ + "by": apideck_unify.TicketsSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, filter_={ + "status": [ + "open", + ], + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTicketsAllRequest](../../models/issuetrackingcollectionticketsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `sort` | [Optional[models.TicketsSort]](../../models/ticketssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `filter_` | [Optional[models.IssuesFilter]](../../models/issuesfilter.md) | :heavy_minus_sign: | Apply filters | {
"status": [
"open"
]
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -90,59 +93,57 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_tickets.create(collection_id="apideck-io", ticket={ - "parent_id": "12345", - "type": "Technical", - "subject": "Technical Support Request", - "description": "I am facing issues with my internet connection", - "status": "open", - "priority": apideck_unify.Priority.HIGH, - "assignees": [ - { - "id": "12345", - }, - ], - "due_date": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "tags": [ - { - "id": "12345", - }, - { - "id": "12345", - }, - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.issue_tracking.collection_tickets.create(collection_id="apideck-io", service_id="salesforce", parent_id="12345", type_="Technical", subject="Technical Support Request", description="I am facing issues with my internet connection", status="open", priority=apideck_unify.Priority.HIGH, assignees=[ + { + "id": "12345", + }, + ], due_date=dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), tags=[ + { + "id": "12345", + }, + { + "id": "12345", + }, + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | -| `ticket` | [models.TicketInput](../../models/ticketinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ticket's parent ID | 12345 | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The ticket's type | Technical | +| `subject` | *OptionalNullable[str]* | :heavy_minus_sign: | Subject of the ticket | Technical Support Request | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The ticket's description. HTML version of description is mapped if supported by the third-party platform | I am facing issues with my internet connection | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | open | +| `priority` | [OptionalNullable[models.Priority]](../../models/priority.md) | :heavy_minus_sign: | Priority of the ticket | high | +| `assignees` | List[[models.AssigneeInput](../../models/assigneeinput.md)] | :heavy_minus_sign: | N/A | | +| `due_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Due date of the ticket | 2020-09-30T07:43:32.000Z | +| `tags` | List[[models.CollectionTagInput](../../models/collectiontaginput.md)] | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -174,25 +175,24 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_tickets.get(request={ - "ticket_id": "", - "collection_id": "apideck-io", - "service_id": "salesforce", - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.issue_tracking.collection_tickets.get(ticket_id="", collection_id="apideck-io", service_id="salesforce", fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTicketsOneRequest](../../models/issuetrackingcollectionticketsonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ticket_id` | *str* | :heavy_check_mark: | ID of the ticket you are acting upon. | | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -226,83 +226,80 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_tickets.update(request={ - "ticket_id": "", - "collection_id": "apideck-io", - "ticket": { - "parent_id": "12345", - "type": "Technical", - "subject": "Technical Support Request", - "description": "I am facing issues with my internet connection", - "status": "open", - "priority": apideck_unify.Priority.HIGH, - "assignees": [ - { - "id": "12345", - }, - { - "id": "12345", - }, - { - "id": "12345", - }, - ], - "due_date": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "tags": [ + + res = apideck.issue_tracking.collection_tickets.update(ticket_id="", collection_id="apideck-io", service_id="salesforce", parent_id="12345", type_="Technical", subject="Technical Support Request", description="I am facing issues with my internet connection", status="open", priority=apideck_unify.Priority.HIGH, assignees=[ + { + "id": "12345", + }, + { + "id": "12345", + }, + { + "id": "12345", + }, + ], due_date=dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), tags=[ + { + "id": "12345", + }, + { + "id": "12345", + }, + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ { - "id": "12345", + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", + }, + }, }, { - "id": "12345", + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", + }, + }, }, - ], - "pass_through": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, - }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, - }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, ], }, - "service_id": "salesforce", - }) + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionTicketsUpdateRequest](../../models/issuetrackingcollectionticketsupdaterequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ticket_id` | *str* | :heavy_check_mark: | ID of the ticket you are acting upon. | | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The ticket's parent ID | 12345 | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The ticket's type | Technical | +| `subject` | *OptionalNullable[str]* | :heavy_minus_sign: | Subject of the ticket | Technical Support Request | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The ticket's description. HTML version of description is mapped if supported by the third-party platform | I am facing issues with my internet connection | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | open | +| `priority` | [OptionalNullable[models.Priority]](../../models/priority.md) | :heavy_minus_sign: | Priority of the ticket | high | +| `assignees` | List[[models.AssigneeInput](../../models/assigneeinput.md)] | :heavy_minus_sign: | N/A | | +| `due_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Due date of the ticket | 2020-09-30T07:43:32.000Z | +| `tags` | List[[models.CollectionTagInput](../../models/collectiontaginput.md)] | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -334,11 +331,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.issue_tracking.collection_tickets.delete(ticket_id="", collection_id="apideck-io", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/collectionusers/README.md b/docs/sdks/collectionusers/README.md index 5fb21e8c..8cfe12c9 100644 --- a/docs/sdks/collectionusers/README.md +++ b/docs/sdks/collectionusers/README.md @@ -23,27 +23,30 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_users.list(request={ - "collection_id": "apideck-io", - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.issue_tracking.collection_users.list(collection_id="apideck-io", service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionUsersAllRequest](../../models/issuetrackingcollectionusersallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -75,25 +78,24 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.issue_tracking.collection_users.get(request={ - "collection_id": "apideck-io", - "id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.issue_tracking.collection_users.get(collection_id="apideck-io", id="", service_id="salesforce", fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `request` | [models.IssueTrackingCollectionUsersOneRequest](../../models/issuetrackingcollectionusersonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `collection_id` | *str* | :heavy_check_mark: | The collection ID | apideck-io | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/companies/README.md b/docs/sdks/companies/README.md index 438987a2..8c5c3150 100644 --- a/docs/sdks/companies/README.md +++ b/docs/sdks/companies/README.md @@ -27,33 +27,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.companies.list(request={ - "service_id": "salesforce", - "filter_": { - "name": "SpaceX", - }, - "sort": { - "by": apideck_unify.CompaniesSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.crm.companies.list(service_id="salesforce", filter_={ + "name": "SpaceX", + }, sort={ + "by": apideck_unify.CompaniesSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `request` | [models.CrmCompaniesAllRequest](../../models/crmcompaniesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.CompaniesFilter]](../../models/companiesfilter.md) | :heavy_minus_sign: | Apply filters | {
"name": "SpaceX"
} | +| `sort` | [Optional[models.CompaniesSort]](../../models/companiessort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -87,242 +90,240 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.companies.create(company={ - "name": "SpaceX", - "owner_id": "12345", - "image": "https://www.spacex.com/static/images/share.jpg", - "description": "Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.", - "vat_number": "BE0689615164", - "currency": apideck_unify.Currency.USD, - "status": "Open", - "fax": "+12129876543", - "annual_revenue": "+$35m", - "number_of_employees": "500-1000", - "industry": "Apparel", - "ownership": "Public", - "sales_tax_number": "12456EN", - "payee_number": "78932EN", - "abn_or_tfn": "46 115 614 695", - "abn_branch": "123", - "acn": "XXX XXX XXX", - "first_name": "Elon", - "last_name": "Musk", - "bank_accounts": [ - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "row_type": { + + res = apideck.crm.companies.create(name="SpaceX", service_id="salesforce", owner_id="12345", image="https://www.spacex.com/static/images/share.jpg", description="Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.", vat_number="BE0689615164", currency=apideck_unify.Currency.USD, status="Open", fax="+12129876543", annual_revenue="+$35m", number_of_employees="500-1000", industry="Apparel", ownership="Public", sales_tax_number="12456EN", payee_number="78932EN", abn_or_tfn="46 115 614 695", abn_branch="123", acn="XXX XXX XXX", first_name="Elon", last_name="Musk", bank_accounts=[ + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", "id": "12345", - "name": "Customer Account", + "type": apideck_unify.WebsiteType.PRIMARY, }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], - "tags": [ - "New", - ], - "read_only": False, - "salutation": "Mr", - "birthday": dateutil.parser.parse("2000-08-12").date(), - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], row_type={ + "id": "12345", + "name": "Customer Account", + }, custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], tags=[ + "New", + ], read_only=False, salutation="Mr", birthday=dateutil.parser.parse("2000-08-12").date(), pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `company` | [models.CompanyInput](../../models/companyinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *Nullable[str]* | :heavy_check_mark: | Name of the company | SpaceX | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Owner ID | 12345 | +| `image` | *OptionalNullable[str]* | :heavy_minus_sign: | The Image URL of the company | https://www.spacex.com/static/images/share.jpg | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the company | Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California. | +| `vat_number` | *OptionalNullable[str]* | :heavy_minus_sign: | The VAT number of the company | BE0689615164 | +| `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 | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | The status of the company | Open | +| `fax` | *OptionalNullable[str]* | :heavy_minus_sign: | The fax number of the company | +12129876543 | +| `annual_revenue` | *OptionalNullable[str]* | :heavy_minus_sign: | The annual revenue of the company | +$35m | +| `number_of_employees` | *OptionalNullable[str]* | :heavy_minus_sign: | Number of employees | 500-1000 | +| `industry` | *OptionalNullable[str]* | :heavy_minus_sign: | The industry represents the type of business the company is in. | Apparel | +| `ownership` | *OptionalNullable[str]* | :heavy_minus_sign: | The ownership indicates the type of ownership of the company. | Public | +| `sales_tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A sales tax number is a unique number that identifies a company for tax purposes. | 12456EN | +| `payee_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A payee number is a unique number that identifies a payee for tax purposes. | 78932EN | +| `abn_or_tfn` | *OptionalNullable[str]* | :heavy_minus_sign: | An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. | 46 115 614 695 | +| `abn_branch` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | 123 | +| `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 | | +| `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 | | +| `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 | | +| `row_type` | [Optional[models.CompanyRowType]](../../models/companyrowtype.md) | :heavy_minus_sign: | N/A | | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `read_only` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the company is read-only or not | false | +| `salutation` | *OptionalNullable[str]* | :heavy_minus_sign: | A formal salutation for the person. For example, 'Mr', 'Mrs' | Mr | +| `birthday` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date of birth of the person. | 2000-08-12 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -354,11 +355,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.companies.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -404,210 +405,208 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.companies.update(id="", company={ - "name": "SpaceX", - "owner_id": "12345", - "image": "https://www.spacex.com/static/images/share.jpg", - "description": "Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.", - "vat_number": "BE0689615164", - "currency": apideck_unify.Currency.USD, - "status": "Open", - "fax": "+12129876543", - "annual_revenue": "+$35m", - "number_of_employees": "500-1000", - "industry": "Apparel", - "ownership": "Public", - "sales_tax_number": "12456EN", - "payee_number": "78932EN", - "abn_or_tfn": "46 115 614 695", - "abn_branch": "123", - "acn": "XXX XXX XXX", - "first_name": "Elon", - "last_name": "Musk", - "bank_accounts": [ - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "row_type": { + + res = apideck.crm.companies.update(id="", name="SpaceX", service_id="salesforce", owner_id="12345", image="https://www.spacex.com/static/images/share.jpg", description="Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California.", vat_number="BE0689615164", currency=apideck_unify.Currency.USD, status="Open", fax="+12129876543", annual_revenue="+$35m", number_of_employees="500-1000", industry="Apparel", ownership="Public", sales_tax_number="12456EN", payee_number="78932EN", abn_or_tfn="46 115 614 695", abn_branch="123", acn="XXX XXX XXX", first_name="Elon", last_name="Musk", bank_accounts=[ + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + { + "url": "https://www.twitter.com/apideck", "id": "12345", - "name": "Customer Account", + "type": "twitter", }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - ], - "tags": [ - "New", - ], - "read_only": False, - "salutation": "Mr", - "birthday": dateutil.parser.parse("2000-08-12").date(), - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], row_type={ + "id": "12345", + "name": "Customer Account", + }, custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, + }, + ], tags=[ + "New", + ], read_only=False, salutation="Mr", birthday=dateutil.parser.parse("2000-08-12").date(), pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `company` | [models.CompanyInput](../../models/companyinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `name` | *Nullable[str]* | :heavy_check_mark: | Name of the company | SpaceX | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Owner ID | 12345 | +| `image` | *OptionalNullable[str]* | :heavy_minus_sign: | The Image URL of the company | https://www.spacex.com/static/images/share.jpg | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the company | Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California. | +| `vat_number` | *OptionalNullable[str]* | :heavy_minus_sign: | The VAT number of the company | BE0689615164 | +| `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 | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | The status of the company | Open | +| `fax` | *OptionalNullable[str]* | :heavy_minus_sign: | The fax number of the company | +12129876543 | +| `annual_revenue` | *OptionalNullable[str]* | :heavy_minus_sign: | The annual revenue of the company | +$35m | +| `number_of_employees` | *OptionalNullable[str]* | :heavy_minus_sign: | Number of employees | 500-1000 | +| `industry` | *OptionalNullable[str]* | :heavy_minus_sign: | The industry represents the type of business the company is in. | Apparel | +| `ownership` | *OptionalNullable[str]* | :heavy_minus_sign: | The ownership indicates the type of ownership of the company. | Public | +| `sales_tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A sales tax number is a unique number that identifies a company for tax purposes. | 12456EN | +| `payee_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A payee number is a unique number that identifies a payee for tax purposes. | 78932EN | +| `abn_or_tfn` | *OptionalNullable[str]* | :heavy_minus_sign: | An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. | 46 115 614 695 | +| `abn_branch` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | 123 | +| `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 | | +| `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 | | +| `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 | | +| `row_type` | [Optional[models.CompanyRowType]](../../models/companyrowtype.md) | :heavy_minus_sign: | N/A | | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `read_only` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the company is read-only or not | false | +| `salutation` | *OptionalNullable[str]* | :heavy_minus_sign: | A formal salutation for the person. For example, 'Mr', 'Mrs' | Mr | +| `birthday` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date of birth of the person. | 2000-08-12 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -639,11 +638,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.companies.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/companyinfosdk/README.md b/docs/sdks/companyinfosdk/README.md index 6233c747..c85c00dc 100644 --- a/docs/sdks/companyinfosdk/README.md +++ b/docs/sdks/companyinfosdk/README.md @@ -22,11 +22,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.company_info.get(service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/connectioncustommappings/README.md b/docs/sdks/connectioncustommappings/README.md index efd4797a..cb0be28a 100644 --- a/docs/sdks/connectioncustommappings/README.md +++ b/docs/sdks/connectioncustommappings/README.md @@ -22,11 +22,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.connection_custom_mappings.list(unified_api="crm", service_id="pipedrive", resource="leads", resource_id="1234") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/connections/README.md b/docs/sdks/connections/README.md index 94cf39ec..81914c83 100644 --- a/docs/sdks/connections/README.md +++ b/docs/sdks/connections/README.md @@ -30,11 +30,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.connections.list(api="crm", configured=True) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -76,11 +76,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.connections.get(service_id="pipedrive", unified_api="crm") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -122,198 +122,196 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.vault.connections.update(service_id="pipedrive", unified_api="crm", connection={ - "enabled": True, - "settings": { - "instance_url": "https://eu28.salesforce.com", - "api_key": "12345xxxxxx", + + res = apideck.vault.connections.update(service_id="pipedrive", unified_api="crm", enabled=True, settings={ + "instance_url": "https://eu28.salesforce.com", + "api_key": "12345xxxxxx", + }, metadata={ + "account": { + "name": "My Company", + "id": "c01458a5-7276-41ce-bc19-639906b0450a", }, - "metadata": { - "account": { - "name": "My Company", - "id": "c01458a5-7276-41ce-bc19-639906b0450a", - }, - "plan": "enterprise", + "plan": "enterprise", + }, configuration=[ + { + "resource": "leads", + "defaults": [ + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": 12.5, + }, + { + "label": "General Channel", + "value": [ + "team", + "general", + ], + }, + ], + }, + ], + "value": "GC5000 series", + }, + { + "id": "ProductInterest", + "options": [ + { + "label": "General Channel", + "value": 123, + }, + { + "label": "General Channel", + "value": "general", + }, + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": 123, + }, + { + "label": "General Channel", + "value": 12.5, + }, + { + "label": "General Channel", + "value": True, + }, + ], + }, + ], + "value": True, + }, + ], }, - "configuration": [ - { - "resource": "leads", - "defaults": [ - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": 12.5, - }, - { - "label": "General Channel", - "value": [ - "team", - "general", - ], - }, - ], - }, - ], - "value": "GC5000 series", - }, - { - "id": "ProductInterest", - "options": [ - { - "label": "General Channel", - "value": 123, - }, - { - "label": "General Channel", - "value": "general", - }, - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": 123, - }, - { - "label": "General Channel", - "value": 12.5, - }, - { - "label": "General Channel", - "value": True, - }, - ], - }, - ], - "value": True, - }, - ], - }, - { - "resource": "leads", - "defaults": [ - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": 12.5, - }, - ], - }, - ], - "value": True, - }, - ], - }, - { - "resource": "leads", - "defaults": [ - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": 123, - }, - ], - }, - ], - "value": 10, - }, - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": [ - "team", - "general", - ], - }, - { - "label": "General Channel", - "value": True, - }, - { - "label": "General Channel", - "value": 12.5, - }, - ], - }, - ], - "value": 10, - }, - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": [ - "team", - "general", - ], - }, - { - "label": "General Channel", - "value": "general", - }, - ], - }, - { - "label": "General Channel", - "value": 123, - }, - ], - "value": True, - }, - ], - }, - ], - "custom_mappings": [ - { - "value": "$.root.training.first_aid", - }, - ], - }) + { + "resource": "leads", + "defaults": [ + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": 12.5, + }, + ], + }, + ], + "value": True, + }, + ], + }, + { + "resource": "leads", + "defaults": [ + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": 123, + }, + ], + }, + ], + "value": 10, + }, + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": [ + "team", + "general", + ], + }, + { + "label": "General Channel", + "value": True, + }, + { + "label": "General Channel", + "value": 12.5, + }, + ], + }, + ], + "value": 10, + }, + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": [ + "team", + "general", + ], + }, + { + "label": "General Channel", + "value": "general", + }, + ], + }, + { + "label": "General Channel", + "value": 123, + }, + ], + "value": True, + }, + ], + }, + ], custom_mappings=[ + { + "value": "$.root.training.first_aid", + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `service_id` | *str* | :heavy_check_mark: | Service ID of the resource to return | pipedrive | -| `unified_api` | *str* | :heavy_check_mark: | Unified API | crm | -| `connection` | [models.ConnectionInput](../../models/connectioninput.md) | :heavy_check_mark: | Fields that need to be updated on the resource | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `service_id` | *str* | :heavy_check_mark: | Service ID of the resource to return | pipedrive | +| `unified_api` | *str* | :heavy_check_mark: | Unified API | crm | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. | true | +| `settings` | Dict[str, *Any*] | :heavy_minus_sign: | Connection settings. Values will persist to `form_fields` with corresponding id | {
"instance_url": "https://eu28.salesforce.com",
"api_key": "12345xxxxxx"
} | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Attach your own consumer specific metadata | {
"account": {
"name": "My Company",
"id": "c01458a5-7276-41ce-bc19-639906b0450a"
},
"plan": "enterprise"
} | +| `configuration` | List[[models.ConnectionConfiguration](../../models/connectionconfiguration.md)] | :heavy_minus_sign: | N/A | | +| `custom_mappings` | List[[models.CustomMappingInput](../../models/custommappinginput.md)] | :heavy_minus_sign: | List of custom mappings configured for this connection | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -345,11 +343,13 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.connections.delete(service_id="pipedrive", unified_api="crm") - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -392,34 +392,33 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.vault.connections.imports(service_id="pipedrive", unified_api="crm", connection_import_data={ - "credentials": { - "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.cThIIoDvwdueQB468K5xDc5633seEFoqwxjF_xSJyQQ", - "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", - }, - "metadata": { - "account": { - "name": "My Company", - "id": "c01458a5-7276-41ce-bc19-639906b0450a", - }, - "plan": "enterprise", + + res = apideck.vault.connections.imports(service_id="pipedrive", unified_api="crm", credentials={ + "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.cThIIoDvwdueQB468K5xDc5633seEFoqwxjF_xSJyQQ", + "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c", + }, settings={}, metadata={ + "account": { + "name": "My Company", + "id": "c01458a5-7276-41ce-bc19-639906b0450a", }, + "plan": "enterprise", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `service_id` | *str* | :heavy_check_mark: | Service ID of the resource to return | pipedrive | -| `unified_api` | *str* | :heavy_check_mark: | Unified API | crm | -| `connection_import_data` | [models.ConnectionImportData](../../models/connectionimportdata.md) | :heavy_check_mark: | Fields that need to be persisted on the resource | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `service_id` | *str* | :heavy_check_mark: | Service ID of the resource to return | pipedrive | +| `unified_api` | *str* | :heavy_check_mark: | Unified API | crm | +| `credentials` | [Optional[models.Credentials]](../../models/credentials.md) | :heavy_minus_sign: | N/A | {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.cThIIoDvwdueQB468K5xDc5633seEFoqwxjF_xSJyQQ"
} | +| `settings` | [OptionalNullable[models.ConnectionImportDataSettings]](../../models/connectionimportdatasettings.md) | :heavy_minus_sign: | Connection settings. Values will persist to `form_fields` with corresponding id | {
"instance_url": "https://eu28.salesforce.com"
} | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Attach your own consumer specific metadata | {
"account": {
"name": "My Company",
"id": "c01458a5-7276-41ce-bc19-639906b0450a"
},
"plan": "enterprise"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -457,11 +456,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.connections.token(service_id="pipedrive", unified_api="crm") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/connectionsettings/README.md b/docs/sdks/connectionsettings/README.md index bf45d12f..9edb5bd5 100644 --- a/docs/sdks/connectionsettings/README.md +++ b/docs/sdks/connectionsettings/README.md @@ -24,11 +24,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.connection_settings.list(unified_api="crm", service_id="pipedrive", resource="leads") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -71,199 +71,197 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.vault.connection_settings.update(service_id="pipedrive", unified_api="crm", resource="leads", connection={ - "enabled": True, - "settings": { - "instance_url": "https://eu28.salesforce.com", - "api_key": "12345xxxxxx", + + res = apideck.vault.connection_settings.update(service_id="pipedrive", unified_api="crm", resource="leads", enabled=True, settings={ + "instance_url": "https://eu28.salesforce.com", + "api_key": "12345xxxxxx", + }, metadata={ + "account": { + "name": "My Company", + "id": "c01458a5-7276-41ce-bc19-639906b0450a", + }, + "plan": "enterprise", + }, configuration=[ + { + "resource": "leads", + "defaults": [ + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": 12.5, + }, + { + "label": "General Channel", + "value": [ + "team", + "general", + ], + }, + ], + }, + ], + "value": "GC5000 series", + }, + { + "id": "ProductInterest", + "options": [ + { + "label": "General Channel", + "value": 123, + }, + { + "label": "General Channel", + "value": "general", + }, + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": 123, + }, + { + "label": "General Channel", + "value": 12.5, + }, + { + "label": "General Channel", + "value": True, + }, + ], + }, + ], + "value": True, + }, + ], }, - "metadata": { - "account": { - "name": "My Company", - "id": "c01458a5-7276-41ce-bc19-639906b0450a", - }, - "plan": "enterprise", + { + "resource": "leads", + "defaults": [ + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": 12.5, + }, + ], + }, + ], + "value": True, + }, + ], }, - "configuration": [ - { - "resource": "leads", - "defaults": [ - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": 12.5, - }, - { - "label": "General Channel", - "value": [ - "team", - "general", - ], - }, - ], - }, - ], - "value": "GC5000 series", - }, - { - "id": "ProductInterest", - "options": [ - { - "label": "General Channel", - "value": 123, - }, - { - "label": "General Channel", - "value": "general", - }, - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": 123, - }, - { - "label": "General Channel", - "value": 12.5, - }, - { - "label": "General Channel", - "value": True, - }, - ], - }, - ], - "value": True, - }, - ], - }, - { - "resource": "leads", - "defaults": [ - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": 12.5, - }, - ], - }, - ], - "value": True, - }, - ], - }, - { - "resource": "leads", - "defaults": [ - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": 123, - }, - ], - }, - ], - "value": 10, - }, - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": [ - "team", - "general", - ], - }, - { - "label": "General Channel", - "value": True, - }, - { - "label": "General Channel", - "value": 12.5, - }, - ], - }, - ], - "value": 10, - }, - { - "id": "ProductInterest", - "options": [ - { - "id": "1234", - "label": "General Channel", - "options": [ - { - "label": "General Channel", - "value": [ - "team", - "general", - ], - }, - { - "label": "General Channel", - "value": "general", - }, - ], - }, - { - "label": "General Channel", - "value": 123, - }, - ], - "value": True, - }, - ], - }, - ], - "custom_mappings": [ - { - "value": "$.root.training.first_aid", - }, - ], - }) - - if res is not None: - # handle response - pass + { + "resource": "leads", + "defaults": [ + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": 123, + }, + ], + }, + ], + "value": 10, + }, + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": [ + "team", + "general", + ], + }, + { + "label": "General Channel", + "value": True, + }, + { + "label": "General Channel", + "value": 12.5, + }, + ], + }, + ], + "value": 10, + }, + { + "id": "ProductInterest", + "options": [ + { + "id": "1234", + "label": "General Channel", + "options": [ + { + "label": "General Channel", + "value": [ + "team", + "general", + ], + }, + { + "label": "General Channel", + "value": "general", + }, + ], + }, + { + "label": "General Channel", + "value": 123, + }, + ], + "value": True, + }, + ], + }, + ], custom_mappings=[ + { + "value": "$.root.training.first_aid", + }, + ]) + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `service_id` | *str* | :heavy_check_mark: | Service ID of the resource to return | pipedrive | -| `unified_api` | *str* | :heavy_check_mark: | Unified API | crm | -| `resource` | *str* | :heavy_check_mark: | Name of the resource (plural) | leads | -| `connection` | [models.ConnectionInput](../../models/connectioninput.md) | :heavy_check_mark: | Fields that need to be updated on the resource | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `service_id` | *str* | :heavy_check_mark: | Service ID of the resource to return | pipedrive | +| `unified_api` | *str* | :heavy_check_mark: | Unified API | crm | +| `resource` | *str* | :heavy_check_mark: | Name of the resource (plural) | leads | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. | true | +| `settings` | Dict[str, *Any*] | :heavy_minus_sign: | Connection settings. Values will persist to `form_fields` with corresponding id | {
"instance_url": "https://eu28.salesforce.com",
"api_key": "12345xxxxxx"
} | +| `metadata` | Dict[str, *Any*] | :heavy_minus_sign: | Attach your own consumer specific metadata | {
"account": {
"name": "My Company",
"id": "c01458a5-7276-41ce-bc19-639906b0450a"
},
"plan": "enterprise"
} | +| `configuration` | List[[models.ConnectionConfiguration](../../models/connectionconfiguration.md)] | :heavy_minus_sign: | N/A | | +| `custom_mappings` | List[[models.CustomMappingInput](../../models/custommappinginput.md)] | :heavy_minus_sign: | List of custom mappings configured for this connection | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/connectordocs/README.md b/docs/sdks/connectordocs/README.md index 0f5229fb..efef0043 100644 --- a/docs/sdks/connectordocs/README.md +++ b/docs/sdks/connectordocs/README.md @@ -22,11 +22,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.connector.connector_docs.get(id="", doc_id="application_owner+oauth_credentials") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/connectorresources/README.md b/docs/sdks/connectorresources/README.md index e4c71d82..ca1efd21 100644 --- a/docs/sdks/connectorresources/README.md +++ b/docs/sdks/connectorresources/README.md @@ -23,11 +23,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.connector.connector_resources.get(id="", resource_id="", unified_api=apideck_unify.UnifiedAPIID.CRM) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/connectors/README.md b/docs/sdks/connectors/README.md index af7cdde5..c4a09c50 100644 --- a/docs/sdks/connectors/README.md +++ b/docs/sdks/connectors/README.md @@ -24,13 +24,15 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.connector.connectors.list(filter_={ "unified_api": apideck_unify.UnifiedAPIID.FILE_STORAGE, }) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` @@ -71,11 +73,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.connector.connectors.get(id="") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/consumerrequestcounts/README.md b/docs/sdks/consumerrequestcounts/README.md index b0bafcd3..fcb8c8a0 100644 --- a/docs/sdks/consumerrequestcounts/README.md +++ b/docs/sdks/consumerrequestcounts/README.md @@ -23,11 +23,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.consumer_request_counts.list(consumer_id="test_user_id", start_datetime="2021-05-01T12:00:00.000Z", end_datetime="2021-05-30T12:00:00.000Z") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/consumers/README.md b/docs/sdks/consumers/README.md index f880d38e..137e6778 100644 --- a/docs/sdks/consumers/README.md +++ b/docs/sdks/consumers/README.md @@ -26,28 +26,26 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.vault.consumers.create(request={ - "consumer_id": "test_consumer_id", - "metadata": { - "account_name": "SpaceX", - "user_name": "Elon Musk", - "email": "elon@musk.com", - "image": "https://www.spacex.com/static/images/share.jpg", - }, + + res = apideck.vault.consumers.create(consumer_id="test_consumer_id", metadata={ + "account_name": "SpaceX", + "user_name": "Elon Musk", + "email": "elon@musk.com", + "image": "https://www.spacex.com/static/images/share.jpg", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `request` | [models.ConsumerInput](../../models/consumerinput.md) | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `consumer_id` | *str* | :heavy_check_mark: | 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. | test_consumer_id | +| `metadata` | [Optional[models.ConsumerMetadata]](../../models/consumermetadata.md) | :heavy_minus_sign: | The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -80,11 +78,13 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.consumers.list() - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` @@ -127,11 +127,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.consumers.get(consumer_id="test_user_id") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -172,28 +172,26 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.vault.consumers.update(consumer_id="test_user_id", update_consumer_request={ - "metadata": { - "account_name": "SpaceX", - "user_name": "Elon Musk", - "email": "elon@musk.com", - "image": "https://www.spacex.com/static/images/share.jpg", - }, + + res = apideck.vault.consumers.update(consumer_id="test_user_id", metadata={ + "account_name": "SpaceX", + "user_name": "Elon Musk", + "email": "elon@musk.com", + "image": "https://www.spacex.com/static/images/share.jpg", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `consumer_id` | *str* | :heavy_check_mark: | ID of the consumer to return | test_user_id | -| `update_consumer_request` | [models.UpdateConsumerRequest](../../models/updateconsumerrequest.md) | :heavy_check_mark: | N/A | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `consumer_id` | *str* | :heavy_check_mark: | ID of the consumer to return | test_user_id | +| `metadata` | [Optional[models.ConsumerMetadata]](../../models/consumermetadata.md) | :heavy_minus_sign: | The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -225,11 +223,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.consumers.delete(consumer_id="test_user_id") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/contacts/README.md b/docs/sdks/contacts/README.md index d119fcf5..d472dc86 100644 --- a/docs/sdks/contacts/README.md +++ b/docs/sdks/contacts/README.md @@ -27,37 +27,40 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.contacts.list(request={ - "service_id": "salesforce", - "filter_": { - "first_name": "Elon", - "last_name": "Musk", - "email": "elon@tesla.com", - "company_id": "12345", - "owner_id": "12345", - }, - "sort": { - "by": apideck_unify.ContactsSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.crm.contacts.list(service_id="salesforce", filter_={ + "first_name": "Elon", + "last_name": "Musk", + "email": "elon@tesla.com", + "company_id": "12345", + "owner_id": "12345", + }, sort={ + "by": apideck_unify.ContactsSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `request` | [models.CrmContactsAllRequest](../../models/crmcontactsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.ContactsFilter]](../../models/contactsfilter.md) | :heavy_minus_sign: | Apply filters | {
"first_name": "Elon",
"last_name": "Musk",
"email": "elon@tesla.com",
"company_id": "12345",
"owner_id": "12345"
} | +| `sort` | [Optional[models.ContactsSort]](../../models/contactssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -90,239 +93,238 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.contacts.create(contact={ - "name": "Elon Musk", - "owner_id": "54321", - "type": apideck_unify.ContactType.PERSONAL, - "company_id": "23456", - "company_name": "23456", - "lead_id": "34567", - "first_name": "Elon", - "middle_name": "D.", - "last_name": "Musk", - "prefix": "Mr.", - "suffix": "PhD", - "title": "CEO", - "department": "Engineering", - "language": "EN", - "gender": apideck_unify.ContactGender.FEMALE, - "birthday": "2000-08-12", - "photo_url": "https://unavatar.io/elon-musk", - "lead_source": "Cold Call", - "fax": "+12129876543", - "description": "Internal champion", - "current_balance": 10.5, - "status": "open", - "active": True, - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "email_domain": "gmail.com", - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": {}, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], - "tags": [ - "New", - ], - "opportunity_ids": [ - "12345", - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.contacts.create(name="Elon Musk", service_id="salesforce", owner_id="54321", type_=apideck_unify.ContactType.PERSONAL, company_id="23456", company_name="23456", lead_id="34567", first_name="Elon", middle_name="D.", last_name="Musk", prefix="Mr.", suffix="PhD", title="CEO", department="Engineering", language="EN", gender=apideck_unify.ContactGender.FEMALE, birthday="2000-08-12", photo_url="https://unavatar.io/elon-musk", lead_source="Cold Call", fax="+12129876543", description="Internal champion", current_balance=10.5, status="open", active=True, websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], email_domain="gmail.com", custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": {}, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], tags=[ + "New", + ], opportunity_ids=[ + "12345", + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `contact` | [models.ContactInput](../../models/contactinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *Nullable[str]* | :heavy_check_mark: | Full name of the contact. | Elon Musk | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The owner of the contact. | 54321 | +| `type` | [OptionalNullable[models.ContactType]](../../models/contacttype.md) | :heavy_minus_sign: | The type of the contact. | personal | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company the contact is associated with. | 23456 | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company the contact is associated with. | 23456 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The lead the contact is associated with. | 34567 | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the contact. | Elon | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The middle name of the contact. | D. | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the contact. | Musk | +| `prefix` | *OptionalNullable[str]* | :heavy_minus_sign: | The prefix of the contact. | Mr. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | The suffix of the contact. | PhD | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the contact. | CEO | +| `department` | *OptionalNullable[str]* | :heavy_minus_sign: | The department of the contact. | Engineering | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `gender` | [OptionalNullable[models.ContactGender]](../../models/contactgender.md) | :heavy_minus_sign: | The gender of the contact. | female | +| `birthday` | *OptionalNullable[str]* | :heavy_minus_sign: | The birthday of the contact. | 2000-08-12 | +| `image` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | https://unavatar.io/elon-musk | +| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the photo of a person. | https://unavatar.io/elon-musk | +| `lead_source` | *OptionalNullable[str]* | :heavy_minus_sign: | The lead source of the contact. | Cold Call | +| `fax` | *OptionalNullable[str]* | :heavy_minus_sign: | The fax number of the contact. | +12129876543 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the contact. | Internal champion | +| `current_balance` | *OptionalNullable[float]* | :heavy_minus_sign: | The current balance of the contact. | 10.5 | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | The status of the contact. | open | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | The active status of the contact. | true | +| `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 | | +| `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 | | +| `email_domain` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | gmail.com | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `opportunity_ids` | List[*str*] | :heavy_minus_sign: | The opportunity ids of the contact. | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -354,31 +356,30 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.contacts.get(request={ - "id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - "filter_": { - "first_name": "Elon", - "last_name": "Musk", - "email": "elon@tesla.com", - "company_id": "12345", - "owner_id": "12345", - }, + + res = apideck.crm.contacts.get(id="", service_id="salesforce", fields="id,updated_at", filter_={ + "first_name": "Elon", + "last_name": "Musk", + "email": "elon@tesla.com", + "company_id": "12345", + "owner_id": "12345", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `request` | [models.CrmContactsOneRequest](../../models/crmcontactsonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter_` | [Optional[models.ContactsFilter]](../../models/contactsfilter.md) | :heavy_minus_sign: | Apply filters | {
"first_name": "Elon",
"last_name": "Musk",
"email": "elon@tesla.com",
"company_id": "12345",
"owner_id": "12345"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -411,219 +412,218 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.contacts.update(id="", contact={ - "name": "Elon Musk", - "owner_id": "54321", - "type": apideck_unify.ContactType.PERSONAL, - "company_id": "23456", - "company_name": "23456", - "lead_id": "34567", - "first_name": "Elon", - "middle_name": "D.", - "last_name": "Musk", - "prefix": "Mr.", - "suffix": "PhD", - "title": "CEO", - "department": "Engineering", - "language": "EN", - "gender": apideck_unify.ContactGender.FEMALE, - "birthday": "2000-08-12", - "photo_url": "https://unavatar.io/elon-musk", - "lead_source": "Cold Call", - "fax": "+12129876543", - "description": "Internal champion", - "current_balance": 10.5, - "status": "open", - "active": True, - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "email_domain": "gmail.com", - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": {}, - }, - ], - "tags": [ - "New", - ], - "opportunity_ids": [ - "12345", - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.contacts.update(id="", name="Elon Musk", service_id="salesforce", owner_id="54321", type_=apideck_unify.ContactType.PERSONAL, company_id="23456", company_name="23456", lead_id="34567", first_name="Elon", middle_name="D.", last_name="Musk", prefix="Mr.", suffix="PhD", title="CEO", department="Engineering", language="EN", gender=apideck_unify.ContactGender.FEMALE, birthday="2000-08-12", photo_url="https://unavatar.io/elon-musk", lead_source="Cold Call", fax="+12129876543", description="Internal champion", current_balance=10.5, status="open", active=True, websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], email_domain="gmail.com", custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": {}, + }, + ], tags=[ + "New", + ], opportunity_ids=[ + "12345", + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `contact` | [models.ContactInput](../../models/contactinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `name` | *Nullable[str]* | :heavy_check_mark: | Full name of the contact. | Elon Musk | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The owner of the contact. | 54321 | +| `type` | [OptionalNullable[models.ContactType]](../../models/contacttype.md) | :heavy_minus_sign: | The type of the contact. | personal | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company the contact is associated with. | 23456 | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company the contact is associated with. | 23456 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The lead the contact is associated with. | 34567 | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the contact. | Elon | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The middle name of the contact. | D. | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the contact. | Musk | +| `prefix` | *OptionalNullable[str]* | :heavy_minus_sign: | The prefix of the contact. | Mr. | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | The suffix of the contact. | PhD | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the contact. | CEO | +| `department` | *OptionalNullable[str]* | :heavy_minus_sign: | The department of the contact. | Engineering | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `gender` | [OptionalNullable[models.ContactGender]](../../models/contactgender.md) | :heavy_minus_sign: | The gender of the contact. | female | +| `birthday` | *OptionalNullable[str]* | :heavy_minus_sign: | The birthday of the contact. | 2000-08-12 | +| `image` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | https://unavatar.io/elon-musk | +| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the photo of a person. | https://unavatar.io/elon-musk | +| `lead_source` | *OptionalNullable[str]* | :heavy_minus_sign: | The lead source of the contact. | Cold Call | +| `fax` | *OptionalNullable[str]* | :heavy_minus_sign: | The fax number of the contact. | +12129876543 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the contact. | Internal champion | +| `current_balance` | *OptionalNullable[float]* | :heavy_minus_sign: | The current balance of the contact. | 10.5 | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | The status of the contact. | open | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | The active status of the contact. | true | +| `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 | | +| `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 | | +| `email_domain` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | gmail.com | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `opportunity_ids` | List[*str*] | :heavy_minus_sign: | The opportunity ids of the contact. | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -655,11 +655,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.contacts.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/createcallback/README.md b/docs/sdks/createcallback/README.md index ba190639..844b0fac 100644 --- a/docs/sdks/createcallback/README.md +++ b/docs/sdks/createcallback/README.md @@ -23,13 +23,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.vault.create_callback.state(service_id="pipedrive", unified_api="crm", create_callback_state={ - "redirect_uri": "https://example.com/callback", - }) - if res is not None: - # handle response - pass + res = apideck.vault.create_callback.state(service_id="pipedrive", unified_api="crm", redirect_uri="https://example.com/callback") + + # Handle response + print(res) ``` @@ -39,7 +37,7 @@ with Apideck( | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `service_id` | *str* | :heavy_check_mark: | Service ID of the resource to return | pipedrive | | `unified_api` | *str* | :heavy_check_mark: | Unified API | crm | -| `create_callback_state` | [models.CreateCallbackState](../../models/createcallbackstate.md) | :heavy_check_mark: | Callback state data | | +| `redirect_uri` | *Optional[str]* | :heavy_minus_sign: | The redirect URI to be used after the connection is created. | https://example.com/callback | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/creditnotes/README.md b/docs/sdks/creditnotes/README.md index da62c94f..40450c50 100644 --- a/docs/sdks/creditnotes/README.md +++ b/docs/sdks/creditnotes/README.md @@ -28,33 +28,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.credit_notes.list(request={ - "service_id": "salesforce", - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.CreditNotesSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.credit_notes.list(service_id="salesforce", filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.CreditNotesSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `request` | [models.AccountingCreditNotesAllRequest](../../models/accountingcreditnotesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.CreditNotesFilter]](../../models/creditnotesfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.CreditNotesSort]](../../models/creditnotessort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -88,278 +91,276 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.credit_notes.create(credit_note={ - "total_amount": 49.99, - "number": "OIT00546", - "customer": { + + res = apideck.accounting.credit_notes.create(total_amount=49.99, service_id="salesforce", number="OIT00546", customer={ + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, company_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, sub_total=27500, total_tax=2500, tax_code="1234", balance=27500, remaining_credit=27500, status=apideck_unify.CreditNoteStatus.AUTHORISED, reference="123456", date_issued=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), date_paid=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), type_=apideck_unify.CreditNoteType.ACCOUNTS_RECEIVABLE_CREDIT, account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, line_items=[ + { "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", - }, - "company_id": "12345", - "currency": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "tax_inclusive": True, - "sub_total": 27500, - "total_tax": 2500, - "tax_code": "1234", - "balance": 27500, - "remaining_credit": 27500, - "status": apideck_unify.CreditNoteStatus.AUTHORISED, - "reference": "123456", - "date_issued": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "date_paid": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "type": apideck_unify.CreditNoteType.ACCOUNTS_RECEIVABLE_CREDIT, - "account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", - }, - "line_items": [ - { - "id": "12345", - "row_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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { "id": "123456", - "rate": 10, + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], - "row_version": "1-12345", - }, - ], - "allocations": [ - { + ], + "ledger_account": { "id": "123456", - "amount": 49.99, - "allocation_id": "123456", + "nominal_code": "N091", + "code": "453", }, - ], - "note": "Some notes about this credit note", - "terms": "Some terms about this credit note", - "billing_address": { - "id": "123", - "type": apideck_unify.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.", + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], "row_version": "1-12345", }, - "shipping_address": { - "id": "123", - "type": apideck_unify.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", + ], allocations=[ + { + "id": "123456", + "amount": 49.99, + "allocation_id": "123456", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], + ], note="Some notes about this credit note", terms="Some terms about this credit note", billing_address={ + "id": "123", + "type": apideck_unify.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": apideck_unify.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", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, tracking_categories=[ + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, + }, + { + "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", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `credit_note` | [models.CreditNoteInput](../../models/creditnoteinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `total_amount` | *float* | :heavy_check_mark: | Amount of transaction | 49.99 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Credit note number. | OIT00546 | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `tax_inclusive` | *OptionalNullable[bool]* | :heavy_minus_sign: | Amounts are including tax | true | +| `sub_total` | *OptionalNullable[float]* | :heavy_minus_sign: | Sub-total amount, normally before tax. | 27500 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this invoice. | 2500 | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `balance` | *OptionalNullable[float]* | :heavy_minus_sign: | The balance reflecting any payments made against the transaction. | 27500 | +| `remaining_credit` | *OptionalNullable[float]* | :heavy_minus_sign: | Indicates the total credit amount still available to apply towards the payment. | 27500 | +| `status` | [Optional[models.CreditNoteStatus]](../../models/creditnotestatus.md) | :heavy_minus_sign: | Status of credit notes | authorised | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message ie: Debit remittance detail. | 123456 | +| `date_issued` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `date_paid` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `type` | [Optional[models.CreditNoteType]](../../models/creditnotetype.md) | :heavy_minus_sign: | Type of payment | accounts_receivable_credit | +| `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `line_items` | List[[models.InvoiceLineItemInput](../../models/invoicelineiteminput.md)] | :heavy_minus_sign: | N/A | | +| `allocations` | List[[models.AllocationInput](../../models/allocationinput.md)] | :heavy_minus_sign: | N/A | | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note to be associated with the credit note. | Some notes about this credit note | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional terms to be associated with the credit note. | Some terms about this credit note | +| `billing_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `shipping_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -391,11 +392,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.credit_notes.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -441,349 +442,347 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.credit_notes.update(id="", credit_note={ - "total_amount": 49.99, - "number": "OIT00546", - "customer": { + + res = apideck.accounting.credit_notes.update(id="", total_amount=49.99, service_id="salesforce", number="OIT00546", customer={ + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, company_id="12345", currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, sub_total=27500, total_tax=2500, tax_code="1234", balance=27500, remaining_credit=27500, status=apideck_unify.CreditNoteStatus.AUTHORISED, reference="123456", date_issued=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), date_paid=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), type_=apideck_unify.CreditNoteType.ACCOUNTS_RECEIVABLE_CREDIT, account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, line_items=[ + { "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", - }, - "company_id": "12345", - "currency": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "tax_inclusive": True, - "sub_total": 27500, - "total_tax": 2500, - "tax_code": "1234", - "balance": 27500, - "remaining_credit": 27500, - "status": apideck_unify.CreditNoteStatus.AUTHORISED, - "reference": "123456", - "date_issued": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "date_paid": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "type": apideck_unify.CreditNoteType.ACCOUNTS_RECEIVABLE_CREDIT, - "account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", - }, - "line_items": [ - { - "id": "12345", - "row_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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { "id": "123456", - "rate": 10, + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "row_version": "1-12345", + ], + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", }, - { - "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { - "id": "123456", - "rate": 10, + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { + ], + "row_version": "1-12345", + }, + { + "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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - ], - "row_version": "1-12345", + ], + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", }, - { - "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", }, - "tax_rate": { - "id": "123456", - "rate": 10, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": [ - {}, - ], - }, - ], - "row_version": "1-12345", - }, - ], - "allocations": [ - { - "id": "123456", - "amount": 49.99, - "allocation_id": "123456", + ], + "row_version": "1-12345", + }, + { + "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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", }, - { + "tax_rate": { "id": "123456", - "amount": 49.99, - "allocation_id": "123456", + "rate": 10, }, - { + "tracking_categories": [ + { + "id": "123456", + "name": "New York", + }, + ], + "ledger_account": { "id": "123456", - "amount": 49.99, - "allocation_id": "123456", + "nominal_code": "N091", + "code": "453", }, - ], - "note": "Some notes about this credit note", - "terms": "Some terms about this credit note", - "billing_address": { - "id": "123", - "type": apideck_unify.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.", + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": [ + {}, + ], + }, + ], "row_version": "1-12345", }, - "shipping_address": { - "id": "123", - "type": apideck_unify.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", + ], allocations=[ + { + "id": "123456", + "amount": 49.99, + "allocation_id": "123456", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - ], + { + "id": "123456", + "amount": 49.99, + "allocation_id": "123456", + }, + { + "id": "123456", + "amount": 49.99, + "allocation_id": "123456", + }, + ], note="Some notes about this credit note", terms="Some terms about this credit note", billing_address={ + "id": "123", + "type": apideck_unify.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": apideck_unify.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", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, tracking_categories=[ + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `credit_note` | [models.CreditNoteInput](../../models/creditnoteinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `total_amount` | *float* | :heavy_check_mark: | Amount of transaction | 49.99 | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Credit note number. | OIT00546 | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `tax_inclusive` | *OptionalNullable[bool]* | :heavy_minus_sign: | Amounts are including tax | true | +| `sub_total` | *OptionalNullable[float]* | :heavy_minus_sign: | Sub-total amount, normally before tax. | 27500 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this invoice. | 2500 | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `balance` | *OptionalNullable[float]* | :heavy_minus_sign: | The balance reflecting any payments made against the transaction. | 27500 | +| `remaining_credit` | *OptionalNullable[float]* | :heavy_minus_sign: | Indicates the total credit amount still available to apply towards the payment. | 27500 | +| `status` | [Optional[models.CreditNoteStatus]](../../models/creditnotestatus.md) | :heavy_minus_sign: | Status of credit notes | authorised | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message ie: Debit remittance detail. | 123456 | +| `date_issued` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `date_paid` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `type` | [Optional[models.CreditNoteType]](../../models/creditnotetype.md) | :heavy_minus_sign: | Type of payment | accounts_receivable_credit | +| `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `line_items` | List[[models.InvoiceLineItemInput](../../models/invoicelineiteminput.md)] | :heavy_minus_sign: | N/A | | +| `allocations` | List[[models.AllocationInput](../../models/allocationinput.md)] | :heavy_minus_sign: | N/A | | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note to be associated with the credit note. | Some notes about this credit note | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional terms to be associated with the credit note. | Some terms about this credit note | +| `billing_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `shipping_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -815,11 +814,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.credit_notes.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/customers/README.md b/docs/sdks/customers/README.md index d7dd7009..ed37ac29 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -28,39 +28,42 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.customers.list(request={ - "service_id": "salesforce", - "filter_": { - "company_name": "SpaceX", - "display_name": "Elon Musk", - "first_name": "Elon", - "last_name": "Musk", - "email": "elon@musk.com", - "status": apideck_unify.CustomersFilterStatus.ACTIVE, - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.CustomersSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.customers.list(service_id="salesforce", filter_={ + "company_name": "SpaceX", + "display_name": "Elon Musk", + "first_name": "Elon", + "last_name": "Musk", + "email": "elon@musk.com", + "status": apideck_unify.CustomersFilterStatus.ACTIVE, + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.CustomersSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `request` | [models.AccountingCustomersAllRequest](../../models/accountingcustomersallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.CustomersFilter]](../../models/customersfilter.md) | :heavy_minus_sign: | Apply filters | {
"company_name": "SpaceX",
"display_name": "Elon Musk",
"first_name": "Elon",
"last_name": "Musk",
"email": "elon@musk.com",
"status": "active",
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.CustomersSort]](../../models/customerssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -93,186 +96,184 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.customers.create(customer={ - "display_id": "EMP00101", - "display_name": "Windsurf Shop", - "company_name": "SpaceX", - "company_id": "12345", - "title": "CEO", - "first_name": "Elon", - "middle_name": "D.", - "last_name": "Musk", - "suffix": "Jr.", - "individual": True, - "project": False, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "bank_accounts": [ - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - ], - "notes": "Some notes about this customer", - "tax_rate": { - "id": "123456", - "rate": 10, + + res = apideck.accounting.customers.create(service_id="salesforce", display_id="EMP00101", display_name="Windsurf Shop", company_name="SpaceX", company_id="12345", title="CEO", first_name="Elon", middle_name="D.", last_name="Musk", suffix="Jr.", individual=True, project=False, addresses=[ + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, }, - "tax_number": "US123945459", - "currency": apideck_unify.Currency.USD, - "account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, }, - "parent": { + ], websites=[ + { + "url": "http://example.com", "id": "12345", - "name": "Windsurf Shop", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], bank_accounts=[ + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, }, - "status": apideck_unify.CustomerStatusStatus.ACTIVE, - "payment_method": "cash", - "channel": "email", - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], notes="Some notes about this customer", tax_rate={ + "id": "123456", + "rate": 10, + }, tax_number="US123945459", currency=apideck_unify.Currency.USD, account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, parent={ + "id": "12345", + "name": "Windsurf Shop", + }, status=apideck_unify.CustomerStatusStatus.ACTIVE, payment_method="cash", channel="email", row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `customer` | [models.CustomerInput](../../models/customerinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `display_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Display ID | EMP00101 | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Display name | Windsurf Shop | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the person. | Elon | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Middle name of the person. | D. | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the person. | Musk | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Jr. | +| `individual` | *OptionalNullable[bool]* | :heavy_minus_sign: | Is this an individual or business customer | true | +| `project` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, indicates this is a Project. | false | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `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 | | +| `websites` | List[[models.Website](../../models/website.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount](../../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `notes` | *OptionalNullable[str]* | :heavy_minus_sign: | Some notes about this customer | Some notes about this customer | +| `tax_rate` | [Optional[models.LinkedTaxRateInput]](../../models/linkedtaxrateinput.md) | :heavy_minus_sign: | N/A | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | US123945459 | +| `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 | +| `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `parent` | [OptionalNullable[models.LinkedParentCustomer]](../../models/linkedparentcustomer.md) | :heavy_minus_sign: | The parent customer this entity is linked to. | | +| `status` | [OptionalNullable[models.CustomerStatusStatus]](../../models/customerstatusstatus.md) | :heavy_minus_sign: | Customer 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 | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -304,11 +305,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.customers.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -353,236 +354,234 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.customers.update(id="", customer={ - "display_id": "EMP00101", - "display_name": "Windsurf Shop", - "company_name": "SpaceX", - "company_id": "12345", - "title": "CEO", - "first_name": "Elon", - "middle_name": "D.", - "last_name": "Musk", - "suffix": "Jr.", - "individual": True, - "project": False, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "bank_accounts": [ - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - ], - "notes": "Some notes about this customer", - "tax_rate": { - "id": "123456", - "rate": 10, + + res = apideck.accounting.customers.update(id="", service_id="salesforce", display_id="EMP00101", display_name="Windsurf Shop", company_name="SpaceX", company_id="12345", title="CEO", first_name="Elon", middle_name="D.", last_name="Musk", suffix="Jr.", individual=True, project=False, addresses=[ + { + "id": "123", + "type": apideck_unify.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", }, - "tax_number": "US123945459", - "currency": apideck_unify.Currency.USD, - "account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, }, - "parent": { + { + "number": "111-111-1111", "id": "12345", - "name": "Windsurf Shop", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, }, - "status": apideck_unify.CustomerStatusStatus.ACTIVE, - "payment_method": "cash", - "channel": "email", - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], bank_accounts=[ + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + ], notes="Some notes about this customer", tax_rate={ + "id": "123456", + "rate": 10, + }, tax_number="US123945459", currency=apideck_unify.Currency.USD, account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, parent={ + "id": "12345", + "name": "Windsurf Shop", + }, status=apideck_unify.CustomerStatusStatus.ACTIVE, payment_method="cash", channel="email", row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `customer` | [models.CustomerInput](../../models/customerinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `display_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Display ID | EMP00101 | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Display name | Windsurf Shop | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the person. | Elon | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Middle name of the person. | D. | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the person. | Musk | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Jr. | +| `individual` | *OptionalNullable[bool]* | :heavy_minus_sign: | Is this an individual or business customer | true | +| `project` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, indicates this is a Project. | false | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `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 | | +| `websites` | List[[models.Website](../../models/website.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount](../../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `notes` | *OptionalNullable[str]* | :heavy_minus_sign: | Some notes about this customer | Some notes about this customer | +| `tax_rate` | [Optional[models.LinkedTaxRateInput]](../../models/linkedtaxrateinput.md) | :heavy_minus_sign: | N/A | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | US123945459 | +| `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 | +| `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `parent` | [OptionalNullable[models.LinkedParentCustomer]](../../models/linkedparentcustomer.md) | :heavy_minus_sign: | The parent customer this entity is linked to. | | +| `status` | [OptionalNullable[models.CustomerStatusStatus]](../../models/customerstatusstatus.md) | :heavy_minus_sign: | Customer 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 | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -614,11 +613,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.customers.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/customfields/README.md b/docs/sdks/customfields/README.md index 49cba71e..cd0bb4c8 100644 --- a/docs/sdks/customfields/README.md +++ b/docs/sdks/customfields/README.md @@ -23,11 +23,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.custom_fields.list(unified_api="crm", service_id="pipedrive", resource="leads", resource_id="1234") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/custommappingssdk/README.md b/docs/sdks/custommappingssdk/README.md index f3ebd6ef..6648860f 100644 --- a/docs/sdks/custommappingssdk/README.md +++ b/docs/sdks/custommappingssdk/README.md @@ -22,11 +22,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.custom_mappings.list(unified_api="crm", service_id="pipedrive") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/departments/README.md b/docs/sdks/departments/README.md index 6e0aedb9..f324a266 100644 --- a/docs/sdks/departments/README.md +++ b/docs/sdks/departments/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.departments.list(request={ - "service_id": "salesforce", - "fields": "id,updated_at", - "filter_": { - "subsidiary": "1", - }, + + res = apideck.accounting.departments.list(service_id="salesforce", fields="id,updated_at", filter_={ + "subsidiary": "1", }) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `request` | [models.AccountingDepartmentsAllRequest](../../models/accountingdepartmentsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter_` | [Optional[models.AccountingDepartmentsFilter]](../../models/accountingdepartmentsfilter.md) | :heavy_minus_sign: | Apply filters | {
"subsidiary": "1"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,60 +81,58 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.departments.create(accounting_department={ - "parent_id": "12345", - "name": "Sales", - "status": apideck_unify.DepartmentStatus.ACTIVE, - "subsidiaries": [ - { - "name": "SpaceX", - }, - ], - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.departments.create(service_id="salesforce", parent_id="12345", name="Sales", status=apideck_unify.DepartmentStatus.ACTIVE, subsidiaries=[ + { + "name": "SpaceX", + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `accounting_department` | [models.AccountingDepartmentInput](../../models/accountingdepartmentinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the department. | Sales | +| `status` | [Optional[models.DepartmentStatus]](../../models/departmentstatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | +| `subsidiaries` | List[[models.SubsidiaryReferenceInput](../../models/subsidiaryreferenceinput.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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -163,11 +164,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.departments.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -212,83 +213,81 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.departments.update(id="", accounting_department={ - "parent_id": "12345", - "name": "Sales", - "status": apideck_unify.DepartmentStatus.ACTIVE, - "subsidiaries": [ - { - "name": "SpaceX", - }, - { - "name": "SpaceX", - }, - { - "name": "SpaceX", - }, - ], - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.departments.update(id="", service_id="salesforce", parent_id="12345", name="Sales", status=apideck_unify.DepartmentStatus.ACTIVE, subsidiaries=[ + { + "name": "SpaceX", + }, + { + "name": "SpaceX", + }, + { + "name": "SpaceX", + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `accounting_department` | [models.AccountingDepartmentInput](../../models/accountingdepartmentinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the department. | Sales | +| `status` | [Optional[models.DepartmentStatus]](../../models/departmentstatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | +| `subsidiaries` | List[[models.SubsidiaryReferenceInput](../../models/subsidiaryreferenceinput.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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -320,11 +319,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.departments.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/drivegroups/README.md b/docs/sdks/drivegroups/README.md index 2deb2694..9a3e320c 100644 --- a/docs/sdks/drivegroups/README.md +++ b/docs/sdks/drivegroups/README.md @@ -26,29 +26,32 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.drive_groups.list(request={ - "service_id": "salesforce", - "filter_": { - "parent_group_id": "1234", - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.file_storage.drive_groups.list(service_id="salesforce", filter_={ + "parent_group_id": "1234", + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `request` | [models.FileStorageDriveGroupsAllRequest](../../models/filestoragedrivegroupsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.DriveGroupsFilter]](../../models/drivegroupsfilter.md) | :heavy_minus_sign: | Apply filters | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -80,49 +83,47 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.drive_groups.create(drive_group={ - "name": "accounting", - "display_name": "accounting", - "description": "A description", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.drive_groups.create(name="accounting", service_id="salesforce", display_name="accounting", description="A description", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `drive_group` | [models.DriveGroupInput](../../models/drivegroupinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the drive group | accounting | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The display name of the drive group | accounting | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -154,11 +155,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.drive_groups.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -202,92 +203,90 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.drive_groups.update(id="", drive_group={ - "name": "accounting", - "display_name": "accounting", - "description": "A description", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.drive_groups.update(id="", name="accounting", service_id="salesforce", display_name="accounting", description="A description", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `drive_group` | [models.DriveGroupInput](../../models/drivegroupinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `name` | *str* | :heavy_check_mark: | The name of the drive group | accounting | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The display name of the drive group | accounting | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -319,11 +318,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.drive_groups.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/drives/README.md b/docs/sdks/drives/README.md index cc1ab47c..18a25eb1 100644 --- a/docs/sdks/drives/README.md +++ b/docs/sdks/drives/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.drives.list(request={ - "service_id": "salesforce", - "filter_": { - "group_id": "1234", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.file_storage.drives.list(service_id="salesforce", filter_={ + "group_id": "1234", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `request` | [models.FileStorageDrivesAllRequest](../../models/filestoragedrivesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.DrivesFilter]](../../models/drivesfilter.md) | :heavy_minus_sign: | Apply filters | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -77,48 +80,46 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.drives.create(drive={ - "name": "Project Resources", - "description": "A description", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.drives.create(name="Project Resources", service_id="salesforce", description="A description", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `drive` | [models.DriveInput](../../models/driveinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the drive | Project Resources | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -150,11 +151,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.drives.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -198,91 +199,89 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.drives.update(id="", drive={ - "name": "Project Resources", - "description": "A description", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.drives.update(id="", name="Project Resources", service_id="salesforce", description="A description", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `drive` | [models.DriveInput](../../models/driveinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `name` | *str* | :heavy_check_mark: | The name of the drive | Project Resources | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -314,11 +313,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.drives.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/employeepayrolls/README.md b/docs/sdks/employeepayrolls/README.md index 6396d6d5..61f3cddd 100644 --- a/docs/sdks/employeepayrolls/README.md +++ b/docs/sdks/employeepayrolls/README.md @@ -23,31 +23,30 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.employee_payrolls.list(request={ - "employee_id": "", - "service_id": "salesforce", - "filter_": { - "start_date": "2022-04-08", - "end_date": "2022-04-21", - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.hris.employee_payrolls.list(employee_id="", service_id="salesforce", filter_={ + "start_date": "2022-04-08", + "end_date": "2022-04-21", + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `request` | [models.HrisEmployeePayrollsAllRequest](../../models/hrisemployeepayrollsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `employee_id` | *str* | :heavy_check_mark: | ID of the employee you are acting upon. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `filter_` | [Optional[models.PayrollsFilter]](../../models/payrollsfilter.md) | :heavy_minus_sign: | Apply filters | {
"start_date": "2022-04-08",
"end_date": "2022-04-21"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -79,25 +78,24 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.employee_payrolls.get(request={ - "payroll_id": "", - "employee_id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.hris.employee_payrolls.get(payroll_id="", employee_id="", service_id="salesforce", fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `request` | [models.HrisEmployeePayrollsOneRequest](../../models/hrisemployeepayrollsonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `payroll_id` | *str* | :heavy_check_mark: | ID of the payroll you are acting upon. | | +| `employee_id` | *str* | :heavy_check_mark: | ID of the employee you are acting upon. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/employees/README.md b/docs/sdks/employees/README.md index 4b511ee5..1617e3f4 100644 --- a/docs/sdks/employees/README.md +++ b/docs/sdks/employees/README.md @@ -27,41 +27,44 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.employees.list(request={ - "service_id": "salesforce", - "filter_": { - "company_id": "1234", - "email": "elon@tesla.com", - "first_name": "Elon", - "title": "Manager", - "last_name": "Musk", - "manager_id": "1234", - "employment_status": apideck_unify.EmployeesFilterEmploymentStatus.ACTIVE, - "employee_number": "123456-AB", - "department_id": "1234", - }, - "sort": { - "by": apideck_unify.EmployeesSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.hris.employees.list(service_id="salesforce", filter_={ + "company_id": "1234", + "email": "elon@tesla.com", + "first_name": "Elon", + "title": "Manager", + "last_name": "Musk", + "manager_id": "1234", + "employment_status": apideck_unify.EmployeesFilterEmploymentStatus.ACTIVE, + "employee_number": "123456-AB", + "department_id": "1234", + }, sort={ + "by": apideck_unify.EmployeesSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `request` | [models.HrisEmployeesAllRequest](../../models/hrisemployeesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.EmployeesFilter]](../../models/employeesfilter.md) | :heavy_minus_sign: | Apply filters | {
"company_id": "1234",
"email": "elon@tesla.com",
"first_name": "Elon",
"last_name": "Musk",
"title": "Manager",
"manager_id": "1234",
"employment_status": "active",
"employee_number": "123456-AB",
"department_id": "1234"
} | +| `sort` | [Optional[models.EmployeesSort]](../../models/employeessort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -95,151 +98,46 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.employees.create(employee={ - "id": "12345", + + res = apideck.hris.employees.create(service_id="salesforce", id="12345", first_name="Elon", last_name="Musk", middle_name="D.", display_name="Technoking", preferred_name="Elon Musk", initials="EM", salutation="Mr", title="CEO", marital_status="married", partner={ "first_name": "Elon", "last_name": "Musk", "middle_name": "D.", - "display_name": "Technoking", - "preferred_name": "Elon Musk", + "gender": apideck_unify.Gender.MALE, "initials": "EM", - "salutation": "Mr", - "title": "CEO", - "marital_status": "married", - "partner": { - "first_name": "Elon", - "last_name": "Musk", - "middle_name": "D.", - "gender": apideck_unify.Gender.MALE, - "initials": "EM", - "birthday": dateutil.parser.parse("2000-08-12").date(), - "deceased_on": dateutil.parser.parse("2000-08-12").date(), - }, - "division": "Europe", - "division_id": "12345", - "department_id": "12345", - "department_name": "12345", - "team": { - "id": "1234", - "name": "Full Stack Engineers", - }, - "company_id": "23456", - "company_name": "SpaceX", - "employment_start_date": "2021-10-26", - "employment_end_date": "2028-10-26", - "leaving_reason": apideck_unify.LeavingReason.RESIGNED, - "employee_number": "123456-AB", - "employment_status": apideck_unify.EmploymentStatus.ACTIVE, - "ethnicity": "African American", - "manager": { - "id": "12345", - "name": "Elon Musk", - "first_name": "Elon", - "last_name": "Musk", - "email": "elon@musk.com", - "employment_status": apideck_unify.EmploymentStatus.ACTIVE, - }, - "direct_reports": [ - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6", - ], - "social_security_number": "123456789", "birthday": dateutil.parser.parse("2000-08-12").date(), "deceased_on": dateutil.parser.parse("2000-08-12").date(), - "country_of_birth": "US", - "description": "A description", - "gender": apideck_unify.Gender.MALE, - "pronouns": "she,her", - "preferred_language": "EN", - "languages": [ - "EN", - ], - "nationalities": [ - "US", - ], - "photo_url": "https://unavatar.io/elon-musk", - "timezone": "Europe/London", - "source": "lever", - "source_id": "12345", - "record_url": "https://app.intercom.io/contacts/12345", - "jobs": [ - { - "title": "CEO", - "role": "Sales", - "start_date": dateutil.parser.parse("2020-08-12").date(), - "end_date": dateutil.parser.parse("2020-08-12").date(), - "compensation_rate": 72000, - "currency": apideck_unify.Currency.USD, - "payment_unit": apideck_unify.PaymentUnit.YEAR, - "hired_at": dateutil.parser.parse("2020-08-12").date(), - "is_primary": True, - "is_manager": True, - "status": apideck_unify.EmployeeJobStatus.ACTIVE, - "location": { - "id": "123", - "type": apideck_unify.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", - }, - }, - ], - "compensations": [ - { - "rate": 50, - "payment_unit": apideck_unify.PaymentUnit.HOUR, - "flsa_status": apideck_unify.FlsaStatus.NONEXEMPT, - "effective_date": "2021-06-11", - }, - ], - "works_remote": True, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { + }, division="Europe", division_id="12345", department_id="12345", department_name="12345", team={ + "id": "1234", + "name": "Full Stack Engineers", + }, company_id="23456", company_name="SpaceX", employment_start_date="2021-10-26", employment_end_date="2028-10-26", leaving_reason=apideck_unify.LeavingReason.RESIGNED, employee_number="123456-AB", employment_status=apideck_unify.EmploymentStatus.ACTIVE, ethnicity="African American", manager={ + "id": "12345", + "name": "Elon Musk", + "first_name": "Elon", + "last_name": "Musk", + "email": "elon@musk.com", + "employment_status": apideck_unify.EmploymentStatus.ACTIVE, + }, direct_reports=[ + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6", + ], social_security_number="123456789", birthday=dateutil.parser.parse("2000-08-12").date(), deceased_on=dateutil.parser.parse("2000-08-12").date(), country_of_birth="US", description="A description", gender=apideck_unify.Gender.MALE, pronouns="she,her", preferred_language="EN", languages=[ + "EN", + ], nationalities=[ + "US", + ], photo_url="https://unavatar.io/elon-musk", timezone="Europe/London", source="lever", source_id="12345", record_url="https://app.intercom.io/contacts/12345", jobs=[ + { + "title": "CEO", + "role": "Sales", + "start_date": dateutil.parser.parse("2020-08-12").date(), + "end_date": dateutil.parser.parse("2020-08-12").date(), + "compensation_rate": 72000, + "currency": apideck_unify.Currency.USD, + "payment_unit": apideck_unify.PaymentUnit.YEAR, + "hired_at": dateutil.parser.parse("2020-08-12").date(), + "is_primary": True, + "is_manager": True, + "status": apideck_unify.EmployeeJobStatus.ACTIVE, + "location": { "id": "123", "type": apideck_unify.Type.PRIMARY, "string": "25 Spring Street, Blackburn, VIC 3130", @@ -265,136 +163,241 @@ with Apideck( "notes": "Address notes or delivery instructions.", "row_version": "1-12345", }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "bank_accounts": [ - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - ], - "tax_code": "1111", - "tax_id": "234-32-0000", - "dietary_preference": "Veggie", - "food_allergies": [ - "No allergies", - ], - "probation_period": { - "start_date": dateutil.parser.parse("2021-10-01").date(), - "end_date": dateutil.parser.parse("2021-11-28").date(), }, - "tags": [ - "New", - ], - "row_version": "1-12345", - "deleted": True, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], compensations=[ + { + "rate": 50, + "payment_unit": apideck_unify.PaymentUnit.HOUR, + "flsa_status": apideck_unify.FlsaStatus.NONEXEMPT, + "effective_date": "2021-06-11", + }, + ], works_remote=True, addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], bank_accounts=[ + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + ], tax_code="1111", tax_id="234-32-0000", dietary_preference="Veggie", food_allergies=[ + "No allergies", + ], probation_period={ + "start_date": dateutil.parser.parse("2021-10-01").date(), + "end_date": dateutil.parser.parse("2021-11-28").date(), + }, tags=[ + "New", + ], row_version="1-12345", deleted=True, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `employee` | [models.EmployeeInput](../../models/employeeinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `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 | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Middle name of the person. | D. | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name used to display the employee, often a combination of their first and last names. | Technoking | +| `preferred_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name the employee prefers to be addressed by, which may be different from their legal name. | Elon Musk | +| `initials` | *OptionalNullable[str]* | :heavy_minus_sign: | The initials of the person, usually derived from their first, middle, and last names. | EM | +| `salutation` | *OptionalNullable[str]* | :heavy_minus_sign: | A formal salutation for the person. For example, 'Mr', 'Mrs' | Mr | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `marital_status` | *OptionalNullable[str]* | :heavy_minus_sign: | The marital status of the employee. | married | +| `partner` | [Optional[models.PersonInput]](../../models/personinput.md) | :heavy_minus_sign: | N/A | | +| `division` | *OptionalNullable[str]* | :heavy_minus_sign: | The division the person is currently in. Usually a collection of departments or teams or regions. | Europe | +| `division_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier of the division this employee belongs to. | 12345 | +| `department` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. | R&D | +| `department_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier of the department ID this employee belongs to. | 12345 | +| `department_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the department this employee belongs to. | 12345 | +| `team` | [OptionalNullable[models.Team]](../../models/team.md) | :heavy_minus_sign: | The team the person is currently in. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the company. | 23456 | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `employment_start_date` | *OptionalNullable[str]* | :heavy_minus_sign: | A Start Date is the date that the employee started working at the company | 2021-10-26 | +| `employment_end_date` | *OptionalNullable[str]* | :heavy_minus_sign: | An End Date is the date that the employee ended working at the company | 2028-10-26 | +| `leaving_reason` | [OptionalNullable[models.LeavingReason]](../../models/leavingreason.md) | :heavy_minus_sign: | The reason because the employment ended. | resigned | +| `employee_number` | *OptionalNullable[str]* | :heavy_minus_sign: | An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. | 123456-AB | +| `employment_status` | [OptionalNullable[models.EmploymentStatus]](../../models/employmentstatus.md) | :heavy_minus_sign: | The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. | active | +| `employment_role` | [Optional[models.EmploymentRole]](../../models/employmentrole.md) | :heavy_minus_sign: | N/A | | +| `ethnicity` | *OptionalNullable[str]* | :heavy_minus_sign: | The ethnicity of the employee | African American | +| `manager` | [Optional[models.Manager]](../../models/manager.md) | :heavy_minus_sign: | N/A | | +| `direct_reports` | List[*str*] | :heavy_minus_sign: | Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. | [
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6"
] | +| `social_security_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. | 123456789 | +| `birthday` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date of birth of the person. | 2000-08-12 | +| `deceased_on` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date the person deceased. | 2000-08-12 | +| `country_of_birth` | *OptionalNullable[str]* | :heavy_minus_sign: | Country code according to ISO 3166-1 alpha-2. | US | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `gender` | [OptionalNullable[models.Gender]](../../models/gender.md) | :heavy_minus_sign: | The gender represents the gender identity of a person. | male | +| `pronouns` | *OptionalNullable[str]* | :heavy_minus_sign: | The preferred pronouns of the person. | she,her | +| `preferred_language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `languages` | List[*str*] | :heavy_minus_sign: | N/A | | +| `nationalities` | List[*str*] | :heavy_minus_sign: | N/A | | +| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the photo of a person. | https://unavatar.io/elon-musk | +| `timezone` | *OptionalNullable[str]* | :heavy_minus_sign: | The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. | Europe/London | +| `source` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | lever | +| `source_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). | 12345 | +| `record_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | https://app.intercom.io/contacts/12345 | +| `jobs` | List[[models.EmployeeJobInput](../../models/employeejobinput.md)] | :heavy_minus_sign: | N/A | | +| `compensations` | List[[models.EmployeeCompensationInput](../../models/employeecompensationinput.md)] | :heavy_minus_sign: | N/A | | +| `works_remote` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates if the employee works from a remote location. | true | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `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_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `social_links` | List[[models.SocialLink](../../models/sociallink.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount](../../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 1111 | +| `tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 234-32-0000 | +| `dietary_preference` | *OptionalNullable[str]* | :heavy_minus_sign: | Indicate the employee's dietary preference. | Veggie | +| `food_allergies` | List[*str*] | :heavy_minus_sign: | Indicate the employee's food allergies. | [
"No allergies"
] | +| `probation_period` | [Optional[models.ProbationPeriod]](../../models/probationperiod.md) | :heavy_minus_sign: | N/A | | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `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 | +| `deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Flag to indicate if the object is deleted. | true | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -426,30 +429,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.employees.get(request={ - "id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - "filter_": { - "company_id": "1234", - }, - "pass_through": { - "search": "San Francisco", - }, + + res = apideck.hris.employees.get(id="", service_id="salesforce", fields="id,updated_at", filter_={ + "company_id": "1234", + }, pass_through={ + "search": "San Francisco", }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `request` | [models.HrisEmployeesOneRequest](../../models/hrisemployeesonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter_` | [Optional[models.EmployeesOneFilter]](../../models/employeesonefilter.md) | :heavy_minus_sign: | Apply filters | {
"company_id": "1234"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -483,203 +485,46 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.employees.update(id="", employee={ - "id": "12345", + + res = apideck.hris.employees.update(id_param="", service_id="salesforce", id="12345", first_name="Elon", last_name="Musk", middle_name="D.", display_name="Technoking", preferred_name="Elon Musk", initials="EM", salutation="Mr", title="CEO", marital_status="married", partner={ "first_name": "Elon", "last_name": "Musk", "middle_name": "D.", - "display_name": "Technoking", - "preferred_name": "Elon Musk", + "gender": apideck_unify.Gender.MALE, "initials": "EM", - "salutation": "Mr", - "title": "CEO", - "marital_status": "married", - "partner": { - "first_name": "Elon", - "last_name": "Musk", - "middle_name": "D.", - "gender": apideck_unify.Gender.MALE, - "initials": "EM", - "birthday": dateutil.parser.parse("2000-08-12").date(), - "deceased_on": dateutil.parser.parse("2000-08-12").date(), - }, - "division": "Europe", - "division_id": "12345", - "department_id": "12345", - "department_name": "12345", - "team": { - "id": "1234", - "name": "Full Stack Engineers", - }, - "company_id": "23456", - "company_name": "SpaceX", - "employment_start_date": "2021-10-26", - "employment_end_date": "2028-10-26", - "leaving_reason": apideck_unify.LeavingReason.RESIGNED, - "employee_number": "123456-AB", - "employment_status": apideck_unify.EmploymentStatus.ACTIVE, - "ethnicity": "African American", - "manager": { - "id": "12345", - "name": "Elon Musk", - "first_name": "Elon", - "last_name": "Musk", - "email": "elon@musk.com", - "employment_status": apideck_unify.EmploymentStatus.ACTIVE, - }, - "direct_reports": [ - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6", - ], - "social_security_number": "123456789", "birthday": dateutil.parser.parse("2000-08-12").date(), "deceased_on": dateutil.parser.parse("2000-08-12").date(), - "country_of_birth": "US", - "description": "A description", - "gender": apideck_unify.Gender.MALE, - "pronouns": "she,her", - "preferred_language": "EN", - "languages": [ - "EN", - ], - "nationalities": [ - "US", - ], - "photo_url": "https://unavatar.io/elon-musk", - "timezone": "Europe/London", - "source": "lever", - "source_id": "12345", - "record_url": "https://app.intercom.io/contacts/12345", - "jobs": [ - { - "title": "CEO", - "role": "Sales", - "start_date": dateutil.parser.parse("2020-08-12").date(), - "end_date": dateutil.parser.parse("2020-08-12").date(), - "compensation_rate": 72000, - "currency": apideck_unify.Currency.USD, - "payment_unit": apideck_unify.PaymentUnit.YEAR, - "hired_at": dateutil.parser.parse("2020-08-12").date(), - "is_primary": True, - "is_manager": True, - "status": apideck_unify.EmployeeJobStatus.ACTIVE, - "location": { - "id": "123", - "type": apideck_unify.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", - }, - }, - { - "title": "CEO", - "role": "Sales", - "start_date": dateutil.parser.parse("2020-08-12").date(), - "end_date": dateutil.parser.parse("2020-08-12").date(), - "compensation_rate": 72000, - "currency": apideck_unify.Currency.USD, - "payment_unit": apideck_unify.PaymentUnit.YEAR, - "hired_at": dateutil.parser.parse("2020-08-12").date(), - "is_primary": True, - "is_manager": True, - "status": apideck_unify.EmployeeJobStatus.ACTIVE, - "location": { - "id": "123", - "type": apideck_unify.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", - }, - }, - { - "title": "CEO", - "role": "Sales", - "start_date": dateutil.parser.parse("2020-08-12").date(), - "end_date": dateutil.parser.parse("2020-08-12").date(), - "compensation_rate": 72000, - "currency": apideck_unify.Currency.USD, - "payment_unit": apideck_unify.PaymentUnit.YEAR, - "hired_at": dateutil.parser.parse("2020-08-12").date(), - "is_primary": True, - "is_manager": True, - "status": apideck_unify.EmployeeJobStatus.ACTIVE, - "location": { - "id": "123", - "type": apideck_unify.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", - }, - }, - ], - "compensations": [ - { - "rate": 50, - "payment_unit": apideck_unify.PaymentUnit.HOUR, - "flsa_status": apideck_unify.FlsaStatus.NONEXEMPT, - "effective_date": "2021-06-11", - }, - ], - "works_remote": True, - "addresses": [ - { + }, division="Europe", division_id="12345", department_id="12345", department_name="12345", team={ + "id": "1234", + "name": "Full Stack Engineers", + }, company_id="23456", company_name="SpaceX", employment_start_date="2021-10-26", employment_end_date="2028-10-26", leaving_reason=apideck_unify.LeavingReason.RESIGNED, employee_number="123456-AB", employment_status=apideck_unify.EmploymentStatus.ACTIVE, ethnicity="African American", manager={ + "id": "12345", + "name": "Elon Musk", + "first_name": "Elon", + "last_name": "Musk", + "email": "elon@musk.com", + "employment_status": apideck_unify.EmploymentStatus.ACTIVE, + }, direct_reports=[ + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6", + ], social_security_number="123456789", birthday=dateutil.parser.parse("2000-08-12").date(), deceased_on=dateutil.parser.parse("2000-08-12").date(), country_of_birth="US", description="A description", gender=apideck_unify.Gender.MALE, pronouns="she,her", preferred_language="EN", languages=[ + "EN", + ], nationalities=[ + "US", + ], photo_url="https://unavatar.io/elon-musk", timezone="Europe/London", source="lever", source_id="12345", record_url="https://app.intercom.io/contacts/12345", jobs=[ + { + "title": "CEO", + "role": "Sales", + "start_date": dateutil.parser.parse("2020-08-12").date(), + "end_date": dateutil.parser.parse("2020-08-12").date(), + "compensation_rate": 72000, + "currency": apideck_unify.Currency.USD, + "payment_unit": apideck_unify.PaymentUnit.YEAR, + "hired_at": dateutil.parser.parse("2020-08-12").date(), + "is_primary": True, + "is_manager": True, + "status": apideck_unify.EmployeeJobStatus.ACTIVE, + "location": { "id": "123", "type": apideck_unify.Type.PRIMARY, "string": "25 Spring Street, Blackburn, VIC 3130", @@ -705,7 +550,20 @@ with Apideck( "notes": "Address notes or delivery instructions.", "row_version": "1-12345", }, - { + }, + { + "title": "CEO", + "role": "Sales", + "start_date": dateutil.parser.parse("2020-08-12").date(), + "end_date": dateutil.parser.parse("2020-08-12").date(), + "compensation_rate": 72000, + "currency": apideck_unify.Currency.USD, + "payment_unit": apideck_unify.PaymentUnit.YEAR, + "hired_at": dateutil.parser.parse("2020-08-12").date(), + "is_primary": True, + "is_manager": True, + "status": apideck_unify.EmployeeJobStatus.ACTIVE, + "location": { "id": "123", "type": apideck_unify.Type.PRIMARY, "string": "25 Spring Street, Blackburn, VIC 3130", @@ -731,127 +589,271 @@ with Apideck( "notes": "Address notes or delivery instructions.", "row_version": "1-12345", }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - { - "email": "elon@musk.com", + }, + { + "title": "CEO", + "role": "Sales", + "start_date": dateutil.parser.parse("2020-08-12").date(), + "end_date": dateutil.parser.parse("2020-08-12").date(), + "compensation_rate": 72000, + "currency": apideck_unify.Currency.USD, + "payment_unit": apideck_unify.PaymentUnit.YEAR, + "hired_at": dateutil.parser.parse("2020-08-12").date(), + "is_primary": True, + "is_manager": True, + "status": apideck_unify.EmployeeJobStatus.ACTIVE, + "location": { "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - { + "type": apideck_unify.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", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": {}, - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "bank_accounts": [ - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, + "website": "https://elonmusk.com", + "notes": "Address notes or delivery instructions.", + "row_version": "1-12345", }, - ], - "tax_code": "1111", - "tax_id": "234-32-0000", - "dietary_preference": "Veggie", - "food_allergies": [ - "No allergies", - ], - "probation_period": { - "start_date": dateutil.parser.parse("2021-10-01").date(), - "end_date": dateutil.parser.parse("2021-11-28").date(), }, - "tags": [ - "New", - ], - "row_version": "1-12345", - "deleted": True, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], compensations=[ + { + "rate": 50, + "payment_unit": apideck_unify.PaymentUnit.HOUR, + "flsa_status": apideck_unify.FlsaStatus.NONEXEMPT, + "effective_date": "2021-06-11", + }, + ], works_remote=True, addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": {}, + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], bank_accounts=[ + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + ], tax_code="1111", tax_id="234-32-0000", dietary_preference="Veggie", food_allergies=[ + "No allergies", + ], probation_period={ + "start_date": dateutil.parser.parse("2021-10-01").date(), + "end_date": dateutil.parser.parse("2021-11-28").date(), + }, tags=[ + "New", + ], row_version="1-12345", deleted=True, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `employee` | [models.EmployeeInput](../../models/employeeinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id_param` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `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 | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Middle name of the person. | D. | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name used to display the employee, often a combination of their first and last names. | Technoking | +| `preferred_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name the employee prefers to be addressed by, which may be different from their legal name. | Elon Musk | +| `initials` | *OptionalNullable[str]* | :heavy_minus_sign: | The initials of the person, usually derived from their first, middle, and last names. | EM | +| `salutation` | *OptionalNullable[str]* | :heavy_minus_sign: | A formal salutation for the person. For example, 'Mr', 'Mrs' | Mr | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `marital_status` | *OptionalNullable[str]* | :heavy_minus_sign: | The marital status of the employee. | married | +| `partner` | [Optional[models.PersonInput]](../../models/personinput.md) | :heavy_minus_sign: | N/A | | +| `division` | *OptionalNullable[str]* | :heavy_minus_sign: | The division the person is currently in. Usually a collection of departments or teams or regions. | Europe | +| `division_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier of the division this employee belongs to. | 12345 | +| `department` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. | R&D | +| `department_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier of the department ID this employee belongs to. | 12345 | +| `department_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the department this employee belongs to. | 12345 | +| `team` | [OptionalNullable[models.Team]](../../models/team.md) | :heavy_minus_sign: | The team the person is currently in. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the company. | 23456 | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `employment_start_date` | *OptionalNullable[str]* | :heavy_minus_sign: | A Start Date is the date that the employee started working at the company | 2021-10-26 | +| `employment_end_date` | *OptionalNullable[str]* | :heavy_minus_sign: | An End Date is the date that the employee ended working at the company | 2028-10-26 | +| `leaving_reason` | [OptionalNullable[models.LeavingReason]](../../models/leavingreason.md) | :heavy_minus_sign: | The reason because the employment ended. | resigned | +| `employee_number` | *OptionalNullable[str]* | :heavy_minus_sign: | An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. | 123456-AB | +| `employment_status` | [OptionalNullable[models.EmploymentStatus]](../../models/employmentstatus.md) | :heavy_minus_sign: | The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. | active | +| `employment_role` | [Optional[models.EmploymentRole]](../../models/employmentrole.md) | :heavy_minus_sign: | N/A | | +| `ethnicity` | *OptionalNullable[str]* | :heavy_minus_sign: | The ethnicity of the employee | African American | +| `manager` | [Optional[models.Manager]](../../models/manager.md) | :heavy_minus_sign: | N/A | | +| `direct_reports` | List[*str*] | :heavy_minus_sign: | Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. | [
"a0d636c6-43b3-4bde-8c70-85b707d992f4",
"a98lfd96-43b3-4bde-8c70-85b707d992e6"
] | +| `social_security_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. | 123456789 | +| `birthday` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date of birth of the person. | 2000-08-12 | +| `deceased_on` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date the person deceased. | 2000-08-12 | +| `country_of_birth` | *OptionalNullable[str]* | :heavy_minus_sign: | Country code according to ISO 3166-1 alpha-2. | US | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `gender` | [OptionalNullable[models.Gender]](../../models/gender.md) | :heavy_minus_sign: | The gender represents the gender identity of a person. | male | +| `pronouns` | *OptionalNullable[str]* | :heavy_minus_sign: | The preferred pronouns of the person. | she,her | +| `preferred_language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `languages` | List[*str*] | :heavy_minus_sign: | N/A | | +| `nationalities` | List[*str*] | :heavy_minus_sign: | N/A | | +| `photo_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the photo of a person. | https://unavatar.io/elon-musk | +| `timezone` | *OptionalNullable[str]* | :heavy_minus_sign: | The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. | Europe/London | +| `source` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | lever | +| `source_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). | 12345 | +| `record_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | https://app.intercom.io/contacts/12345 | +| `jobs` | List[[models.EmployeeJobInput](../../models/employeejobinput.md)] | :heavy_minus_sign: | N/A | | +| `compensations` | List[[models.EmployeeCompensationInput](../../models/employeecompensationinput.md)] | :heavy_minus_sign: | N/A | | +| `works_remote` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates if the employee works from a remote location. | true | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `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_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `social_links` | List[[models.SocialLink](../../models/sociallink.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount](../../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 1111 | +| `tax_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | 234-32-0000 | +| `dietary_preference` | *OptionalNullable[str]* | :heavy_minus_sign: | Indicate the employee's dietary preference. | Veggie | +| `food_allergies` | List[*str*] | :heavy_minus_sign: | Indicate the employee's food allergies. | [
"No allergies"
] | +| `probation_period` | [Optional[models.ProbationPeriod]](../../models/probationperiod.md) | :heavy_minus_sign: | N/A | | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `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 | +| `deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Flag to indicate if the object is deleted. | true | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -883,11 +885,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.hris.employees.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/employeeschedulessdk/README.md b/docs/sdks/employeeschedulessdk/README.md index fc819231..4b7b5c69 100644 --- a/docs/sdks/employeeschedulessdk/README.md +++ b/docs/sdks/employeeschedulessdk/README.md @@ -22,27 +22,26 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.employee_schedules.list(request={ - "employee_id": "", - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.hris.employee_schedules.list(employee_id="", service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `request` | [models.HrisEmployeeSchedulesAllRequest](../../models/hrisemployeeschedulesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `employee_id` | *str* | :heavy_check_mark: | ID of the employee you are acting upon. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/eventlogs/README.md b/docs/sdks/eventlogs/README.md index 28034475..5bdcf987 100644 --- a/docs/sdks/eventlogs/README.md +++ b/docs/sdks/eventlogs/README.md @@ -22,6 +22,7 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.webhook.event_logs.list(filter_={ "exclude_apis": "vault,proxy", "consumer_id": "test_user_id", @@ -29,9 +30,10 @@ with Apideck( "event_type": "vault.connection.callable", }) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` diff --git a/docs/sdks/expenses/README.md b/docs/sdks/expenses/README.md index 9baf2e22..6b6bcd84 100644 --- a/docs/sdks/expenses/README.md +++ b/docs/sdks/expenses/README.md @@ -26,11 +26,13 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.expenses.list(service_id="salesforce") - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` @@ -76,89 +78,87 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.expenses.create(expense={ - "transaction_date": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "account_id": "123456", - "line_items": [ - { - "total_amount": 275, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "account_id": "123456", - "customer_id": "12345", - "department_id": "12345", - "location_id": "12345", - "tax_rate": { + + res = apideck.accounting.expenses.create(transaction_date=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), account_id="123456", line_items=[ + { + "total_amount": 275, + "tracking_categories": [ + { + "id": "123456", + "name": "New York", + }, + { "id": "123456", - "rate": 10, + "name": "New York", }, - "description": "Travel US.", - "billable": True, + ], + "account_id": "123456", + "customer_id": "12345", + "department_id": "12345", + "location_id": "12345", + "tax_rate": { + "id": "123456", + "rate": 10, }, - ], - "number": "OIT00546", - "customer_id": "12345", - "supplier_id": "12345", - "company_id": "12345", - "department_id": "12345", - "payment_type": apideck_unify.ExpensePaymentType.CASH, - "currency": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "type": apideck_unify.ExpenseType.EXPENSE, - "memo": "For travel expenses incurred on 2024-05-15", - "tax_rate": { - "id": "123456", - "rate": 10, + "description": "Travel US.", + "billable": True, }, - "total_amount": 275, - "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", - }, + ], service_id="salesforce", number="OIT00546", customer_id="12345", supplier_id="12345", company_id="12345", department_id="12345", payment_type=apideck_unify.ExpensePaymentType.CASH, currency=apideck_unify.Currency.USD, currency_rate=0.69, type_=apideck_unify.ExpenseType.EXPENSE, memo="For travel expenses incurred on 2024-05-15", tax_rate={ + "id": "123456", + "rate": 10, + }, total_amount=275, 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", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `expense` | [models.ExpenseInput](../../models/expenseinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `account_id` | *str* | :heavy_check_mark: | The unique identifier for the ledger account that this expense should be credited to. | 123456 | +| `line_items` | List[[models.ExpenseLineItemInput](../../models/expenselineiteminput.md)] | :heavy_check_mark: | Expense line items linked to this expense. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Number. | OIT00546 | +| `customer_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. | 12345 | +| `supplier_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the supplier this entity is linked to. | 12345 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `department_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the department this expense is linked to. | 12345 | +| `payment_type` | [OptionalNullable[models.ExpensePaymentType]](../../models/expensepaymenttype.md) | :heavy_minus_sign: | The type of payment for the expense. | cash | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `type` | [OptionalNullable[models.ExpenseType]](../../models/expensetype.md) | :heavy_minus_sign: | The type of expense. | expense | +| `memo` | *OptionalNullable[str]* | :heavy_minus_sign: | The memo of the expense. | For travel expenses incurred on 2024-05-15 | +| `tax_rate` | [Optional[models.LinkedTaxRateInput]](../../models/linkedtaxrateinput.md) | :heavy_minus_sign: | N/A | | +| `total_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The total amount of the expense line item. | 275 | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -190,11 +190,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.expenses.get(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -239,168 +239,166 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.expenses.update(id="", expense={ - "transaction_date": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "account_id": "123456", - "line_items": [ - { - "total_amount": 275, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "account_id": "123456", - "customer_id": "12345", - "department_id": "12345", - "location_id": "12345", - "tax_rate": { + + res = apideck.accounting.expenses.update(id="", transaction_date=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), account_id="123456", line_items=[ + { + "total_amount": 275, + "tracking_categories": [ + { "id": "123456", - "rate": 10, + "name": "New York", }, - "description": "Travel US.", - "billable": True, - }, - { - "total_amount": 275, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "account_id": "123456", - "customer_id": "12345", - "department_id": "12345", - "location_id": "12345", - "tax_rate": { + { "id": "123456", - "rate": 10, + "name": "New York", }, - "description": "Travel US.", - "billable": True, + ], + "account_id": "123456", + "customer_id": "12345", + "department_id": "12345", + "location_id": "12345", + "tax_rate": { + "id": "123456", + "rate": 10, }, - { - "total_amount": 275, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "account_id": "123456", - "customer_id": "12345", - "department_id": "12345", - "location_id": "12345", - "tax_rate": { + "description": "Travel US.", + "billable": True, + }, + { + "total_amount": 275, + "tracking_categories": [ + { "id": "123456", - "rate": 10, + "name": "New York", }, - "description": "Travel US.", - "billable": True, + ], + "account_id": "123456", + "customer_id": "12345", + "department_id": "12345", + "location_id": "12345", + "tax_rate": { + "id": "123456", + "rate": 10, }, - ], - "number": "OIT00546", - "customer_id": "12345", - "supplier_id": "12345", - "company_id": "12345", - "department_id": "12345", - "payment_type": apideck_unify.ExpensePaymentType.CASH, - "currency": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "type": apideck_unify.ExpenseType.EXPENSE, - "memo": "For travel expenses incurred on 2024-05-15", - "tax_rate": { - "id": "123456", - "rate": 10, + "description": "Travel US.", + "billable": True, }, - "total_amount": 275, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": {}, + { + "total_amount": 275, + "tracking_categories": [ + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + ], + "account_id": "123456", + "customer_id": "12345", + "department_id": "12345", + "location_id": "12345", + "tax_rate": { + "id": "123456", + "rate": 10, }, - ], - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + "description": "Travel US.", + "billable": True, + }, + ], service_id="salesforce", number="OIT00546", customer_id="12345", supplier_id="12345", company_id="12345", department_id="12345", payment_type=apideck_unify.ExpensePaymentType.CASH, currency=apideck_unify.Currency.USD, currency_rate=0.69, type_=apideck_unify.ExpenseType.EXPENSE, memo="For travel expenses incurred on 2024-05-15", tax_rate={ + "id": "123456", + "rate": 10, + }, total_amount=275, custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": {}, + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `expense` | [models.ExpenseInput](../../models/expenseinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `account_id` | *str* | :heavy_check_mark: | The unique identifier for the ledger account that this expense should be credited to. | 123456 | +| `line_items` | List[[models.ExpenseLineItemInput](../../models/expenselineiteminput.md)] | :heavy_check_mark: | Expense line items linked to this expense. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Number. | OIT00546 | +| `customer_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. | 12345 | +| `supplier_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the supplier this entity is linked to. | 12345 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `department_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the department this expense is linked to. | 12345 | +| `payment_type` | [OptionalNullable[models.ExpensePaymentType]](../../models/expensepaymenttype.md) | :heavy_minus_sign: | The type of payment for the expense. | cash | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `type` | [OptionalNullable[models.ExpenseType]](../../models/expensetype.md) | :heavy_minus_sign: | The type of expense. | expense | +| `memo` | *OptionalNullable[str]* | :heavy_minus_sign: | The memo of the expense. | For travel expenses incurred on 2024-05-15 | +| `tax_rate` | [Optional[models.LinkedTaxRateInput]](../../models/linkedtaxrateinput.md) | :heavy_minus_sign: | N/A | | +| `total_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The total amount of the expense line item. | 275 | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -432,11 +430,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.expenses.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/files/README.md b/docs/sdks/files/README.md index e8ddef51..9bf2cfb6 100644 --- a/docs/sdks/files/README.md +++ b/docs/sdks/files/README.md @@ -29,35 +29,38 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.files.list(request={ - "service_id": "salesforce", - "filter_": { - "drive_id": "1234", - "folder_id": "root", - "shared": True, - }, - "sort": { - "by": apideck_unify.FilesSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.file_storage.files.list(service_id="salesforce", filter_={ + "drive_id": "1234", + "folder_id": "root", + "shared": True, + }, sort={ + "by": apideck_unify.FilesSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `request` | [models.FileStorageFilesAllRequest](../../models/filestoragefilesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.FilesFilter]](../../models/filesfilter.md) | :heavy_minus_sign: | Apply filters | | +| `sort` | [Optional[models.FilesSort]](../../models/filessort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -89,34 +92,48 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.files.search(request={ - "files_search": { - "query": "logo jpg", - }, - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - "filter_": { - "drive_id": "1234", - "folder_id": "root", - "shared": True, + + res = apideck.file_storage.files.search(query="logo jpg", service_id="salesforce", pass_through_param={ + "search": "San Francisco", + }, fields="id,updated_at", filter_={ + "drive_id": "1234", + "folder_id": "root", + "shared": True, + }, drive_id="1234", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", + }, + }, + }, + ], }, - }) + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `request` | [models.FileStorageFilesSearchRequest](../../models/filestoragefilessearchrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `query` | *str* | :heavy_check_mark: | The query to search for. May match across multiple fields. | logo jpg | +| `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 | +| `pass_through_param` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.FilesFilter]](../../models/filesfilter.md) | :heavy_minus_sign: | Apply filters | | +| `drive_id` | *Optional[str]* | :heavy_minus_sign: | ID of the drive to filter on | 1234 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -148,11 +165,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.files.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -196,92 +213,90 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.files.update(id="", update_file_request={ - "name": "New Name.pdf", - "description": "Renamed PDF Document", - "parent_folder_id": "1234", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.files.update(id="", service_id="salesforce", name="New Name.pdf", description="Renamed PDF Document", parent_folder_id="1234", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `update_file_request` | [models.UpdateFileRequest](../../models/updatefilerequest.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the file. | New Name.pdf | +| `description` | *Optional[str]* | :heavy_minus_sign: | Optional description of the file. | Renamed PDF Document | +| `parent_folder_id` | *Optional[str]* | :heavy_minus_sign: | 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. | 1234 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -313,11 +328,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.files.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -360,11 +375,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.files.download(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -407,11 +422,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.files.export(id="", file_format="pdf", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/folders/README.md b/docs/sdks/folders/README.md index f7e65760..b6f92bf8 100644 --- a/docs/sdks/folders/README.md +++ b/docs/sdks/folders/README.md @@ -26,39 +26,33 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.folders.create(create_folder_request={ - "name": "Documents", - "parent_folder_id": "1234", - "description": "My Personal Documents", - "drive_id": "1234", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.folders.create(name="Documents", parent_folder_id="1234", service_id="salesforce", fields="id,updated_at", description="My Personal Documents", drive_id="1234", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce", fields="id,updated_at") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -66,10 +60,14 @@ with Apideck( | Parameter | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `create_folder_request` | [models.CreateFolderRequest](../../models/createfolderrequest.md) | :heavy_check_mark: | N/A | | +| `name` | *str* | :heavy_check_mark: | The name of the folder. | Documents | +| `parent_folder_id` | *str* | :heavy_check_mark: | 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. | 1234 | | `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | | `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 | | `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `description` | *Optional[str]* | :heavy_minus_sign: | Optional description of the folder. | My Personal Documents | +| `drive_id` | *Optional[str]* | :heavy_minus_sign: | ID of the drive to create the folder in. | 1234 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -102,11 +100,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.folders.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -150,92 +148,90 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.folders.update(id="", update_folder_request={ - "name": "Documents", - "description": "My Personal Documents", - "parent_folder_id": "1234", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.folders.update(id="", service_id="salesforce", name="Documents", description="My Personal Documents", parent_folder_id="1234", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `update_folder_request` | [models.UpdateFolderRequest](../../models/updatefolderrequest.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the folder. | Documents | +| `description` | *Optional[str]* | :heavy_minus_sign: | Optional description of the folder. | My Personal Documents | +| `parent_folder_id` | *Optional[str]* | :heavy_minus_sign: | 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. | 1234 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -267,11 +263,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.folders.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -314,93 +310,90 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.folders.copy(request={ - "id": "", - "copy_folder_request": { - "parent_folder_id": "1234", - "name": "Documents", - "pass_through": [ + + res = apideck.file_storage.folders.copy(id="", parent_folder_id="1234", service_id="salesforce", fields="id,updated_at", name="Documents", pass_through=[ + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, + ], + }, + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, + ], + }, + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, ], }, - "service_id": "salesforce", - "fields": "id,updated_at", - }) + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `request` | [models.FileStorageFoldersCopyRequest](../../models/filestoragefolderscopyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `parent_folder_id` | *str* | :heavy_check_mark: | 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. | 1234 | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the folder. | Documents | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/invoiceitems/README.md b/docs/sdks/invoiceitems/README.md index 9313caaa..e5dbeda0 100644 --- a/docs/sdks/invoiceitems/README.md +++ b/docs/sdks/invoiceitems/README.md @@ -27,30 +27,33 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.invoice_items.list(request={ - "service_id": "salesforce", - "filter_": { - "name": "Widgets Large", - "type": apideck_unify.InvoiceItemType.SERVICE, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.invoice_items.list(service_id="salesforce", filter_={ + "name": "Widgets Large", + "type": apideck_unify.InvoiceItemType.SERVICE, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingInvoiceItemsAllRequest](../../models/accountinginvoiceitemsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.InvoiceItemsFilter]](../../models/invoiceitemsfilter.md) | :heavy_minus_sign: | Apply filters | {
"name": "Widgets Large",
"type": "service"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -84,103 +87,102 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.invoice_items.create(invoice_item={ - "name": "Model Y", - "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", - "code": "120-C", - "sold": True, - "purchased": True, - "tracked": True, - "taxable": True, - "inventory_date": dateutil.parser.parse("2020-10-30").date(), - "type": apideck_unify.InvoiceItemTypeType.INVENTORY, - "sales_details": { - "unit_price": 27500.5, - "unit_of_measure": "pc.", - "tax_inclusive": True, - "tax_rate": { - "id": "123456", - "rate": 10, - }, - }, - "purchase_details": { - "unit_price": 27500.5, - "unit_of_measure": "pc.", - "tax_inclusive": True, - "tax_rate": { - "id": "123456", - "rate": 10, - }, - }, - "quantity": 1, + + res = apideck.accounting.invoice_items.create(service_id="salesforce", name="Model Y", description="Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", code="120-C", sold=True, purchased=True, tracked=True, taxable=True, inventory_date=dateutil.parser.parse("2020-10-30").date(), type_=apideck_unify.InvoiceItemTypeType.INVENTORY, sales_details={ "unit_price": 27500.5, - "asset_account": { + "unit_of_measure": "pc.", + "tax_inclusive": True, + "tax_rate": { "id": "123456", - "nominal_code": "N091", - "code": "453", + "rate": 10, }, - "income_account": { + }, purchase_details={ + "unit_price": 27500.5, + "unit_of_measure": "pc.", + "tax_inclusive": True, + "tax_rate": { "id": "123456", - "nominal_code": "N091", - "code": "453", + "rate": 10, }, - "expense_account": { + }, quantity=1, unit_price=27500.5, asset_account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, income_account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, expense_account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, tracking_categories=[ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "active": True, - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], active=True, row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `invoice_item` | [models.InvoiceItemInput](../../models/invoiceiteminput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Item name | Model Y | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A short description of the item | Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection. | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | User defined item code | 120-C | +| `sold` | *OptionalNullable[bool]* | :heavy_minus_sign: | Item will be available on sales transactions | true | +| `purchased` | *OptionalNullable[bool]* | :heavy_minus_sign: | Item is available for purchase transactions | true | +| `tracked` | *OptionalNullable[bool]* | :heavy_minus_sign: | Item is inventoried | true | +| `taxable` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, transactions for this item are taxable | true | +| `inventory_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date of opening balance if inventory item is tracked - YYYY-MM-DD. | 2020-10-30 | +| `type` | [OptionalNullable[models.InvoiceItemTypeType]](../../models/invoiceitemtypetype.md) | :heavy_minus_sign: | Item type | inventory | +| `sales_details` | [Optional[models.InvoiceItemSalesDetails]](../../models/invoiceitemsalesdetails.md) | :heavy_minus_sign: | N/A | | +| `purchase_details` | [Optional[models.InvoiceItemPurchaseDetails]](../../models/invoiceitempurchasedetails.md) | :heavy_minus_sign: | N/A | | +| `quantity` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | 1 | +| `unit_price` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | 27500.5 | +| `asset_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `income_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `expense_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `tracking_category` | [OptionalNullable[models.DeprecatedLinkedTrackingCategory]](../../models/deprecatedlinkedtrackingcategory.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | true | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -213,27 +215,26 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.invoice_items.get(request={ - "id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - "filter_": { - "type": apideck_unify.InvoiceItemFilterInvoiceItemType.SERVICE, - }, + + res = apideck.accounting.invoice_items.get(id="", service_id="salesforce", fields="id,updated_at", filter_={ + "type": apideck_unify.InvoiceItemFilterInvoiceItemType.SERVICE, }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingInvoiceItemsOneRequest](../../models/accountinginvoiceitemsonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter_` | [Optional[models.InvoiceItemFilter]](../../models/invoiceitemfilter.md) | :heavy_minus_sign: | Apply filters | {
"type": "service"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -267,128 +268,127 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.invoice_items.update(id="", invoice_item={ - "name": "Model Y", - "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", - "code": "120-C", - "sold": True, - "purchased": True, - "tracked": True, - "taxable": True, - "inventory_date": dateutil.parser.parse("2020-10-30").date(), - "type": apideck_unify.InvoiceItemTypeType.INVENTORY, - "sales_details": { - "unit_price": 27500.5, - "unit_of_measure": "pc.", - "tax_inclusive": True, - "tax_rate": { - "id": "123456", - "rate": 10, - }, - }, - "purchase_details": { - "unit_price": 27500.5, - "unit_of_measure": "pc.", - "tax_inclusive": True, - "tax_rate": { - "id": "123456", - "rate": 10, - }, + + res = apideck.accounting.invoice_items.update(id="", service_id="salesforce", name="Model Y", description="Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", code="120-C", sold=True, purchased=True, tracked=True, taxable=True, inventory_date=dateutil.parser.parse("2020-10-30").date(), type_=apideck_unify.InvoiceItemTypeType.INVENTORY, sales_details={ + "unit_price": 27500.5, + "unit_of_measure": "pc.", + "tax_inclusive": True, + "tax_rate": { + "id": "123456", + "rate": 10, }, - "quantity": 1, + }, purchase_details={ "unit_price": 27500.5, - "asset_account": { + "unit_of_measure": "pc.", + "tax_inclusive": True, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + }, quantity=1, unit_price=27500.5, asset_account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, income_account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, expense_account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, tracking_categories=[ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "income_account": { + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "expense_account": { + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "active": True, - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], active=True, row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `invoice_item` | [models.InvoiceItemInput](../../models/invoiceiteminput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Item name | Model Y | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A short description of the item | Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection. | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | User defined item code | 120-C | +| `sold` | *OptionalNullable[bool]* | :heavy_minus_sign: | Item will be available on sales transactions | true | +| `purchased` | *OptionalNullable[bool]* | :heavy_minus_sign: | Item is available for purchase transactions | true | +| `tracked` | *OptionalNullable[bool]* | :heavy_minus_sign: | Item is inventoried | true | +| `taxable` | *OptionalNullable[bool]* | :heavy_minus_sign: | If true, transactions for this item are taxable | true | +| `inventory_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date of opening balance if inventory item is tracked - YYYY-MM-DD. | 2020-10-30 | +| `type` | [OptionalNullable[models.InvoiceItemTypeType]](../../models/invoiceitemtypetype.md) | :heavy_minus_sign: | Item type | inventory | +| `sales_details` | [Optional[models.InvoiceItemSalesDetails]](../../models/invoiceitemsalesdetails.md) | :heavy_minus_sign: | N/A | | +| `purchase_details` | [Optional[models.InvoiceItemPurchaseDetails]](../../models/invoiceitempurchasedetails.md) | :heavy_minus_sign: | N/A | | +| `quantity` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | 1 | +| `unit_price` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | 27500.5 | +| `asset_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `income_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `expense_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `tracking_category` | [OptionalNullable[models.DeprecatedLinkedTrackingCategory]](../../models/deprecatedlinkedtrackingcategory.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | true | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -420,11 +420,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.invoice_items.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/invoices/README.md b/docs/sdks/invoices/README.md index d4a20546..7d11acd4 100644 --- a/docs/sdks/invoices/README.md +++ b/docs/sdks/invoices/README.md @@ -28,35 +28,38 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.invoices.list(request={ - "service_id": "salesforce", - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "created_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "number": "OIT00546", - }, - "sort": { - "by": apideck_unify.InvoicesSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.invoices.list(service_id="salesforce", filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + "created_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + "number": "OIT00546", + }, sort={ + "by": apideck_unify.InvoicesSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `request` | [models.AccountingInvoicesAllRequest](../../models/accountinginvoicesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.InvoicesFilter]](../../models/invoicesfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z",
"created_since": "2020-09-30T07:43:32.000Z",
"number": "OIT00546"
} | +| `sort` | [Optional[models.InvoicesSort]](../../models/invoicessort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -90,281 +93,280 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.invoices.create(invoice={ - "type": apideck_unify.InvoiceType.SERVICE, - "number": "OIT00546", - "customer": { - "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", + + res = apideck.accounting.invoices.create(service_id="salesforce", type_=apideck_unify.InvoiceType.SERVICE, number="OIT00546", customer={ + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, company_id="12345", invoice_date=dateutil.parser.parse("2020-09-30").date(), due_date=dateutil.parser.parse("2020-09-30").date(), terms="Net 30 days", po_number="90000117", reference="123456", status=apideck_unify.InvoiceStatus.DRAFT, invoice_sent=True, currency=apideck_unify.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", }, - "company_id": "12345", - "invoice_date": dateutil.parser.parse("2020-09-30").date(), - "due_date": dateutil.parser.parse("2020-09-30").date(), - "terms": "Net 30 days", - "po_number": "90000117", - "reference": "123456", - "status": apideck_unify.InvoiceStatus.DRAFT, - "invoice_sent": True, - "currency": apideck_unify.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": [ - { + ], 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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_rate": { "id": "123456", - "name": "New York", + "rate": 10, }, - ], - "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { + "tracking_categories": [ + { "id": "123456", - "rate": 10, + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { + ], + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, + }, + ], + "row_version": "1-12345", + }, + { + "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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - ], - "row_version": "1-12345", + ], + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", }, - { - "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": {}, }, - "tax_rate": { - "id": "123456", - "rate": 10, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": {}, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], - "row_version": "1-12345", - }, - ], - "billing_address": { - "id": "123", - "type": apideck_unify.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": apideck_unify.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", + ], billing_address={ + "id": "123", + "type": apideck_unify.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": apideck_unify.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_method="cash", channel="email", language="EN", accounting_by_row=False, bank_account={ + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, ledger_account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": [ + "", + "", + ], }, - "template_id": "123456", - "source_document_url": "https://www.invoicesolution.com/invoice/123456", - "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": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": [ + "", + "", + "", + ], }, - "ledger_account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": [ - "", - "", - ], - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": [ - "", - "", - "", - ], - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - ], - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `invoice` | [models.InvoiceInput](../../models/invoiceinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `type` | [OptionalNullable[models.InvoiceType]](../../models/invoicetype.md) | :heavy_minus_sign: | Invoice type | service | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Invoice number. | OIT00546 | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `invoice_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Date invoice was issued - YYYY-MM-DD. | 2020-09-30 | +| `due_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. | 2020-09-30 | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Terms of payment. | Net 30 days | +| `po_number` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | 90000117 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional invoice reference. | 123456 | +| `status` | [OptionalNullable[models.InvoiceStatus]](../../models/invoicestatus.md) | :heavy_minus_sign: | Invoice status | draft | +| `invoice_sent` | *Optional[bool]* | :heavy_minus_sign: | Invoice sent to contact/customer. | true | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `tax_inclusive` | *OptionalNullable[bool]* | :heavy_minus_sign: | Amounts are including tax | true | +| `sub_total` | *OptionalNullable[float]* | :heavy_minus_sign: | Sub-total amount, normally before tax. | 27500 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this invoice. | 2500 | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `discount_percentage` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount percentage applied to this invoice. | 5.5 | +| `discount_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount amount applied to this invoice. | 25 | +| `total` | *OptionalNullable[float]* | :heavy_minus_sign: | Total amount of invoice, including tax. | 27500 | +| `balance` | *OptionalNullable[float]* | :heavy_minus_sign: | Balance of invoice due. | 27500 | +| `deposit` | *OptionalNullable[float]* | :heavy_minus_sign: | Amount of deposit made to this invoice. | 0 | +| `customer_memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Customer memo | Thank you for your business and have a great day! | +| `tracking_category` | [OptionalNullable[models.DeprecatedLinkedTrackingCategory]](../../models/deprecatedlinkedtrackingcategory.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `line_items` | List[[models.InvoiceLineItemInput](../../models/invoicelineiteminput.md)] | :heavy_minus_sign: | N/A | | +| `billing_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `shipping_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `template_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional invoice template | 123456 | +| `source_document_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. | https://www.invoicesolution.com/invoice/123456 | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `accounting_by_row` | *OptionalNullable[bool]* | :heavy_minus_sign: | 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. | false | +| `bank_account` | [Optional[models.BankAccount]](../../models/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `ledger_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -396,11 +398,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.invoices.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -446,280 +448,279 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.invoices.update(id="", invoice={ - "type": apideck_unify.InvoiceType.SERVICE, - "number": "OIT00546", - "customer": { - "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", + + res = apideck.accounting.invoices.update(id="", service_id="salesforce", type_=apideck_unify.InvoiceType.SERVICE, number="OIT00546", customer={ + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, company_id="12345", invoice_date=dateutil.parser.parse("2020-09-30").date(), due_date=dateutil.parser.parse("2020-09-30").date(), terms="Net 30 days", po_number="90000117", reference="123456", status=apideck_unify.InvoiceStatus.DRAFT, invoice_sent=True, currency=apideck_unify.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", }, - "company_id": "12345", - "invoice_date": dateutil.parser.parse("2020-09-30").date(), - "due_date": dateutil.parser.parse("2020-09-30").date(), - "terms": "Net 30 days", - "po_number": "90000117", - "reference": "123456", - "status": apideck_unify.InvoiceStatus.DRAFT, - "invoice_sent": True, - "currency": apideck_unify.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", + { + "id": "123456", + "name": "New York", + }, + { + "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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", }, - { + "tax_rate": { "id": "123456", - "name": "New York", + "rate": 10, }, - { + "tracking_categories": [ + { + "id": "123456", + "name": "New York", + }, + ], + "ledger_account": { "id": "123456", - "name": "New York", + "nominal_code": "N091", + "code": "453", }, - ], - "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", }, - "tax_rate": { - "id": "123456", - "rate": 10, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": {}, }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": {}, - }, - ], - "row_version": "1-12345", - }, - { - "id": "12345", - "row_id": "12345", + ], + "row_version": "1-12345", + }, + { + "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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { + "id": "123456", + "name": "New York", }, - "tax_rate": { + { "id": "123456", - "rate": 10, + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - ], - "row_version": "1-12345", + ], + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", }, - ], - "billing_address": { - "id": "123", - "type": apideck_unify.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": apideck_unify.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.", + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, + }, + ], "row_version": "1-12345", }, - "template_id": "123456", - "source_document_url": "https://www.invoicesolution.com/invoice/123456", - "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": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - "ledger_account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", - }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": [ - {}, - ], - }, - ], + ], billing_address={ + "id": "123", + "type": apideck_unify.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": apideck_unify.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", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, template_id="123456", source_document_url="https://www.invoicesolution.com/invoice/123456", 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": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, ledger_account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": [ + {}, + ], + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `invoice` | [models.InvoiceInput](../../models/invoiceinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `type` | [OptionalNullable[models.InvoiceType]](../../models/invoicetype.md) | :heavy_minus_sign: | Invoice type | service | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Invoice number. | OIT00546 | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `invoice_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Date invoice was issued - YYYY-MM-DD. | 2020-09-30 | +| `due_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. | 2020-09-30 | +| `terms` | *OptionalNullable[str]* | :heavy_minus_sign: | Terms of payment. | Net 30 days | +| `po_number` | *OptionalNullable[str]* | :heavy_minus_sign: | 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. | 90000117 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional invoice reference. | 123456 | +| `status` | [OptionalNullable[models.InvoiceStatus]](../../models/invoicestatus.md) | :heavy_minus_sign: | Invoice status | draft | +| `invoice_sent` | *Optional[bool]* | :heavy_minus_sign: | Invoice sent to contact/customer. | true | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `tax_inclusive` | *OptionalNullable[bool]* | :heavy_minus_sign: | Amounts are including tax | true | +| `sub_total` | *OptionalNullable[float]* | :heavy_minus_sign: | Sub-total amount, normally before tax. | 27500 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this invoice. | 2500 | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `discount_percentage` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount percentage applied to this invoice. | 5.5 | +| `discount_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount amount applied to this invoice. | 25 | +| `total` | *OptionalNullable[float]* | :heavy_minus_sign: | Total amount of invoice, including tax. | 27500 | +| `balance` | *OptionalNullable[float]* | :heavy_minus_sign: | Balance of invoice due. | 27500 | +| `deposit` | *OptionalNullable[float]* | :heavy_minus_sign: | Amount of deposit made to this invoice. | 0 | +| `customer_memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Customer memo | Thank you for your business and have a great day! | +| `tracking_category` | [OptionalNullable[models.DeprecatedLinkedTrackingCategory]](../../models/deprecatedlinkedtrackingcategory.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `line_items` | List[[models.InvoiceLineItemInput](../../models/invoicelineiteminput.md)] | :heavy_minus_sign: | N/A | | +| `billing_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `shipping_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `template_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional invoice template | 123456 | +| `source_document_url` | *OptionalNullable[str]* | :heavy_minus_sign: | URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. | https://www.invoicesolution.com/invoice/123456 | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `accounting_by_row` | *OptionalNullable[bool]* | :heavy_minus_sign: | 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. | false | +| `bank_account` | [Optional[models.BankAccount]](../../models/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `ledger_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -751,11 +752,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.invoices.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/jobs/README.md b/docs/sdks/jobs/README.md index 435c5794..2081d96d 100644 --- a/docs/sdks/jobs/README.md +++ b/docs/sdks/jobs/README.md @@ -23,26 +23,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ats.jobs.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.ats.jobs.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `request` | [models.AtsJobsAllRequest](../../models/atsjobsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -74,11 +77,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ats.jobs.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/journalentries/README.md b/docs/sdks/journalentries/README.md index 60d4c774..2a3ff754 100644 --- a/docs/sdks/journalentries/README.md +++ b/docs/sdks/journalentries/README.md @@ -28,33 +28,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.journal_entries.list(request={ - "service_id": "salesforce", - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.JournalEntriesSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.journal_entries.list(service_id="salesforce", filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.JournalEntriesSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingJournalEntriesAllRequest](../../models/accountingjournalentriesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.JournalEntriesFilter]](../../models/journalentriesfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.JournalEntriesSort]](../../models/journalentriessort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -88,120 +91,118 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.journal_entries.create(journal_entry={ - "title": "Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry", - "currency_rate": 0.69, - "currency": apideck_unify.Currency.USD, - "company_id": "12345", - "line_items": [ - { - "type": apideck_unify.JournalEntryLineItemType.DEBIT, - "ledger_account": { + + res = apideck.accounting.journal_entries.create(service_id="salesforce", title="Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry", currency_rate=0.69, currency=apideck_unify.Currency.USD, company_id="12345", line_items=[ + { + "type": apideck_unify.JournalEntryLineItemType.DEBIT, + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", + "tax_amount": 27500, + "sub_total": 27500, + "total_amount": 27500, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", - "tax_amount": 27500, - "sub_total": 27500, - "total_amount": 27500, - "tax_rate": { + { "id": "123456", - "rate": 10, + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "customer": { - "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", - }, - "supplier": { - "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - }, - }, - "line_number": 1, + ], + "customer": { + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", }, - ], - "memo": "Thank you for your business and have a great day!", - "posted_at": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "journal_symbol": "IND", - "tax_type": "sales", - "tax_code": "1234", - "number": "OIT00546", - "tracking_categories": [ - { - "id": "123456", - "name": "New York", + "supplier": { + "id": "12345", + "display_name": "Windsurf Shop", + "address": { + "id": "123", + "type": apideck_unify.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", + }, }, - ], - "accounting_period": "01-24", - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + "line_number": 1, + }, + ], memo="Thank you for your business and have a great day!", posted_at=dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), journal_symbol="IND", tax_type="sales", tax_code="1234", number="OIT00546", tracking_categories=[ + { + "id": "123456", + "name": "New York", + }, + ], accounting_period="01-24", row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `journal_entry` | [models.JournalEntryInput](../../models/journalentryinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal entry title | Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `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 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `line_items` | List[[models.JournalEntryLineItemInput](../../models/journalentrylineiteminput.md)] | :heavy_minus_sign: | Requires a minimum of 2 line items that sum to 0 | | +| `memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference for the journal entry. | Thank you for your business and have a great day! | +| `posted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. | 2020-09-30T07:43:32.000Z | +| `journal_symbol` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal symbol of the entry. For example IND for indirect costs | IND | +| `tax_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The specific category of tax associated with a transaction like sales or purchase | sales | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal entry number. | OIT00546 | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `accounting_period` | *OptionalNullable[str]* | :heavy_minus_sign: | Accounting period | 01-24 | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -233,11 +234,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.journal_entries.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -283,265 +284,263 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.journal_entries.update(id="", journal_entry={ - "title": "Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry", - "currency_rate": 0.69, - "currency": apideck_unify.Currency.USD, - "company_id": "12345", - "line_items": [ - { - "type": apideck_unify.JournalEntryLineItemType.DEBIT, - "ledger_account": { + + res = apideck.accounting.journal_entries.update(id="", service_id="salesforce", title="Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry", currency_rate=0.69, currency=apideck_unify.Currency.USD, company_id="12345", line_items=[ + { + "type": apideck_unify.JournalEntryLineItemType.DEBIT, + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", + "tax_amount": 27500, + "sub_total": 27500, + "total_amount": 27500, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", - "tax_amount": 27500, - "sub_total": 27500, - "total_amount": 27500, - "tax_rate": { + { "id": "123456", - "rate": 10, + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "customer": { - "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", - }, - "supplier": { - "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - }, - }, - "line_number": 1, + ], + "customer": { + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", }, - { - "type": apideck_unify.JournalEntryLineItemType.DEBIT, - "ledger_account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + "supplier": { + "id": "12345", + "display_name": "Windsurf Shop", + "address": { + "id": "123", + "type": apideck_unify.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", }, - "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", - "tax_amount": 27500, - "sub_total": 27500, - "total_amount": 27500, - "tax_rate": { + }, + "line_number": 1, + }, + { + "type": apideck_unify.JournalEntryLineItemType.DEBIT, + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", + "tax_amount": 27500, + "sub_total": 27500, + "total_amount": 27500, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { "id": "123456", - "rate": 10, + "name": "New York", }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - ], - "customer": { - "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", - }, - "supplier": { - "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - }, + ], + "customer": { + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, + "supplier": { + "id": "12345", + "display_name": "Windsurf Shop", + "address": { + "id": "123", + "type": apideck_unify.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", }, - "line_number": 1, }, - { - "type": apideck_unify.JournalEntryLineItemType.DEBIT, - "ledger_account": { + "line_number": 1, + }, + { + "type": apideck_unify.JournalEntryLineItemType.DEBIT, + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", + "tax_amount": 27500, + "sub_total": 27500, + "total_amount": 27500, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", - "tax_amount": 27500, - "sub_total": 27500, - "total_amount": 27500, - "tax_rate": { + { "id": "123456", - "rate": 10, - }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "customer": { - "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", + "name": "New York", }, - "supplier": { - "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - }, + { + "id": "123456", + "name": "New York", }, - "line_number": 1, - }, - ], - "memo": "Thank you for your business and have a great day!", - "posted_at": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "journal_symbol": "IND", - "tax_type": "sales", - "tax_code": "1234", - "number": "OIT00546", - "tracking_categories": [ - { - "id": "123456", - "name": "New York", + ], + "customer": { + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", }, - { - "id": "123456", - "name": "New York", + "supplier": { + "id": "12345", + "display_name": "Windsurf Shop", + "address": { + "id": "123", + "type": apideck_unify.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", + }, }, - ], - "accounting_period": "01-24", - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + "line_number": 1, + }, + ], memo="Thank you for your business and have a great day!", posted_at=dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), journal_symbol="IND", tax_type="sales", tax_code="1234", number="OIT00546", tracking_categories=[ + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + ], accounting_period="01-24", row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `journal_entry` | [models.JournalEntryInput](../../models/journalentryinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal entry title | Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `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 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `line_items` | List[[models.JournalEntryLineItemInput](../../models/journalentrylineiteminput.md)] | :heavy_minus_sign: | Requires a minimum of 2 line items that sum to 0 | | +| `memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference for the journal entry. | Thank you for your business and have a great day! | +| `posted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. | 2020-09-30T07:43:32.000Z | +| `journal_symbol` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal symbol of the entry. For example IND for indirect costs | IND | +| `tax_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The specific category of tax associated with a transaction like sales or purchase | sales | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal entry number. | OIT00546 | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `accounting_period` | *OptionalNullable[str]* | :heavy_minus_sign: | Accounting period | 01-24 | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -573,11 +572,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.journal_entries.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/leads/README.md b/docs/sdks/leads/README.md index 50d5f188..8c398241 100644 --- a/docs/sdks/leads/README.md +++ b/docs/sdks/leads/README.md @@ -27,36 +27,39 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.leads.list(request={ - "service_id": "salesforce", - "filter_": { - "first_name": "Elon", - "last_name": "Musk", - "email": "elon@tesla.com", - "phone_number": "1234567890", - }, - "sort": { - "by": apideck_unify.LeadsSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.crm.leads.list(service_id="salesforce", filter_={ + "first_name": "Elon", + "last_name": "Musk", + "email": "elon@tesla.com", + "phone_number": "1234567890", + }, sort={ + "by": apideck_unify.LeadsSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `request` | [models.CrmLeadsAllRequest](../../models/crmleadsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.LeadsFilter]](../../models/leadsfilter.md) | :heavy_minus_sign: | Apply filters | {
"first_name": "Elon",
"last_name": "Musk",
"email": "elon@tesla.com",
"phone_number": "1234567890"
} | +| `sort` | [Optional[models.LeadsSort]](../../models/leadssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -89,229 +92,227 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.leads.create(lead={ - "name": "Elon Musk", - "company_name": "Spacex", - "owner_id": "54321", - "owner_name": "John Doe", - "company_id": "2", - "lead_id": "2", - "lead_source": "Cold Call", - "first_name": "Elon", - "last_name": "Musk", - "description": "A thinker", - "prefix": "Sir", - "title": "CEO", - "language": "EN", - "status": "New", - "monetary_amount": 75000, - "currency": apideck_unify.Currency.USD, - "fax": "+12129876543", - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": {}, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], - "tags": [ - "New", - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.leads.create(name="Elon Musk", company_name="Spacex", service_id="salesforce", owner_id="54321", owner_name="John Doe", company_id="2", lead_id="2", lead_source="Cold Call", first_name="Elon", last_name="Musk", description="A thinker", prefix="Sir", title="CEO", language="EN", status="New", monetary_amount=75000, currency=apideck_unify.Currency.USD, fax="+12129876543", websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": {}, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], tags=[ + "New", + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `lead` | [models.LeadInput](../../models/leadinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Full name of the lead. | Elon Musk | +| `company_name` | *Nullable[str]* | :heavy_check_mark: | The name of the company the lead is associated with. | Spacex | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The owner of the lead. | 54321 | +| `owner_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the owner of the lead. | John Doe | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company the lead is associated with. | 2 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The identifier of the lead. | 2 | +| `lead_source` | *OptionalNullable[str]* | :heavy_minus_sign: | The source of the lead. | Cold Call | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the lead. | Elon | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the lead. | Musk | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the lead. | A thinker | +| `prefix` | *OptionalNullable[str]* | :heavy_minus_sign: | The prefix of the lead. | Sir | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the lead. | CEO | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | New | +| `monetary_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The monetary amount of the lead. | 75000 | +| `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 | +| `fax` | *OptionalNullable[str]* | :heavy_minus_sign: | The fax number of the lead. | +12129876543 | +| `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 | | +| `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_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -343,11 +344,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.leads.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -392,209 +393,207 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.leads.update(id="", lead={ - "name": "Elon Musk", - "company_name": "Spacex", - "owner_id": "54321", - "owner_name": "John Doe", - "company_id": "2", - "lead_id": "2", - "lead_source": "Cold Call", - "first_name": "Elon", - "last_name": "Musk", - "description": "A thinker", - "prefix": "Sir", - "title": "CEO", - "language": "EN", - "status": "New", - "monetary_amount": 75000, - "currency": apideck_unify.Currency.USD, - "fax": "+12129876543", - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "social_links": [ - { - "url": "https://www.twitter.com/apideck", - "id": "12345", - "type": "twitter", - }, - ], - "phone_numbers": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": {}, - }, - ], - "tags": [ - "New", - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.leads.update(id="", name="Elon Musk", company_name="Spacex", service_id="salesforce", owner_id="54321", owner_name="John Doe", company_id="2", lead_id="2", lead_source="Cold Call", first_name="Elon", last_name="Musk", description="A thinker", prefix="Sir", title="CEO", language="EN", status="New", monetary_amount=75000, currency=apideck_unify.Currency.USD, fax="+12129876543", websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + ], social_links=[ + { + "url": "https://www.twitter.com/apideck", + "id": "12345", + "type": "twitter", + }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": {}, + }, + ], tags=[ + "New", + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `lead` | [models.LeadInput](../../models/leadinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `name` | *str* | :heavy_check_mark: | Full name of the lead. | Elon Musk | +| `company_name` | *Nullable[str]* | :heavy_check_mark: | The name of the company the lead is associated with. | Spacex | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The owner of the lead. | 54321 | +| `owner_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the owner of the lead. | John Doe | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company the lead is associated with. | 2 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The identifier of the lead. | 2 | +| `lead_source` | *OptionalNullable[str]* | :heavy_minus_sign: | The source of the lead. | Cold Call | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the lead. | Elon | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the lead. | Musk | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the lead. | A thinker | +| `prefix` | *OptionalNullable[str]* | :heavy_minus_sign: | The prefix of the lead. | Sir | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the lead. | CEO | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | New | +| `monetary_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The monetary amount of the lead. | 75000 | +| `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 | +| `fax` | *OptionalNullable[str]* | :heavy_minus_sign: | The fax number of the lead. | +12129876543 | +| `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 | | +| `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_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -626,11 +625,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.leads.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/ledgeraccounts/README.md b/docs/sdks/ledgeraccounts/README.md index fdb2cac0..73e445a9 100644 --- a/docs/sdks/ledgeraccounts/README.md +++ b/docs/sdks/ledgeraccounts/README.md @@ -28,33 +28,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.ledger_accounts.list(request={ - "service_id": "salesforce", - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.LedgerAccountsSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.ledger_accounts.list(service_id="salesforce", filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.LedgerAccountsSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingLedgerAccountsAllRequest](../../models/accountingledgeraccountsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.LedgerAccountsFilter]](../../models/ledgeraccountsfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.LedgerAccountsSort]](../../models/ledgeraccountssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -88,87 +91,87 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.ledger_accounts.create(ledger_account={ - "display_id": "1-12345", - "code": "453", - "classification": apideck_unify.Classification.ASSET, - "type": apideck_unify.LedgerAccountType.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, + + res = apideck.accounting.ledger_accounts.create(service_id="salesforce", display_id="1-12345", code="453", classification=apideck_unify.Classification.ASSET, type_=apideck_unify.LedgerAccountType.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=apideck_unify.Currency.USD, tax_type="NONE", tax_rate={ + "id": "123456", + "rate": 10, + }, level=1, active=True, status=apideck_unify.AccountStatus.ACTIVE, header=True, bank_account={ + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", "currency": apideck_unify.Currency.USD, - "tax_type": "NONE", - "tax_rate": { - "id": "123456", - "rate": 10, - }, - "level": 1, - "active": True, - "status": apideck_unify.AccountStatus.ACTIVE, - "header": True, - "bank_account": { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - "parent_account": { - "id": "12345", - "name": "Bank Accounts", - "display_id": "1-1100", - }, - "sub_account": False, - "last_reconciliation_date": dateutil.parser.parse("2020-09-30").date(), - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, parent_account={ + "id": "12345", + "name": "Bank Accounts", + "display_id": "1-1100", + }, sub_account=False, last_reconciliation_date=dateutil.parser.parse("2020-09-30").date(), row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `ledger_account` | [models.LedgerAccountInput](../../models/ledgeraccountinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `display_id` | *Optional[str]* | :heavy_minus_sign: | The human readable display ID used when displaying the account | 1-12345 | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The nominal code of the ledger account. | N091 | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | The code assigned to the account. | 453 | +| `classification` | [OptionalNullable[models.Classification]](../../models/classification.md) | :heavy_minus_sign: | The classification of account. | asset | +| `type` | [Optional[models.LedgerAccountType]](../../models/ledgeraccounttype.md) | :heavy_minus_sign: | The type of account. | bank | +| `sub_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The sub type of account. | CHECKING_ACCOUNT | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the account. | Bank account | +| `fully_qualified_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The fully qualified name of the account. | Asset.Bank.Checking_Account | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the account. | Main checking account | +| `opening_balance` | *OptionalNullable[float]* | :heavy_minus_sign: | The opening balance of the account. | 75000 | +| `current_balance` | *OptionalNullable[float]* | :heavy_minus_sign: | The current balance of the account. | 20000 | +| `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 | +| `tax_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The tax type of the account. | NONE | +| `tax_rate` | [Optional[models.LinkedTaxRateInput]](../../models/linkedtaxrateinput.md) | :heavy_minus_sign: | N/A | | +| `level` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | 1 | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the account is active or not. | true | +| `status` | [OptionalNullable[models.AccountStatus]](../../models/accountstatus.md) | :heavy_minus_sign: | The status of the account. | active | +| `header` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the account is a header or not. | true | +| `bank_account` | [Optional[models.BankAccount]](../../models/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `parent_account` | [Optional[models.ParentAccount]](../../models/parentaccount.md) | :heavy_minus_sign: | N/A | | +| `sub_account` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the account is a sub account or not. | false | +| `last_reconciliation_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Reconciliation Date means the last calendar day of each Reconciliation Period. | 2020-09-30 | +| `subsidiaries` | List[[models.LedgerAccountSubsidiaries](../../models/ledgeraccountsubsidiaries.md)] | :heavy_minus_sign: | The subsidiaries the account belongs to. | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -200,11 +203,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.ledger_accounts.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -250,130 +253,130 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.ledger_accounts.update(id="", ledger_account={ - "display_id": "1-12345", - "code": "453", - "classification": apideck_unify.Classification.ASSET, - "type": apideck_unify.LedgerAccountType.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, + + res = apideck.accounting.ledger_accounts.update(id="", service_id="salesforce", display_id="1-12345", code="453", classification=apideck_unify.Classification.ASSET, type_=apideck_unify.LedgerAccountType.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=apideck_unify.Currency.USD, tax_type="NONE", tax_rate={ + "id": "123456", + "rate": 10, + }, level=1, active=True, status=apideck_unify.AccountStatus.ACTIVE, header=True, bank_account={ + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", "currency": apideck_unify.Currency.USD, - "tax_type": "NONE", - "tax_rate": { - "id": "123456", - "rate": 10, - }, - "level": 1, - "active": True, - "status": apideck_unify.AccountStatus.ACTIVE, - "header": True, - "bank_account": { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - "parent_account": { - "id": "12345", - "name": "Bank Accounts", - "display_id": "1-1100", - }, - "sub_account": False, - "last_reconciliation_date": dateutil.parser.parse("2020-09-30").date(), - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, parent_account={ + "id": "12345", + "name": "Bank Accounts", + "display_id": "1-1100", + }, sub_account=False, last_reconciliation_date=dateutil.parser.parse("2020-09-30").date(), row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `ledger_account` | [models.LedgerAccountInput](../../models/ledgeraccountinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `display_id` | *Optional[str]* | :heavy_minus_sign: | The human readable display ID used when displaying the account | 1-12345 | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The nominal code of the ledger account. | N091 | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | The code assigned to the account. | 453 | +| `classification` | [OptionalNullable[models.Classification]](../../models/classification.md) | :heavy_minus_sign: | The classification of account. | asset | +| `type` | [Optional[models.LedgerAccountType]](../../models/ledgeraccounttype.md) | :heavy_minus_sign: | The type of account. | bank | +| `sub_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The sub type of account. | CHECKING_ACCOUNT | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the account. | Bank account | +| `fully_qualified_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The fully qualified name of the account. | Asset.Bank.Checking_Account | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | The description of the account. | Main checking account | +| `opening_balance` | *OptionalNullable[float]* | :heavy_minus_sign: | The opening balance of the account. | 75000 | +| `current_balance` | *OptionalNullable[float]* | :heavy_minus_sign: | The current balance of the account. | 20000 | +| `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 | +| `tax_type` | *OptionalNullable[str]* | :heavy_minus_sign: | The tax type of the account. | NONE | +| `tax_rate` | [Optional[models.LinkedTaxRateInput]](../../models/linkedtaxrateinput.md) | :heavy_minus_sign: | N/A | | +| `level` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | 1 | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the account is active or not. | true | +| `status` | [OptionalNullable[models.AccountStatus]](../../models/accountstatus.md) | :heavy_minus_sign: | The status of the account. | active | +| `header` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the account is a header or not. | true | +| `bank_account` | [Optional[models.BankAccount]](../../models/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `parent_account` | [Optional[models.ParentAccount]](../../models/parentaccount.md) | :heavy_minus_sign: | N/A | | +| `sub_account` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the account is a sub account or not. | false | +| `last_reconciliation_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Reconciliation Date means the last calendar day of each Reconciliation Period. | 2020-09-30 | +| `subsidiaries` | List[[models.LedgerAccountSubsidiaries](../../models/ledgeraccountsubsidiaries.md)] | :heavy_minus_sign: | The subsidiaries the account belongs to. | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -405,11 +408,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.ledger_accounts.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/locations/README.md b/docs/sdks/locations/README.md index f21484ef..ec418ba2 100644 --- a/docs/sdks/locations/README.md +++ b/docs/sdks/locations/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.locations.list(request={ - "service_id": "salesforce", - "fields": "id,updated_at", - "filter_": { - "subsidiary": "1", - }, + + res = apideck.accounting.locations.list(service_id="salesforce", fields="id,updated_at", filter_={ + "subsidiary": "1", }) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `request` | [models.AccountingLocationsAllRequest](../../models/accountinglocationsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter_` | [Optional[models.AccountingLocationsFilter]](../../models/accountinglocationsfilter.md) | :heavy_minus_sign: | Apply filters | {
"subsidiary": "1"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,79 +81,77 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.locations.create(accounting_location={ - "parent_id": "12345", - "company_name": "SpaceX", - "display_name": "11 UT - South Jordan", - "status": apideck_unify.LocationStatus.ACTIVE, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "subsidiaries": [ - { - "name": "SpaceX", - }, - { - "name": "SpaceX", - }, - ], - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.locations.create(service_id="salesforce", parent_id="12345", company_name="SpaceX", display_name="11 UT - South Jordan", status=apideck_unify.LocationStatus.ACTIVE, addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + ], subsidiaries=[ + { + "name": "SpaceX", + }, + { + "name": "SpaceX", + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `accounting_location` | [models.AccountingLocationInput](../../models/accountinglocationinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The display name of the location. | 11 UT - South Jordan | +| `status` | [Optional[models.LocationStatus]](../../models/locationstatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `subsidiaries` | List[[models.SubsidiaryReferenceInput](../../models/subsidiaryreferenceinput.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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -182,11 +183,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.locations.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -231,148 +232,146 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.locations.update(id="", accounting_location={ - "parent_id": "12345", - "company_name": "SpaceX", - "display_name": "11 UT - South Jordan", - "status": apideck_unify.LocationStatus.ACTIVE, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - ], - "subsidiaries": [ - { - "name": "SpaceX", - }, - { - "name": "SpaceX", - }, - ], - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.locations.update(id="", service_id="salesforce", parent_id="12345", company_name="SpaceX", display_name="11 UT - South Jordan", status=apideck_unify.LocationStatus.ACTIVE, addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + ], subsidiaries=[ + { + "name": "SpaceX", + }, + { + "name": "SpaceX", + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `accounting_location` | [models.AccountingLocationInput](../../models/accountinglocationinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The display name of the location. | 11 UT - South Jordan | +| `status` | [Optional[models.LocationStatus]](../../models/locationstatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `subsidiaries` | List[[models.SubsidiaryReferenceInput](../../models/subsidiaryreferenceinput.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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -404,11 +403,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.locations.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/logs/README.md b/docs/sdks/logs/README.md index b2d37781..9d85f413 100644 --- a/docs/sdks/logs/README.md +++ b/docs/sdks/logs/README.md @@ -23,15 +23,17 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.logs.list(filter_={ "connector_id": "crm+salesforce", "status_code": 201, "exclude_unified_apis": "vault,proxy", }) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` diff --git a/docs/sdks/messages/README.md b/docs/sdks/messages/README.md index 084563d6..7a3b0c1e 100644 --- a/docs/sdks/messages/README.md +++ b/docs/sdks/messages/README.md @@ -26,23 +26,26 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.sms.messages.list(request={ - "service_id": "salesforce", - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.sms.messages.list(service_id="salesforce", fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `request` | [models.SmsMessagesAllRequest](../../models/smsmessagesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -76,55 +79,53 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.sms.messages.create(message={ - "from_": "+15017122661", - "to": "+15017122662", - "body": "Hi! How are you doing?", - "subject": "Picture", - "type": apideck_unify.MessageType.SMS, - "scheduled_at": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "webhook_url": "https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms", - "reference": "CUST001", - "messaging_service_id": "123456", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.sms.messages.create(from_="+15017122661", to="+15017122662", body="Hi! How are you doing?", service_id="salesforce", subject="Picture", type_=apideck_unify.MessageType.SMS, scheduled_at=dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), webhook_url="https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms", reference="CUST001", messaging_service_id="123456", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `message` | [models.MessageInput](../../models/messageinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `from_` | *str* | :heavy_check_mark: | The phone number that initiated the message. | +15017122661 | +| `to` | *str* | :heavy_check_mark: | The phone number that received the message. | +15017122662 | +| `body` | *str* | :heavy_check_mark: | The message text. | Hi! How are you doing? | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `subject` | *Optional[str]* | :heavy_minus_sign: | N/A | Picture | +| `type` | [Optional[models.MessageType]](../../models/messagetype.md) | :heavy_minus_sign: | Set to sms for SMS messages and mms for MMS messages. | sms | +| `scheduled_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The scheduled date and time of the message. | 2020-09-30T07:43:32.000Z | +| `webhook_url` | *Optional[str]* | :heavy_minus_sign: | Define a webhook to receive delivery notifications. | https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms | +| `reference` | *Optional[str]* | :heavy_minus_sign: | A client reference. | CUST001 | +| `messaging_service_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. | 123456 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -156,11 +157,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.sms.messages.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -206,98 +207,96 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.sms.messages.update(id="", message={ - "from_": "+15017122661", - "to": "+15017122662", - "body": "Hi! How are you doing?", - "subject": "Picture", - "type": apideck_unify.MessageType.SMS, - "scheduled_at": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "webhook_url": "https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms", - "reference": "CUST001", - "messaging_service_id": "123456", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.sms.messages.update(id="", from_="+15017122661", to="+15017122662", body="Hi! How are you doing?", service_id="salesforce", subject="Picture", type_=apideck_unify.MessageType.SMS, scheduled_at=dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), webhook_url="https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms", reference="CUST001", messaging_service_id="123456", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `message` | [models.MessageInput](../../models/messageinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `from_` | *str* | :heavy_check_mark: | The phone number that initiated the message. | +15017122661 | +| `to` | *str* | :heavy_check_mark: | The phone number that received the message. | +15017122662 | +| `body` | *str* | :heavy_check_mark: | The message text. | Hi! How are you doing? | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `subject` | *Optional[str]* | :heavy_minus_sign: | N/A | Picture | +| `type` | [Optional[models.MessageType]](../../models/messagetype.md) | :heavy_minus_sign: | Set to sms for SMS messages and mms for MMS messages. | sms | +| `scheduled_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The scheduled date and time of the message. | 2020-09-30T07:43:32.000Z | +| `webhook_url` | *Optional[str]* | :heavy_minus_sign: | Define a webhook to receive delivery notifications. | https://unify.apideck.com/webhook/webhooks/eyz329dkffdl4949/x/sms | +| `reference` | *Optional[str]* | :heavy_minus_sign: | A client reference. | CUST001 | +| `messaging_service_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. | 123456 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -329,11 +328,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.sms.messages.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/notes/README.md b/docs/sdks/notes/README.md index 9e3a5654..a779dc90 100644 --- a/docs/sdks/notes/README.md +++ b/docs/sdks/notes/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.notes.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.crm.notes.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `request` | [models.CrmNotesAllRequest](../../models/crmnotesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -77,54 +80,52 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.notes.create(note={ - "title": "Meeting Notes", - "content": "Office hours are 9AM-6PM", - "owner_id": "12345", - "contact_id": "12345", - "company_id": "12345", - "opportunity_id": "12345", - "lead_id": "12345", - "active": True, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.notes.create(service_id="salesforce", title="Meeting Notes", content="Office hours are 9AM-6PM", owner_id="12345", contact_id="12345", company_id="12345", opportunity_id="12345", lead_id="12345", active=True, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `note` | [models.NoteInput](../../models/noteinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The title of the note | Meeting Notes | +| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | The content of the note. | Office hours are 9AM-6PM | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The user that owns the note. | 12345 | +| `contact_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The contact that is related to the note. | 12345 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company that is related to the note. | 12345 | +| `opportunity_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The opportunity that is related to the note. | 12345 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The lead that is related to the note. | 12345 | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Note is active or not. | true | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -156,11 +157,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.notes.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -204,97 +205,95 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.notes.update(id="", note={ - "title": "Meeting Notes", - "content": "Office hours are 9AM-6PM", - "owner_id": "12345", - "contact_id": "12345", - "company_id": "12345", - "opportunity_id": "12345", - "lead_id": "12345", - "active": True, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.notes.update(id="", service_id="salesforce", title="Meeting Notes", content="Office hours are 9AM-6PM", owner_id="12345", contact_id="12345", company_id="12345", opportunity_id="12345", lead_id="12345", active=True, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `note` | [models.NoteInput](../../models/noteinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The title of the note | Meeting Notes | +| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | The content of the note. | Office hours are 9AM-6PM | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The user that owns the note. | 12345 | +| `contact_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The contact that is related to the note. | 12345 | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company that is related to the note. | 12345 | +| `opportunity_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The opportunity that is related to the note. | 12345 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The lead that is related to the note. | 12345 | +| `active` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether the Note is active or not. | true | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -326,11 +325,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.notes.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/opportunities/README.md b/docs/sdks/opportunities/README.md index 7e672913..ffb88286 100644 --- a/docs/sdks/opportunities/README.md +++ b/docs/sdks/opportunities/README.md @@ -27,34 +27,37 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.opportunities.list(request={ - "service_id": "salesforce", - "filter_": { - "status": "Completed", - "monetary_amount": 75000, - }, - "sort": { - "by": apideck_unify.OpportunitiesSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.crm.opportunities.list(service_id="salesforce", filter_={ + "status": "Completed", + "monetary_amount": 75000, + }, sort={ + "by": apideck_unify.OpportunitiesSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `request` | [models.CrmOpportunitiesAllRequest](../../models/crmopportunitiesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.OpportunitiesFilter]](../../models/opportunitiesfilter.md) | :heavy_minus_sign: | Apply filters | {
"status": "Completed",
"monetary_amount": 75000
} | +| `sort` | [Optional[models.OpportunitiesSort]](../../models/opportunitiessort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -88,76 +91,74 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.opportunities.create(opportunity={ - "title": "New Rocket", - "primary_contact_id": "12345", - "description": "Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines.", - "type": "Existing Customer - Upgrade", - "monetary_amount": 75000, - "currency": apideck_unify.Currency.USD, - "win_probability": 40, - "close_date": dateutil.parser.parse("2020-10-30").date(), - "loss_reason_id": "12345", - "loss_reason": "No budget", - "won_reason_id": "12345", - "won_reason": "Best pitch", - "pipeline_id": "12345", - "pipeline_stage_id": "12345", - "source_id": "12345", - "lead_id": "12345", - "lead_source": "Website", - "contact_id": "12345", - "contact_ids": [ - "12345", - ], - "company_id": "12345", - "company_name": "Copper", - "owner_id": "12345", - "priority": "None", - "status": "Open", - "status_id": "12345", - "tags": [ - "New", - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "stage_last_changed_at": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.opportunities.create(title="New Rocket", primary_contact_id="12345", service_id="salesforce", description="Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines.", type_="Existing Customer - Upgrade", monetary_amount=75000, currency=apideck_unify.Currency.USD, win_probability=40, close_date=dateutil.parser.parse("2020-10-30").date(), loss_reason_id="12345", loss_reason="No budget", won_reason_id="12345", won_reason="Best pitch", pipeline_id="12345", pipeline_stage_id="12345", source_id="12345", lead_id="12345", lead_source="Website", contact_id="12345", contact_ids=[ + "12345", + ], company_id="12345", company_name="Copper", owner_id="12345", priority="None", status="Open", status_id="12345", tags=[ + "New", + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + ], stage_last_changed_at=dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `opportunity` | [models.OpportunityInput](../../models/opportunityinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `title` | *str* | :heavy_check_mark: | The title or name of the opportunity. | New Rocket | +| `primary_contact_id` | *Nullable[str]* | :heavy_check_mark: | The unique identifier of the primary contact associated with the opportunity. | 12345 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the opportunity. | Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines. | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the opportunity | Existing Customer - Upgrade | +| `monetary_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The monetary value associated with the opportunity | 75000 | +| `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 | +| `win_probability` | *OptionalNullable[float]* | :heavy_minus_sign: | The probability of winning the opportunity, expressed as a percentage. | 40 | +| `close_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. | 2020-10-30 | +| `loss_reason_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the reason why the opportunity was lost. | 12345 | +| `loss_reason` | *OptionalNullable[str]* | :heavy_minus_sign: | The reason why the opportunity was lost. | No budget | +| `won_reason_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the reason why the opportunity was won. | 12345 | +| `won_reason` | *OptionalNullable[str]* | :heavy_minus_sign: | The reason why the opportunity was won. | Best pitch | +| `pipeline_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the pipeline associated with the opportunity | 12345 | +| `pipeline_stage_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the stage in the pipeline associated with the opportunity. | 12345 | +| `source_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the source of the opportunity. | 12345 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the lead associated with the opportunity. | 12345 | +| `lead_source` | *OptionalNullable[str]* | :heavy_minus_sign: | The source of the lead associated with the opportunity. | Website | +| `contact_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the contact associated with the opportunity. | 12345 | +| `contact_ids` | List[*str*] | :heavy_minus_sign: | An array of unique identifiers of all contacts associated with the opportunity. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the company associated with the opportunity. | 12345 | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company associated with the opportunity. | Copper | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the user who owns the opportunity. | 12345 | +| `priority` | *OptionalNullable[str]* | :heavy_minus_sign: | The priority level of the opportunity. | None | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | The current status of the opportunity. | Open | +| `status_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the current status of the opportunity. | 12345 | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `stage_last_changed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date and time when the stage of the opportunity was last changed. | 2020-09-30T07:43:32.000Z | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -189,11 +190,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.opportunities.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -239,104 +240,102 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.opportunities.update(id="", opportunity={ - "title": "New Rocket", - "primary_contact_id": "12345", - "description": "Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines.", - "type": "Existing Customer - Upgrade", - "monetary_amount": 75000, - "currency": apideck_unify.Currency.USD, - "win_probability": 40, - "close_date": dateutil.parser.parse("2020-10-30").date(), - "loss_reason_id": "12345", - "loss_reason": "No budget", - "won_reason_id": "12345", - "won_reason": "Best pitch", - "pipeline_id": "12345", - "pipeline_stage_id": "12345", - "source_id": "12345", - "lead_id": "12345", - "lead_source": "Website", - "contact_id": "12345", - "contact_ids": [ - "12345", - ], - "company_id": "12345", - "company_name": "Copper", - "owner_id": "12345", - "priority": "None", - "status": "Open", - "status_id": "12345", - "tags": [ - "New", - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": True, - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "stage_last_changed_at": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.opportunities.update(id="", title="New Rocket", primary_contact_id="12345", service_id="salesforce", description="Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines.", type_="Existing Customer - Upgrade", monetary_amount=75000, currency=apideck_unify.Currency.USD, win_probability=40, close_date=dateutil.parser.parse("2020-10-30").date(), loss_reason_id="12345", loss_reason="No budget", won_reason_id="12345", won_reason="Best pitch", pipeline_id="12345", pipeline_stage_id="12345", source_id="12345", lead_id="12345", lead_source="Website", contact_id="12345", contact_ids=[ + "12345", + ], company_id="12345", company_name="Copper", owner_id="12345", priority="None", status="Open", status_id="12345", tags=[ + "New", + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": True, + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + ], stage_last_changed_at=dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `opportunity` | [models.OpportunityInput](../../models/opportunityinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `title` | *str* | :heavy_check_mark: | The title or name of the opportunity. | New Rocket | +| `primary_contact_id` | *Nullable[str]* | :heavy_check_mark: | The unique identifier of the primary contact associated with the opportunity. | 12345 | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the opportunity. | Opportunities are created for People and Companies that are interested in buying your products or services. Create Opportunities for People and Companies to move them through one of your Pipelines. | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the opportunity | Existing Customer - Upgrade | +| `monetary_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The monetary value associated with the opportunity | 75000 | +| `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 | +| `win_probability` | *OptionalNullable[float]* | :heavy_minus_sign: | The probability of winning the opportunity, expressed as a percentage. | 40 | +| `close_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. | 2020-10-30 | +| `loss_reason_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the reason why the opportunity was lost. | 12345 | +| `loss_reason` | *OptionalNullable[str]* | :heavy_minus_sign: | The reason why the opportunity was lost. | No budget | +| `won_reason_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the reason why the opportunity was won. | 12345 | +| `won_reason` | *OptionalNullable[str]* | :heavy_minus_sign: | The reason why the opportunity was won. | Best pitch | +| `pipeline_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the pipeline associated with the opportunity | 12345 | +| `pipeline_stage_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the stage in the pipeline associated with the opportunity. | 12345 | +| `source_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the source of the opportunity. | 12345 | +| `lead_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the lead associated with the opportunity. | 12345 | +| `lead_source` | *OptionalNullable[str]* | :heavy_minus_sign: | The source of the lead associated with the opportunity. | Website | +| `contact_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the contact associated with the opportunity. | 12345 | +| `contact_ids` | List[*str*] | :heavy_minus_sign: | An array of unique identifiers of all contacts associated with the opportunity. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the company associated with the opportunity. | 12345 | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company associated with the opportunity. | Copper | +| `owner_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the user who owns the opportunity. | 12345 | +| `priority` | *OptionalNullable[str]* | :heavy_minus_sign: | The priority level of the opportunity. | None | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | The current status of the opportunity. | Open | +| `status_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The unique identifier of the current status of the opportunity. | 12345 | +| `tags` | List[*str*] | :heavy_minus_sign: | N/A | [
"New"
] | +| `custom_fields` | List[[models.CustomField](../../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `stage_last_changed_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date and time when the stage of the opportunity was last changed. | 2020-09-30T07:43:32.000Z | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -368,11 +367,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.opportunities.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/orders/README.md b/docs/sdks/orders/README.md index 39dcc89b..f851819a 100644 --- a/docs/sdks/orders/README.md +++ b/docs/sdks/orders/README.md @@ -24,36 +24,39 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ecommerce.orders.list(request={ - "service_id": "salesforce", - "filter_": { - "email": "elon@musk.com", - "customer_id": "123", - "updated_since": "2020-09-30T07:43:32.000Z", - "created_since": "2020-09-30T07:43:32.000Z", - }, - "sort": { - "by": apideck_unify.OrdersSortBy.CREATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.ecommerce.orders.list(service_id="salesforce", filter_={ + "email": "elon@musk.com", + "customer_id": "123", + "updated_since": "2020-09-30T07:43:32.000Z", + "created_since": "2020-09-30T07:43:32.000Z", + }, sort={ + "by": apideck_unify.OrdersSortBy.CREATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `request` | [models.EcommerceOrdersAllRequest](../../models/ecommerceordersallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.EcommerceOrdersFilter]](../../models/ecommerceordersfilter.md) | :heavy_minus_sign: | Apply filters | {
"email": "elon@musk.com",
"customer_id": "123",
"updated_since": "2020-09-30T07:43:32.000Z",
"created_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.OrdersSort]](../../models/orderssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "created_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -85,11 +88,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ecommerce.orders.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/payments/README.md b/docs/sdks/payments/README.md index 801700ee..e9ab070b 100644 --- a/docs/sdks/payments/README.md +++ b/docs/sdks/payments/README.md @@ -28,33 +28,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.payments.list(request={ - "service_id": "salesforce", - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.PaymentsSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.payments.list(service_id="salesforce", filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.PaymentsSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `request` | [models.AccountingPaymentsAllRequest](../../models/accountingpaymentsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.PaymentsFilter]](../../models/paymentsfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.PaymentsSort]](../../models/paymentssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -88,89 +91,90 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.payments.create(payment={ - "total_amount": 49.99, - "transaction_date": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "currency": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "reference": "123456", - "payment_method": "cash", - "payment_method_reference": "123456", - "payment_method_id": "12345", - "account": { + + res = apideck.accounting.payments.create(total_amount=49.99, transaction_date=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), service_id="salesforce", currency=apideck_unify.Currency.USD, currency_rate=0.69, reference="123456", payment_method="cash", payment_method_reference="123456", payment_method_id="12345", account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, customer={ + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, company_id="12345", reconciled=True, status=apideck_unify.PaymentStatus.AUTHORISED, type_=apideck_unify.PaymentType.ACCOUNTS_RECEIVABLE, allocations=[ + { + "id": "123456", + "amount": 49.99, + "allocation_id": "123456", + }, + ], note="Some notes about this transaction", number="123456", tracking_categories=[ + { + "id": "123456", + "name": "New York", + }, + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "customer": { - "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", }, - "company_id": "12345", - "reconciled": True, - "status": apideck_unify.PaymentStatus.AUTHORISED, - "type": apideck_unify.PaymentType.ACCOUNTS_RECEIVABLE, - "allocations": [ - { - "id": "123456", - "amount": 49.99, - "allocation_id": "123456", - }, - ], - "note": "Some notes about this transaction", - "number": "123456", - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": "Uses Salesforce and Marketo", - }, - ], - "row_version": "1-12345", - "display_id": "123456", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], row_version="1-12345", display_id="123456", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `payment` | [models.PaymentInput](../../models/paymentinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `total_amount` | *Nullable[float]* | :heavy_check_mark: | The total amount of the transaction | 49.99 | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional transaction reference message ie: Debit remittance detail. | 123456 | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `payment_method_reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message returned by payment method on processing | 123456 | +| `payment_method_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `accounts_receivable_account_type` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Type of accounts receivable account. | Account | +| `accounts_receivable_account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the account to allocate payment to. | 123456 | +| `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `supplier` | [OptionalNullable[models.DeprecatedLinkedSupplierInput]](../../models/deprecatedlinkedsupplierinput.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The supplier this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `reconciled` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates if the transaction has been reconciled. | true | +| `status` | [Optional[models.PaymentStatus]](../../models/paymentstatus.md) | :heavy_minus_sign: | Status of payment | authorised | +| `type` | [Optional[models.PaymentType]](../../models/paymenttype.md) | :heavy_minus_sign: | Type of payment | accounts_receivable | +| `allocations` | List[[models.AllocationInput](../../models/allocationinput.md)] | :heavy_minus_sign: | N/A | | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Note associated with the transaction | Some notes about this transaction | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Number associated with the transaction | 123456 | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `display_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -202,11 +206,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.payments.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -252,115 +256,116 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.payments.update(id="", payment={ - "total_amount": 49.99, - "transaction_date": dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), - "currency": apideck_unify.Currency.USD, - "currency_rate": 0.69, - "reference": "123456", - "payment_method": "cash", - "payment_method_reference": "123456", - "payment_method_id": "12345", - "account": { + + res = apideck.accounting.payments.update(id="", total_amount=49.99, transaction_date=dateutil.parser.isoparse("2021-05-01T12:00:00.000Z"), service_id="salesforce", currency=apideck_unify.Currency.USD, currency_rate=0.69, reference="123456", payment_method="cash", payment_method_reference="123456", payment_method_id="12345", account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, customer={ + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, company_id="12345", reconciled=True, status=apideck_unify.PaymentStatus.AUTHORISED, type_=apideck_unify.PaymentType.ACCOUNTS_RECEIVABLE, allocations=[ + { + "id": "123456", + "amount": 49.99, + "allocation_id": "123456", + }, + { + "id": "123456", + "amount": 49.99, + "allocation_id": "123456", + }, + { + "id": "123456", + "amount": 49.99, + "allocation_id": "123456", + }, + ], note="Some notes about this transaction", number="123456", tracking_categories=[ + { "id": "123456", - "nominal_code": "N091", - "code": "453", + "name": "New York", }, - "customer": { - "id": "12345", - "display_name": "Windsurf Shop", - "email": "boring@boring.com", + { + "id": "123456", + "name": "New York", + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", }, - "company_id": "12345", - "reconciled": True, - "status": apideck_unify.PaymentStatus.AUTHORISED, - "type": apideck_unify.PaymentType.ACCOUNTS_RECEIVABLE, - "allocations": [ - { - "id": "123456", - "amount": 49.99, - "allocation_id": "123456", - }, - { - "id": "123456", - "amount": 49.99, - "allocation_id": "123456", - }, - { - "id": "123456", - "amount": 49.99, - "allocation_id": "123456", - }, - ], - "note": "Some notes about this transaction", - "number": "123456", - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "row_version": "1-12345", - "display_id": "123456", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], row_version="1-12345", display_id="123456", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `payment` | [models.PaymentInput](../../models/paymentinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `total_amount` | *Nullable[float]* | :heavy_check_mark: | The total amount of the transaction | 49.99 | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional transaction reference message ie: Debit remittance detail. | 123456 | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `payment_method_reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message returned by payment method on processing | 123456 | +| `payment_method_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `accounts_receivable_account_type` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Type of accounts receivable account. | Account | +| `accounts_receivable_account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the account to allocate payment to. | 123456 | +| `account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `supplier` | [OptionalNullable[models.DeprecatedLinkedSupplierInput]](../../models/deprecatedlinkedsupplierinput.md) | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The supplier this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `reconciled` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates if the transaction has been reconciled. | true | +| `status` | [Optional[models.PaymentStatus]](../../models/paymentstatus.md) | :heavy_minus_sign: | Status of payment | authorised | +| `type` | [Optional[models.PaymentType]](../../models/paymenttype.md) | :heavy_minus_sign: | Type of payment | accounts_receivable | +| `allocations` | List[[models.AllocationInput](../../models/allocationinput.md)] | :heavy_minus_sign: | N/A | | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Note associated with the transaction | Some notes about this transaction | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Number associated with the transaction | 123456 | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `display_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -392,11 +397,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.payments.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/payrolls/README.md b/docs/sdks/payrolls/README.md index b233528a..375bc2d2 100644 --- a/docs/sdks/payrolls/README.md +++ b/docs/sdks/payrolls/README.md @@ -23,30 +23,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.payrolls.list(request={ - "service_id": "salesforce", - "filter_": { - "start_date": "2022-04-08", - "end_date": "2022-04-21", - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.hris.payrolls.list(service_id="salesforce", filter_={ + "start_date": "2022-04-08", + "end_date": "2022-04-21", + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `request` | [models.HrisPayrollsAllRequest](../../models/hrispayrollsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `filter_` | [Optional[models.PayrollsFilter]](../../models/payrollsfilter.md) | :heavy_minus_sign: | Apply filters | {
"start_date": "2022-04-08",
"end_date": "2022-04-21"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,11 +77,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.hris.payrolls.get(payroll_id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/pipelines/README.md b/docs/sdks/pipelines/README.md index d73d8093..65bd62d7 100644 --- a/docs/sdks/pipelines/README.md +++ b/docs/sdks/pipelines/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.pipelines.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.crm.pipelines.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `request` | [models.CrmPipelinesAllRequest](../../models/crmpipelinesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,66 +81,64 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.pipelines.create(pipeline={ - "name": "Sales Pipeline", - "id": "default", - "currency": apideck_unify.Currency.USD, - "archived": False, - "active": False, - "display_order": 1, - "win_probability_enabled": True, - "stages": [ - { - "name": "Contract Sent", - "value": "CONTRACT_SENT", - "win_probability": 50, - "display_order": 1, - }, - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.pipelines.create(name="Sales Pipeline", service_id="salesforce", id="default", currency=apideck_unify.Currency.USD, archived=False, active=False, display_order=1, win_probability_enabled=True, stages=[ + { + "name": "Contract Sent", + "value": "CONTRACT_SENT", + "win_probability": 50, + "display_order": 1, + }, + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `pipeline` | [models.PipelineInput](../../models/pipelineinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the Pipeline. | Sales Pipeline | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `id` | *Optional[str]* | :heavy_minus_sign: | The unique identifier of the Pipeline. | default | +| `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 | +| `archived` | *Optional[bool]* | :heavy_minus_sign: | Whether the Pipeline is archived or not. | false | +| `active` | *Optional[bool]* | :heavy_minus_sign: | Whether the Pipeline is active or not. | false | +| `display_order` | *OptionalNullable[int]* | :heavy_minus_sign: | The order in which the Pipeline is displayed in the UI. | 1 | +| `win_probability_enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether the Pipeline has win probability enabled or not. | true | +| `stages` | List[[models.PipelineStages](../../models/pipelinestages.md)] | :heavy_minus_sign: | The Pipeline Stages. | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -169,11 +170,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.pipelines.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -218,95 +219,93 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.pipelines.update(id="", pipeline={ - "name": "Sales Pipeline", - "id": "default", - "currency": apideck_unify.Currency.USD, - "archived": False, - "active": False, - "display_order": 1, - "win_probability_enabled": True, - "stages": [ - { - "name": "Contract Sent", - "value": "CONTRACT_SENT", - "win_probability": 50, - "display_order": 1, - }, - { - "name": "Contract Sent", - "value": "CONTRACT_SENT", - "win_probability": 50, - "display_order": 1, - }, - { - "name": "Contract Sent", - "value": "CONTRACT_SENT", - "win_probability": 50, - "display_order": 1, - }, - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.pipelines.update(id_param="", name="Sales Pipeline", service_id="salesforce", id="default", currency=apideck_unify.Currency.USD, archived=False, active=False, display_order=1, win_probability_enabled=True, stages=[ + { + "name": "Contract Sent", + "value": "CONTRACT_SENT", + "win_probability": 50, + "display_order": 1, + }, + { + "name": "Contract Sent", + "value": "CONTRACT_SENT", + "win_probability": 50, + "display_order": 1, + }, + { + "name": "Contract Sent", + "value": "CONTRACT_SENT", + "win_probability": 50, + "display_order": 1, + }, + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `pipeline` | [models.PipelineInput](../../models/pipelineinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id_param` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `name` | *str* | :heavy_check_mark: | The name of the Pipeline. | Sales Pipeline | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `id` | *Optional[str]* | :heavy_minus_sign: | The unique identifier of the Pipeline. | default | +| `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 | +| `archived` | *Optional[bool]* | :heavy_minus_sign: | Whether the Pipeline is archived or not. | false | +| `active` | *Optional[bool]* | :heavy_minus_sign: | Whether the Pipeline is active or not. | false | +| `display_order` | *OptionalNullable[int]* | :heavy_minus_sign: | The order in which the Pipeline is displayed in the UI. | 1 | +| `win_probability_enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether the Pipeline has win probability enabled or not. | true | +| `stages` | List[[models.PipelineStages](../../models/pipelinestages.md)] | :heavy_minus_sign: | The Pipeline Stages. | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -338,11 +337,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.pipelines.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/products/README.md b/docs/sdks/products/README.md index bbed4cb5..97721691 100644 --- a/docs/sdks/products/README.md +++ b/docs/sdks/products/README.md @@ -23,26 +23,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.ecommerce.products.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.ecommerce.products.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `request` | [models.EcommerceProductsAllRequest](../../models/ecommerceproductsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -74,11 +77,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ecommerce.products.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/profitandlosssdk/README.md b/docs/sdks/profitandlosssdk/README.md index 997e4546..9bd9e96a 100644 --- a/docs/sdks/profitandlosssdk/README.md +++ b/docs/sdks/profitandlosssdk/README.md @@ -22,31 +22,30 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.profit_and_loss.get(request={ - "service_id": "salesforce", - "filter_": { - "customer_id": "123abc", - "start_date": "2021-01-01", - "end_date": "2021-12-31", - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - - if res is not None: - # handle response - pass + + res = apideck.accounting.profit_and_loss.get(service_id="salesforce", filter_={ + "customer_id": "123abc", + "start_date": "2021-01-01", + "end_date": "2021-12-31", + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingProfitAndLossOneRequest](../../models/accountingprofitandlossonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `filter_` | [Optional[models.ProfitAndLossFilter]](../../models/profitandlossfilter.md) | :heavy_minus_sign: | Apply filters | {
"customer_id": "123abc",
"start_date": "2021-01-01",
"end_date": "2021-12-31"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/purchaseorders/README.md b/docs/sdks/purchaseorders/README.md index 30ff4299..d5771545 100644 --- a/docs/sdks/purchaseorders/README.md +++ b/docs/sdks/purchaseorders/README.md @@ -28,33 +28,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.purchase_orders.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "filter_": { - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - "supplier_id": "1234", - }, - "sort": { - "by": apideck_unify.PurchaseOrdersSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, + + res = apideck.accounting.purchase_orders.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, filter_={ + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + "supplier_id": "1234", + }, sort={ + "by": apideck_unify.PurchaseOrdersSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, }) - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingPurchaseOrdersAllRequest](../../models/accountingpurchaseordersallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.PurchaseOrdersFilter]](../../models/purchaseordersfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z",
"supplier_id": "1234"
} | +| `sort` | [Optional[models.PurchaseOrdersSort]](../../models/purchaseorderssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -88,103 +91,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.purchase_orders.create(purchase_order={ - "po_number": "90000117", - "reference": "123456", - "supplier": { - "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - "status": apideck_unify.PurchaseOrderStatus.OPEN, - "issued_date": dateutil.parser.parse("2020-09-30").date(), - "delivery_date": dateutil.parser.parse("2020-09-30").date(), - "expected_arrival_date": dateutil.parser.parse("2020-09-30").date(), - "currency": apideck_unify.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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { - "id": "123456", - "rate": 10, - }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "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": { + + res = apideck.accounting.purchase_orders.create(service_id="salesforce", po_number="90000117", reference="123456", supplier={ + "id": "12345", + "display_name": "Windsurf Shop", + "address": { "id": "123", "type": apideck_unify.Type.PRIMARY, "string": "25 Spring Street, Blackburn, VIC 3130", @@ -210,112 +121,202 @@ with Apideck( "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": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - "accounting_by_row": False, - "due_date": dateutil.parser.parse("2020-10-30").date(), - "payment_method": "cash", - "tax_code": "1234", - "channel": "email", - "memo": "Thank you for the partnership and have a great day!", - "tracking_categories": [ - { + }, company_id="12345", status=apideck_unify.PurchaseOrderStatus.OPEN, issued_date=dateutil.parser.parse("2020-09-30").date(), delivery_date=dateutil.parser.parse("2020-09-30").date(), expected_arrival_date=dateutil.parser.parse("2020-09-30").date(), currency=apideck_unify.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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_rate": { "id": "123456", - "name": "New York", + "rate": 10, }, - ], + "tracking_categories": [ + { + "id": "123456", + "name": "New York", + }, + { + "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": apideck_unify.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", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, 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": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, accounting_by_row=False, due_date=dateutil.parser.parse("2020-10-30").date(), 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", + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `purchase_order` | [models.PurchaseOrderInput](../../models/purchaseorderinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `po_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A PO Number uniquely identifies a purchase order and is generally defined by the buyer. | 90000117 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional purchase order reference. | 123456 | +| `supplier` | [OptionalNullable[models.LinkedSupplierInput]](../../models/linkedsupplierinput.md) | :heavy_minus_sign: | The supplier this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `status` | [OptionalNullable[models.PurchaseOrderStatus]](../../models/purchaseorderstatus.md) | :heavy_minus_sign: | N/A | open | +| `issued_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Date purchase order was issued - YYYY-MM-DD. | 2020-09-30 | +| `delivery_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date on which the purchase order is to be delivered - YYYY-MM-DD. | 2020-09-30 | +| `expected_arrival_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date on which the order is expected to arrive - YYYY-MM-DD. | 2020-09-30 | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `sub_total` | *OptionalNullable[float]* | :heavy_minus_sign: | Sub-total amount, normally before tax. | 27500 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this invoice. | 2500 | +| `total` | *OptionalNullable[float]* | :heavy_minus_sign: | Total amount of invoice, including tax. | 27500 | +| `tax_inclusive` | *OptionalNullable[bool]* | :heavy_minus_sign: | Amounts are including tax | true | +| `line_items` | List[[models.InvoiceLineItemInput](../../models/invoicelineiteminput.md)] | :heavy_minus_sign: | N/A | | +| `shipping_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `ledger_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `template_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional purchase order template | 123456 | +| `discount_percentage` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount percentage applied to this transaction. | 5.5 | +| `bank_account` | [Optional[models.BankAccount]](../../models/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `accounting_by_row` | *OptionalNullable[bool]* | :heavy_minus_sign: | 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. | false | +| `due_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. | 2020-10-30 | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Message for the supplier. This text appears on the Purchase Order. | Thank you for the partnership and have a great day! | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -347,11 +348,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.purchase_orders.get(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -396,207 +397,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.purchase_orders.update(id="", purchase_order={ - "po_number": "90000117", - "reference": "123456", - "supplier": { - "id": "12345", - "display_name": "Windsurf Shop", - "address": { - "id": "123", - "type": apideck_unify.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", - "status": apideck_unify.PurchaseOrderStatus.OPEN, - "issued_date": dateutil.parser.parse("2020-09-30").date(), - "delivery_date": dateutil.parser.parse("2020-09-30").date(), - "expected_arrival_date": dateutil.parser.parse("2020-09-30").date(), - "currency": apideck_unify.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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "item": { - "id": "12344", - "code": "120-C", - "name": "Model Y", - }, - "tax_rate": { - "id": "123456", - "rate": 10, - }, - "tracking_categories": [ - { - "id": "123456", - "name": "New York", - }, - { - "id": "123456", - "name": "New York", - }, - ], - "ledger_account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", - }, - "custom_fields": [ - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - ], - "row_version": "1-12345", - }, - { - "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "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", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - }, - { - "id": "2389328923893298", - "name": "employee_level", - "description": "Employee Level", - "value": 10, - }, - ], - "row_version": "1-12345", - }, - { - "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": apideck_unify.InvoiceLineItemType.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": "1234", - "department_id": "1234", - "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": [ - {}, - ], - }, - ], - "row_version": "1-12345", - }, - ], - "shipping_address": { + + res = apideck.accounting.purchase_orders.update(id="", service_id="salesforce", po_number="90000117", reference="123456", supplier={ + "id": "12345", + "display_name": "Windsurf Shop", + "address": { "id": "123", "type": apideck_unify.Type.PRIMARY, "string": "25 Spring Street, Blackburn, VIC 3130", @@ -622,121 +427,315 @@ with Apideck( "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": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, + }, company_id="12345", status=apideck_unify.PurchaseOrderStatus.OPEN, issued_date=dateutil.parser.parse("2020-09-30").date(), delivery_date=dateutil.parser.parse("2020-09-30").date(), expected_arrival_date=dateutil.parser.parse("2020-09-30").date(), currency=apideck_unify.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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_rate": { + "id": "123456", + "rate": 10, + }, + "tracking_categories": [ + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + ], + "ledger_account": { + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + ], + "row_version": "1-12345", }, - "accounting_by_row": False, - "due_date": dateutil.parser.parse("2020-10-30").date(), - "payment_method": "cash", - "tax_code": "1234", - "channel": "email", - "memo": "Thank you for the partnership and have a great day!", - "tracking_categories": [ - { + { + "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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_rate": { "id": "123456", - "name": "New York", + "rate": 10, }, - { + "tracking_categories": [ + { + "id": "123456", + "name": "New York", + }, + ], + "ledger_account": { "id": "123456", - "name": "New York", + "nominal_code": "N091", + "code": "453", }, - { + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + }, + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": 10, + }, + ], + "row_version": "1-12345", + }, + { + "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": apideck_unify.InvoiceLineItemType.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": "1234", + "department_id": "1234", + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_rate": { "id": "123456", - "name": "New York", + "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": [ + {}, + ], + }, + ], + "row_version": "1-12345", + }, + ], shipping_address={ + "id": "123", + "type": apideck_unify.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", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, 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": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, accounting_by_row=False, due_date=dateutil.parser.parse("2020-10-30").date(), 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", + }, + { + "id": "123456", + "name": "New York", + }, + { + "id": "123456", + "name": "New York", + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `purchase_order` | [models.PurchaseOrderInput](../../models/purchaseorderinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `po_number` | *OptionalNullable[str]* | :heavy_minus_sign: | A PO Number uniquely identifies a purchase order and is generally defined by the buyer. | 90000117 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional purchase order reference. | 123456 | +| `supplier` | [OptionalNullable[models.LinkedSupplierInput]](../../models/linkedsupplierinput.md) | :heavy_minus_sign: | The supplier this entity is linked to. | | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `status` | [OptionalNullable[models.PurchaseOrderStatus]](../../models/purchaseorderstatus.md) | :heavy_minus_sign: | N/A | open | +| `issued_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | Date purchase order was issued - YYYY-MM-DD. | 2020-09-30 | +| `delivery_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date on which the purchase order is to be delivered - YYYY-MM-DD. | 2020-09-30 | +| `expected_arrival_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The date on which the order is expected to arrive - YYYY-MM-DD. | 2020-09-30 | +| `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 | +| `currency_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `sub_total` | *OptionalNullable[float]* | :heavy_minus_sign: | Sub-total amount, normally before tax. | 27500 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this invoice. | 2500 | +| `total` | *OptionalNullable[float]* | :heavy_minus_sign: | Total amount of invoice, including tax. | 27500 | +| `tax_inclusive` | *OptionalNullable[bool]* | :heavy_minus_sign: | Amounts are including tax | true | +| `line_items` | List[[models.InvoiceLineItemInput](../../models/invoicelineiteminput.md)] | :heavy_minus_sign: | N/A | | +| `shipping_address` | [Optional[models.Address]](../../models/address.md) | :heavy_minus_sign: | N/A | | +| `ledger_account` | [OptionalNullable[models.LinkedLedgerAccountInput]](../../models/linkedledgeraccountinput.md) | :heavy_minus_sign: | N/A | | +| `template_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional purchase order template | 123456 | +| `discount_percentage` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount percentage applied to this transaction. | 5.5 | +| `bank_account` | [Optional[models.BankAccount]](../../models/bankaccount.md) | :heavy_minus_sign: | N/A | | +| `accounting_by_row` | *OptionalNullable[bool]* | :heavy_minus_sign: | 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. | false | +| `due_date` | [datetime](https://docs.python.org/3/library/datetime.html#datetime-objects) | :heavy_minus_sign: | The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. | 2020-10-30 | +| `payment_method` | *OptionalNullable[str]* | :heavy_minus_sign: | Payment method used for the transaction, such as cash, credit card, bank transfer, or check | cash | +| `tax_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Applicable tax id/code override if tax is not supplied on a line item basis. | 1234 | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Message for the supplier. This text appears on the Purchase Order. | Thank you for the partnership and have a great day! | +| `tracking_categories` | List[[models.LinkedTrackingCategory](../../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -768,11 +767,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.purchase_orders.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index bba3311e..0c93e92a 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -27,6 +27,7 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.sessions.create(request={ "consumer_metadata": { "account_name": "SpaceX", @@ -66,9 +67,8 @@ with Apideck( }, }) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -76,7 +76,7 @@ with Apideck( | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `request` | [Optional[models.Session]](../../models/session.md) | :heavy_minus_sign: | Additional redirect uri and/or consumer metadata | +| `request` | [models.Session](../../models/session.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/sharedlinks/README.md b/docs/sdks/sharedlinks/README.md index 9706f954..771bd712 100644 --- a/docs/sdks/sharedlinks/README.md +++ b/docs/sdks/sharedlinks/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.shared_links.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.file_storage.shared_links.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `request` | [models.FileStorageSharedLinksAllRequest](../../models/filestoragesharedlinksallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,49 +81,48 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.shared_links.create(shared_link={ - "target_id": "", - "download_url": "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg", - "scope": apideck_unify.Scope.COMPANY, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.shared_links.create(target_id="", service_id="salesforce", download_url="https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg", scope=apideck_unify.Scope.COMPANY, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `shared_link` | [models.SharedLinkInput](../../models/sharedlinkinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `target_id` | *Nullable[str]* | :heavy_check_mark: | The ID of the file or folder to link. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `download_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL that can be used to download the file. | https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg | +| `scope` | [OptionalNullable[models.Scope]](../../models/scope.md) | :heavy_minus_sign: | The scope of the shared link. | company | +| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional password for the shared link. | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -152,11 +154,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.shared_links.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -201,92 +203,91 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.shared_links.update(id="", shared_link={ - "target_id": "", - "download_url": "https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg", - "scope": apideck_unify.Scope.COMPANY, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.shared_links.update(id="", target_id="", service_id="salesforce", download_url="https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg", scope=apideck_unify.Scope.COMPANY, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `shared_link` | [models.SharedLinkInput](../../models/sharedlinkinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `target_id` | *Nullable[str]* | :heavy_check_mark: | The ID of the file or folder to link. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `download_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL that can be used to download the file. | https://www.box.com/shared/static/rh935iit6ewrmw0unyul.jpeg | +| `scope` | [OptionalNullable[models.Scope]](../../models/scope.md) | :heavy_minus_sign: | The scope of the shared link. | company | +| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional password for the shared link. | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -318,11 +319,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.shared_links.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/stores/README.md b/docs/sdks/stores/README.md index efa84d03..a688603f 100644 --- a/docs/sdks/stores/README.md +++ b/docs/sdks/stores/README.md @@ -22,11 +22,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.ecommerce.stores.get(service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/subsidiaries/README.md b/docs/sdks/subsidiaries/README.md index b2f608ed..1bfd9834 100644 --- a/docs/sdks/subsidiaries/README.md +++ b/docs/sdks/subsidiaries/README.md @@ -26,23 +26,26 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.subsidiaries.list(request={ - "service_id": "salesforce", - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.subsidiaries.list(service_id="salesforce", fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingSubsidiariesAllRequest](../../models/accountingsubsidiariesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -75,50 +78,48 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.subsidiaries.create(subsidiary={ - "parent_id": "12345", - "name": "SpaceX", - "status": apideck_unify.SubsidiaryStatus.ACTIVE, - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.subsidiaries.create(service_id="salesforce", parent_id="12345", name="SpaceX", status=apideck_unify.SubsidiaryStatus.ACTIVE, row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `subsidiary` | [models.SubsidiaryInput](../../models/subsidiaryinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `status` | [Optional[models.SubsidiaryStatus]](../../models/subsidiarystatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -150,11 +151,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.subsidiaries.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -199,93 +200,91 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.subsidiaries.update(id="", subsidiary={ - "parent_id": "12345", - "name": "SpaceX", - "status": apideck_unify.SubsidiaryStatus.ACTIVE, - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.subsidiaries.update(id="", service_id="salesforce", parent_id="12345", name="SpaceX", status=apideck_unify.SubsidiaryStatus.ACTIVE, row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `subsidiary` | [models.SubsidiaryInput](../../models/subsidiaryinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `status` | [Optional[models.SubsidiaryStatus]](../../models/subsidiarystatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -317,11 +316,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.subsidiaries.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/suppliers/README.md b/docs/sdks/suppliers/README.md index b38b7f35..cc5fc0b3 100644 --- a/docs/sdks/suppliers/README.md +++ b/docs/sdks/suppliers/README.md @@ -28,38 +28,41 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.suppliers.list(request={ - "service_id": "salesforce", - "filter_": { - "company_name": "SpaceX", - "display_name": "Elon Musk", - "first_name": "Elon", - "last_name": "Musk", - "email": "elon@musk.com", - "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), - }, - "sort": { - "by": apideck_unify.SuppliersSortBy.UPDATED_AT, - "direction": apideck_unify.SortDirection.DESC, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.suppliers.list(service_id="salesforce", filter_={ + "company_name": "SpaceX", + "display_name": "Elon Musk", + "first_name": "Elon", + "last_name": "Musk", + "email": "elon@musk.com", + "updated_since": dateutil.parser.isoparse("2020-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.SuppliersSortBy.UPDATED_AT, + "direction": apideck_unify.SortDirection.DESC, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `request` | [models.AccountingSuppliersAllRequest](../../models/accountingsuppliersallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.SuppliersFilter]](../../models/suppliersfilter.md) | :heavy_minus_sign: | Apply filters | {
"company_name": "SpaceX",
"display_name": "Elon Musk",
"first_name": "Elon",
"last_name": "Musk",
"email": "elon@musk.com",
"updated_since": "2020-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.SuppliersSort]](../../models/supplierssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "updated_at",
"direction": "desc"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -92,182 +95,180 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.suppliers.create(supplier={ - "display_id": "EMP00101", - "display_name": "Windsurf Shop", - "company_name": "SpaceX", - "company_id": "12345", - "title": "CEO", - "first_name": "Elon", - "middle_name": "D.", - "last_name": "Musk", - "suffix": "Jr.", - "individual": True, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "bank_accounts": [ - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - ], - "notes": "Some notes about this supplier", - "tax_rate": { - "id": "123456", - "rate": 10, + + res = apideck.accounting.suppliers.create(service_id="salesforce", display_id="EMP00101", display_name="Windsurf Shop", company_name="SpaceX", company_id="12345", title="CEO", first_name="Elon", middle_name="D.", last_name="Musk", suffix="Jr.", individual=True, addresses=[ + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, }, - "tax_number": "US123945459", - "currency": apideck_unify.Currency.USD, - "account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, }, - "status": apideck_unify.SupplierStatus.ACTIVE, - "payment_method": "cash", - "channel": "email", - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], bank_accounts=[ + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + ], notes="Some notes about this supplier", tax_rate={ + "id": "123456", + "rate": 10, + }, tax_number="US123945459", currency=apideck_unify.Currency.USD, account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, status=apideck_unify.SupplierStatus.ACTIVE, payment_method="cash", channel="email", row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - "subsidiary_id": "12345", - }, service_id="salesforce") + }, + ], + }, + ], subsidiary_id="12345") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `supplier` | [models.SupplierInput](../../models/supplierinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `display_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Display ID | EMP00101 | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Display name | Windsurf Shop | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the person. | Elon | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Middle name of the person. | D. | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the person. | Musk | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Jr. | +| `individual` | *OptionalNullable[bool]* | :heavy_minus_sign: | Is this an individual or business supplier | true | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `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 | | +| `websites` | List[[models.Website](../../models/website.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount](../../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `notes` | *OptionalNullable[str]* | :heavy_minus_sign: | Some notes about this supplier | Some notes about this supplier | +| `tax_rate` | [Optional[models.LinkedTaxRateInput]](../../models/linkedtaxrateinput.md) | :heavy_minus_sign: | N/A | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | US123945459 | +| `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 | +| `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 | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `subsidiary_id` | *Optional[str]* | :heavy_minus_sign: | The subsidiary the supplier belongs to. | 12345 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -299,11 +300,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.suppliers.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -348,232 +349,230 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.suppliers.update(id="", supplier={ - "display_id": "EMP00101", - "display_name": "Windsurf Shop", - "company_name": "SpaceX", - "company_id": "12345", - "title": "CEO", - "first_name": "Elon", - "middle_name": "D.", - "last_name": "Musk", - "suffix": "Jr.", - "individual": True, - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "websites": [ - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - { - "url": "http://example.com", - "id": "12345", - "type": apideck_unify.WebsiteType.PRIMARY, - }, - ], - "bank_accounts": [ - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - { - "bank_name": "Monzo", - "account_number": "123465", - "account_name": "SPACEX LLC", - "account_type": apideck_unify.AccountType.CREDIT_CARD, - "iban": "CH2989144532982975332", - "bic": "AUDSCHGGXXX", - "routing_number": "012345678", - "bsb_number": "062-001", - "branch_identifier": "001", - "bank_code": "BNH", - "currency": apideck_unify.Currency.USD, - }, - ], - "notes": "Some notes about this supplier", - "tax_rate": { - "id": "123456", - "rate": 10, + + res = apideck.accounting.suppliers.update(id="", service_id="salesforce", display_id="EMP00101", display_name="Windsurf Shop", company_name="SpaceX", company_id="12345", title="CEO", first_name="Elon", middle_name="D.", last_name="Musk", suffix="Jr.", individual=True, addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", }, - "tax_number": "US123945459", - "currency": apideck_unify.Currency.USD, - "account": { - "id": "123456", - "nominal_code": "N091", - "code": "453", + { + "id": "123", + "type": apideck_unify.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", }, - "status": apideck_unify.SupplierStatus.ACTIVE, - "payment_method": "cash", - "channel": "email", - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + ], phone_numbers=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], websites=[ + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + { + "url": "http://example.com", + "id": "12345", + "type": apideck_unify.WebsiteType.PRIMARY, + }, + ], bank_accounts=[ + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + { + "bank_name": "Monzo", + "account_number": "123465", + "account_name": "SPACEX LLC", + "account_type": apideck_unify.AccountType.CREDIT_CARD, + "iban": "CH2989144532982975332", + "bic": "AUDSCHGGXXX", + "routing_number": "012345678", + "bsb_number": "062-001", + "branch_identifier": "001", + "bank_code": "BNH", + "currency": apideck_unify.Currency.USD, + }, + ], notes="Some notes about this supplier", tax_rate={ + "id": "123456", + "rate": 10, + }, tax_number="US123945459", currency=apideck_unify.Currency.USD, account={ + "id": "123456", + "nominal_code": "N091", + "code": "453", + }, status=apideck_unify.SupplierStatus.ACTIVE, payment_method="cash", channel="email", row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - "subsidiary_id": "12345", - }, service_id="salesforce") + }, + ], + }, + ], subsidiary_id="12345") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `supplier` | [models.SupplierInput](../../models/supplierinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `display_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Display ID | EMP00101 | +| `display_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Display name | Windsurf Shop | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `company_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The company or subsidiary id the transaction belongs to | 12345 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `first_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The first name of the person. | Elon | +| `middle_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Middle name of the person. | D. | +| `last_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The last name of the person. | Musk | +| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | Jr. | +| `individual` | *OptionalNullable[bool]* | :heavy_minus_sign: | Is this an individual or business supplier | true | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `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 | | +| `websites` | List[[models.Website](../../models/website.md)] | :heavy_minus_sign: | N/A | | +| `bank_accounts` | List[[models.BankAccount](../../models/bankaccount.md)] | :heavy_minus_sign: | N/A | | +| `notes` | *OptionalNullable[str]* | :heavy_minus_sign: | Some notes about this supplier | Some notes about this supplier | +| `tax_rate` | [Optional[models.LinkedTaxRateInput]](../../models/linkedtaxrateinput.md) | :heavy_minus_sign: | N/A | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | US123945459 | +| `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 | +| `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 | +| `channel` | *OptionalNullable[str]* | :heavy_minus_sign: | The channel through which the transaction is processed. | email | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `subsidiary_id` | *Optional[str]* | :heavy_minus_sign: | The subsidiary the supplier belongs to. | 12345 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -605,11 +604,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.suppliers.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/taxrates/README.md b/docs/sdks/taxrates/README.md index 021efc3a..d8870170 100644 --- a/docs/sdks/taxrates/README.md +++ b/docs/sdks/taxrates/README.md @@ -27,33 +27,36 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.list(request={ - "service_id": "salesforce", - "filter_": { - "assets": True, - "equity": True, - "expenses": True, - "liabilities": True, - "revenue": True, - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.tax_rates.list(service_id="salesforce", filter_={ + "assets": True, + "equity": True, + "expenses": True, + "liabilities": True, + "revenue": True, + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `request` | [models.AccountingTaxRatesAllRequest](../../models/accountingtaxratesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.TaxRatesFilter]](../../models/taxratesfilter.md) | :heavy_minus_sign: | Apply filters | {
"assets": true,
"equity": true,
"expenses": true,
"liabilities": true,
"revenue": true
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -86,72 +89,71 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.create(tax_rate={ - "id": "1234", - "name": "GST on Purchases", - "code": "ABN", - "description": "Reduced rate GST Purchases", - "effective_tax_rate": 10, - "total_tax_rate": 10, - "tax_payable_account_id": "123456", - "tax_remitted_account_id": "123456", - "components": [ - { - "id": "10", - "name": "GST", - "rate": 10, - "compound": True, - }, - ], - "type": "NONE", - "report_tax_type": "NONE", - "original_tax_rate_id": "12345", - "status": apideck_unify.TaxRateStatus.ACTIVE, - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.tax_rates.create(service_id="salesforce", id="1234", name="GST on Purchases", code="ABN", description="Reduced rate GST Purchases", effective_tax_rate=10, total_tax_rate=10, tax_payable_account_id="123456", tax_remitted_account_id="123456", components=[ + { + "id": "10", + "name": "GST", + "rate": 10, + "compound": True, + }, + ], type_="NONE", report_tax_type="NONE", original_tax_rate_id="12345", status=apideck_unify.TaxRateStatus.ACTIVE, row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `tax_rate` | [models.TaxRateInput](../../models/taxrateinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID assigned to identify this tax rate. | 1234 | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name assigned to identify this tax rate. | GST on Purchases | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | Tax code assigned to identify this tax rate. | ABN | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of tax rate | Reduced rate GST Purchases | +| `effective_tax_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Effective tax rate | 10 | +| `total_tax_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Not compounded sum of the components of a tax rate | 10 | +| `tax_payable_account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the account for tax collected. | 123456 | +| `tax_remitted_account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the account for tax remitted. | 123456 | +| `components` | List[[models.Components](../../models/components.md)] | :heavy_minus_sign: | N/A | | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | Tax type used to indicate the source of tax collected or paid | NONE | +| `report_tax_type` | *OptionalNullable[str]* | :heavy_minus_sign: | Report Tax type to aggregate tax collected or paid for reporting purposes | NONE | +| `original_tax_rate_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. | 12345 | +| `status` | [OptionalNullable[models.TaxRateStatus]](../../models/taxratestatus.md) | :heavy_minus_sign: | Tax rate status | active | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `subsidiaries` | List[[models.SubsidiariesModel](../../models/subsidiariesmodel.md)] | :heavy_minus_sign: | The subsidiaries this belongs to. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -184,11 +186,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.tax_rates.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -233,101 +235,100 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tax_rates.update(id="", tax_rate={ - "id": "1234", - "name": "GST on Purchases", - "code": "ABN", - "description": "Reduced rate GST Purchases", - "effective_tax_rate": 10, - "total_tax_rate": 10, - "tax_payable_account_id": "123456", - "tax_remitted_account_id": "123456", - "components": [ - { - "id": "10", - "name": "GST", - "rate": 10, - "compound": True, - }, - { - "id": "10", - "name": "GST", - "rate": 10, - "compound": True, - }, - { - "id": "10", - "name": "GST", - "rate": 10, - "compound": True, - }, - ], - "type": "NONE", - "report_tax_type": "NONE", - "original_tax_rate_id": "12345", - "status": apideck_unify.TaxRateStatus.ACTIVE, - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.tax_rates.update(id_param="", service_id="salesforce", id="1234", name="GST on Purchases", code="ABN", description="Reduced rate GST Purchases", effective_tax_rate=10, total_tax_rate=10, tax_payable_account_id="123456", tax_remitted_account_id="123456", components=[ + { + "id": "10", + "name": "GST", + "rate": 10, + "compound": True, + }, + { + "id": "10", + "name": "GST", + "rate": 10, + "compound": True, + }, + { + "id": "10", + "name": "GST", + "rate": 10, + "compound": True, + }, + ], type_="NONE", report_tax_type="NONE", original_tax_rate_id="12345", status=apideck_unify.TaxRateStatus.ACTIVE, row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `tax_rate` | [models.TaxRateInput](../../models/taxrateinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id_param` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID assigned to identify this tax rate. | 1234 | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name assigned to identify this tax rate. | GST on Purchases | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | Tax code assigned to identify this tax rate. | ABN | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of tax rate | Reduced rate GST Purchases | +| `effective_tax_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Effective tax rate | 10 | +| `total_tax_rate` | *OptionalNullable[float]* | :heavy_minus_sign: | Not compounded sum of the components of a tax rate | 10 | +| `tax_payable_account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the account for tax collected. | 123456 | +| `tax_remitted_account_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the account for tax remitted. | 123456 | +| `components` | List[[models.Components](../../models/components.md)] | :heavy_minus_sign: | N/A | | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | Tax type used to indicate the source of tax collected or paid | NONE | +| `report_tax_type` | *OptionalNullable[str]* | :heavy_minus_sign: | Report Tax type to aggregate tax collected or paid for reporting purposes | NONE | +| `original_tax_rate_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. | 12345 | +| `status` | [OptionalNullable[models.TaxRateStatus]](../../models/taxratestatus.md) | :heavy_minus_sign: | Tax rate status | active | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `subsidiaries` | List[[models.SubsidiariesModel](../../models/subsidiariesmodel.md)] | :heavy_minus_sign: | The subsidiaries this belongs to. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -359,11 +360,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.tax_rates.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/timeoffrequests/README.md b/docs/sdks/timeoffrequests/README.md index a2b01c61..b322f804 100644 --- a/docs/sdks/timeoffrequests/README.md +++ b/docs/sdks/timeoffrequests/README.md @@ -27,34 +27,37 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.time_off_requests.list(request={ - "service_id": "salesforce", - "filter_": { - "start_date": "2022-04-08", - "end_date": "2022-04-21", - "updated_since": "2020-09-30T07:43:32.000Z", - "employee_id": "1234", - "time_off_request_status": apideck_unify.TimeOffRequestStatus.APPROVED, - "company_id": "1234", - }, - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.hris.time_off_requests.list(service_id="salesforce", filter_={ + "start_date": "2022-04-08", + "end_date": "2022-04-21", + "updated_since": "2020-09-30T07:43:32.000Z", + "employee_id": "1234", + "time_off_request_status": apideck_unify.TimeOffRequestStatus.APPROVED, + "company_id": "1234", + }, pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `request` | [models.HrisTimeOffRequestsAllRequest](../../models/hristimeoffrequestsallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `filter_` | [Optional[models.TimeOffRequestsFilter]](../../models/timeoffrequestsfilter.md) | :heavy_minus_sign: | Apply filters | {
"start_date": "2022-04-08",
"end_date": "2022-04-21",
"updated_since": "2020-09-30T07:43:32.000Z",
"employee_id": "1234",
"time_off_request_status": "approved",
"company_id": "1234"
} | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -87,63 +90,61 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.time_off_requests.create(time_off_request={ - "employee_id": "12345", - "policy_id": "12345", - "status": apideck_unify.TimeOffRequestStatusStatus.APPROVED, - "description": "Enjoying some sun.", - "start_date": "2022-04-01", - "end_date": "2022-04-01", - "request_date": "2022-03-21", - "request_type": apideck_unify.RequestType.VACATION, - "approval_date": "2022-03-21", - "units": apideck_unify.Units.HOURS, - "amount": 3.5, - "day_part": "morning", - "notes": { - "employee": "Relaxing on the beach for a few hours.", - "manager": "Enjoy!", - }, - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.hris.time_off_requests.create(service_id="salesforce", employee_id="12345", policy_id="12345", status=apideck_unify.TimeOffRequestStatusStatus.APPROVED, description="Enjoying some sun.", start_date="2022-04-01", end_date="2022-04-01", request_date="2022-03-21", request_type=apideck_unify.RequestType.VACATION, approval_date="2022-03-21", units=apideck_unify.Units.HOURS, amount=3.5, day_part="morning", notes={ + "employee": "Relaxing on the beach for a few hours.", + "manager": "Enjoy!", + }, pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - "policy_type": "sick", - }, service_id="salesforce") + }, + ], + }, + ], policy_type="sick") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `time_off_request` | [models.TimeOffRequestInput](../../models/timeoffrequestinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `employee_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the employee | 12345 | +| `policy_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the policy | 12345 | +| `status` | [OptionalNullable[models.TimeOffRequestStatusStatus]](../../models/timeoffrequeststatusstatus.md) | :heavy_minus_sign: | The status of the time off request. | approved | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the time off request. | Enjoying some sun. | +| `start_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The start date of the time off request. | 2022-04-01 | +| `end_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The end date of the time off request. | 2022-04-01 | +| `request_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The date the request was made. | 2022-03-21 | +| `request_type` | [OptionalNullable[models.RequestType]](../../models/requesttype.md) | :heavy_minus_sign: | The type of request | vacation | +| `approval_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The date the request was approved | 2022-03-21 | +| `units` | [OptionalNullable[models.Units]](../../models/units.md) | :heavy_minus_sign: | The unit of time off requested. Possible values include: `hours`, `days`, or `other`. | hours | +| `amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The amount of time off requested. | 3.5 | +| `day_part` | *OptionalNullable[str]* | :heavy_minus_sign: | The day part of the time off request. | morning | +| `notes` | [Optional[models.NotesModel]](../../models/notesmodel.md) | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `policy_type` | *Optional[str]* | :heavy_minus_sign: | The policy type of the time off request | sick | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -175,25 +176,24 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.time_off_requests.get(request={ - "id": "", - "employee_id": "", - "service_id": "salesforce", - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.hris.time_off_requests.get(id="", employee_id="", service_id="salesforce", fields="id,updated_at") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `request` | [models.HrisTimeOffRequestsOneRequest](../../models/hristimeoffrequestsonerequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `employee_id` | *str* | :heavy_check_mark: | ID of the employee you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -226,108 +226,105 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.hris.time_off_requests.update(request={ - "id": "", - "employee_id": "", - "time_off_request": { - "employee_id": "12345", - "policy_id": "12345", - "status": apideck_unify.TimeOffRequestStatusStatus.APPROVED, - "description": "Enjoying some sun.", - "start_date": "2022-04-01", - "end_date": "2022-04-01", - "request_date": "2022-03-21", - "request_type": apideck_unify.RequestType.VACATION, - "approval_date": "2022-03-21", - "units": apideck_unify.Units.HOURS, - "amount": 3.5, - "day_part": "morning", - "notes": { - "employee": "Relaxing on the beach for a few hours.", - "manager": "Enjoy!", - }, - "pass_through": [ + + res = apideck.hris.time_off_requests.update(id="", employee_id_param="", service_id="salesforce", employee_id="12345", policy_id="12345", status=apideck_unify.TimeOffRequestStatusStatus.APPROVED, description="Enjoying some sun.", start_date="2022-04-01", end_date="2022-04-01", request_date="2022-03-21", request_type=apideck_unify.RequestType.VACATION, approval_date="2022-03-21", units=apideck_unify.Units.HOURS, amount=3.5, day_part="morning", notes={ + "employee": "Relaxing on the beach for a few hours.", + "manager": "Enjoy!", + }, pass_through=[ + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, + ], + }, + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, + ], + }, + { + "service_id": "", + "extend_paths": [ { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, - }, + }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, - ], + }, }, ], - "policy_type": "sick", }, - "service_id": "salesforce", - }) + ], policy_type="sick") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `request` | [models.HrisTimeOffRequestsUpdateRequest](../../models/hristimeoffrequestsupdaterequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `employee_id_param` | *str* | :heavy_check_mark: | ID of the employee you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `employee_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the employee | 12345 | +| `policy_id` | *OptionalNullable[str]* | :heavy_minus_sign: | ID of the policy | 12345 | +| `status` | [OptionalNullable[models.TimeOffRequestStatusStatus]](../../models/timeoffrequeststatusstatus.md) | :heavy_minus_sign: | The status of the time off request. | approved | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the time off request. | Enjoying some sun. | +| `start_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The start date of the time off request. | 2022-04-01 | +| `end_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The end date of the time off request. | 2022-04-01 | +| `request_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The date the request was made. | 2022-03-21 | +| `request_type` | [OptionalNullable[models.RequestType]](../../models/requesttype.md) | :heavy_minus_sign: | The type of request | vacation | +| `approval_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The date the request was approved | 2022-03-21 | +| `units` | [OptionalNullable[models.Units]](../../models/units.md) | :heavy_minus_sign: | The unit of time off requested. Possible values include: `hours`, `days`, or `other`. | hours | +| `amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The amount of time off requested. | 3.5 | +| `day_part` | *OptionalNullable[str]* | :heavy_minus_sign: | The day part of the time off request. | morning | +| `notes` | [Optional[models.NotesModel]](../../models/notesmodel.md) | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `policy_type` | *Optional[str]* | :heavy_minus_sign: | The policy type of the time off request | sick | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -359,11 +356,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.hris.time_off_requests.delete(id="", employee_id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/trackingcategories/README.md b/docs/sdks/trackingcategories/README.md index 64e72093..3ea75da4 100644 --- a/docs/sdks/trackingcategories/README.md +++ b/docs/sdks/trackingcategories/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tracking_categories.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.accounting.tracking_categories.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `request` | [models.AccountingTrackingCategoriesAllRequest](../../models/accountingtrackingcategoriesallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,51 +81,50 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tracking_categories.create(tracking_category={ - "parent_id": "12345", - "name": "Department", - "code": "100", - "status": apideck_unify.TrackingCategoryStatus.ACTIVE, - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.tracking_categories.create(service_id="salesforce", parent_id="12345", name="Department", code="100", status=apideck_unify.TrackingCategoryStatus.ACTIVE, row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `tracking_category` | [models.TrackingCategoryInput](../../models/trackingcategoryinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the tracking category. | Department | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | The code of the tracking category. | 100 | +| `status` | [Optional[models.TrackingCategoryStatus]](../../models/trackingcategorystatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `subsidiaries` | List[[models.TrackingCategorySubsidiaries](../../models/trackingcategorysubsidiaries.md)] | :heavy_minus_sign: | The subsidiaries the account belongs to. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -154,11 +156,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.tracking_categories.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -203,94 +205,93 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.accounting.tracking_categories.update(id="", tracking_category={ - "parent_id": "12345", - "name": "Department", - "code": "100", - "status": apideck_unify.TrackingCategoryStatus.ACTIVE, - "row_version": "1-12345", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.accounting.tracking_categories.update(id="", service_id="salesforce", parent_id="12345", name="Department", code="100", status=apideck_unify.TrackingCategoryStatus.ACTIVE, row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `tracking_category` | [models.TrackingCategoryInput](../../models/trackingcategoryinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the tracking category. | Department | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | The code of the tracking category. | 100 | +| `status` | [Optional[models.TrackingCategoryStatus]](../../models/trackingcategorystatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | +| `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 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `subsidiaries` | List[[models.TrackingCategorySubsidiaries](../../models/trackingcategorysubsidiaries.md)] | :heavy_minus_sign: | The subsidiaries the account belongs to. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -322,11 +323,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.accounting.tracking_categories.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/uploadsessions/README.md b/docs/sdks/uploadsessions/README.md index 31a35d4b..83b3f226 100644 --- a/docs/sdks/uploadsessions/README.md +++ b/docs/sdks/uploadsessions/README.md @@ -25,51 +25,49 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.upload_sessions.create(create_upload_session_request={ - "name": "Documents", - "parent_folder_id": "1234", - "size": 1810673, - "drive_id": "1234", - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.file_storage.upload_sessions.create(name="Documents", parent_folder_id="1234", size=1810673, service_id="salesforce", drive_id="1234", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `create_upload_session_request` | [models.CreateUploadSessionRequest](../../models/createuploadsessionrequest.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | The name of the file. | Documents | +| `parent_folder_id` | *str* | :heavy_check_mark: | 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. | 1234 | +| `size` | *Nullable[int]* | :heavy_check_mark: | The size of the file in bytes | 1810673 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `drive_id` | *Optional[str]* | :heavy_minus_sign: | ID of the drive to upload to. | 1234 | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | ### Response @@ -101,11 +99,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.upload_sessions.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -150,11 +148,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.file_storage.upload_sessions.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -197,25 +195,25 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.file_storage.upload_sessions.finish(request={ - "id": "", - "service_id": "salesforce", - "digest": "sha=fpRyg5eVQletdZqEKaFlqwBXJzM=", - }) - if res is not None: - # handle response - pass + res = apideck.file_storage.upload_sessions.finish(id="", service_id="salesforce", digest="sha=fpRyg5eVQletdZqEKaFlqwBXJzM=") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `request` | [models.FileStorageUploadSessionsFinishRequest](../../models/filestorageuploadsessionsfinishrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `digest` | *Optional[str]* | :heavy_minus_sign: | 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) | sha=fpRyg5eVQletdZqEKaFlqwBXJzM= | +| `request_body` | [Optional[models.FileStorageUploadSessionsFinishRequestBody]](../../models/filestorageuploadsessionsfinishrequestbody.md) | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | ### Response diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index c8988ffb..8dc75be8 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -26,26 +26,29 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.users.list(request={ - "service_id": "salesforce", - "pass_through": { - "search": "San Francisco", - }, - "fields": "id,updated_at", - }) - if res is not None: - # handle response - pass + res = apideck.crm.users.list(service_id="salesforce", pass_through={ + "search": "San Francisco", + }, fields="id,updated_at") + + while res is not None: + # Handle items + + res = res.next() ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `request` | [models.CrmUsersAllRequest](../../models/crmusersallrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `cursor` | *OptionalNullable[str]* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional[int]* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `pass_through` | Dict[str, *Any*] | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | +| `fields` | *OptionalNullable[str]* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

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

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -78,104 +81,103 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.users.create(user={ - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "parent_id": "54321", - "username": "masterofcoin", - "first_name": "Elon", - "last_name": "Musk", - "title": "CEO", - "division": "Europe", - "company_name": "SpaceX", - "employee_number": "123456-AB", - "description": "A description", - "image": "https://logo.clearbit.com/spacex.com?s=128", - "language": "EN", - "status": "active", - "password": "supersecretpassword", - "addresses": [ - { - "id": "123", - "type": apideck_unify.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": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.users.create(emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], service_id="salesforce", parent_id="54321", username="masterofcoin", first_name="Elon", last_name="Musk", title="CEO", division="Europe", company_name="SpaceX", employee_number="123456-AB", description="A description", image="https://logo.clearbit.com/spacex.com?s=128", language="EN", status="active", password="supersecretpassword", addresses=[ + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `user` | [models.UserInput](../../models/userinput.md) | :heavy_check_mark: | N/A | | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `emails` | List[[models.Email](../../models/email.md)] | :heavy_check_mark: | N/A | | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `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 | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The parent user id | 54321 | +| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username of the user | masterofcoin | +| `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 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `division` | *OptionalNullable[str]* | :heavy_minus_sign: | The division the person is currently in. Usually a collection of departments or teams or regions. | Europe | +| `department` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. | R&D | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `employee_number` | *OptionalNullable[str]* | :heavy_minus_sign: | An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. | 123456-AB | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `image` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the user's avatar | https://logo.clearbit.com/spacex.com?s=128 | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | The status of the user | active | +| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The password of the user | supersecretpassword | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `phone_numbers` | List[[models.PhoneNumber](../../models/phonenumber.md)] | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -207,11 +209,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.users.get(id="", service_id="salesforce", fields="id,updated_at") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -256,207 +258,206 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.crm.users.update(id="", user={ - "emails": [ - { - "email": "elon@musk.com", - "id": "123", - "type": apideck_unify.EmailType.PRIMARY, - }, - ], - "parent_id": "54321", - "username": "masterofcoin", - "first_name": "Elon", - "last_name": "Musk", - "title": "CEO", - "division": "Europe", - "company_name": "SpaceX", - "employee_number": "123456-AB", - "description": "A description", - "image": "https://logo.clearbit.com/spacex.com?s=128", - "language": "EN", - "status": "active", - "password": "supersecretpassword", - "addresses": [ - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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", - }, - { - "id": "123", - "type": apideck_unify.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": [ - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - { - "number": "111-111-1111", - "id": "12345", - "country_code": "1", - "area_code": "323", - "extension": "105", - "type": apideck_unify.PhoneNumberType.PRIMARY, - }, - ], - "pass_through": [ - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + + res = apideck.crm.users.update(id="", emails=[ + { + "email": "elon@musk.com", + "id": "123", + "type": apideck_unify.EmailType.PRIMARY, + }, + ], service_id="salesforce", parent_id="54321", username="masterofcoin", first_name="Elon", last_name="Musk", title="CEO", division="Europe", company_name="SpaceX", employee_number="123456-AB", description="A description", image="https://logo.clearbit.com/spacex.com?s=128", language="EN", status="active", password="supersecretpassword", addresses=[ + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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", + }, + { + "id": "123", + "type": apideck_unify.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=[ + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + { + "number": "111-111-1111", + "id": "12345", + "country_code": "1", + "area_code": "323", + "extension": "105", + "type": apideck_unify.PhoneNumberType.PRIMARY, + }, + ], pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - { - "service_id": "", - "extend_paths": [ - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + ], + }, + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - { - "path": "$.nested.property", - "value": { - "TaxClassificationRef": { - "value": "EUC-99990201-V1-00020000", - }, + }, + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", }, }, - ], - }, - ], - }, service_id="salesforce") + }, + ], + }, + ]) - if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | -| `user` | [models.UserInput](../../models/userinput.md) | :heavy_check_mark: | N/A | | -| `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 | -| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `emails` | List[[models.Email](../../models/email.md)] | :heavy_check_mark: | N/A | | +| `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 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The parent user id | 54321 | +| `username` | *OptionalNullable[str]* | :heavy_minus_sign: | The username of the user | masterofcoin | +| `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 | +| `title` | *OptionalNullable[str]* | :heavy_minus_sign: | The job title of the person. | CEO | +| `division` | *OptionalNullable[str]* | :heavy_minus_sign: | The division the person is currently in. Usually a collection of departments or teams or regions. | Europe | +| `department` | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. | R&D | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the company. | SpaceX | +| `employee_number` | *OptionalNullable[str]* | :heavy_minus_sign: | An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. | 123456-AB | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `image` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL of the user's avatar | https://logo.clearbit.com/spacex.com?s=128 | +| `language` | *OptionalNullable[str]* | :heavy_minus_sign: | language code according to ISO 639-1. For the United States - EN | EN | +| `status` | *OptionalNullable[str]* | :heavy_minus_sign: | The status of the user | active | +| `password` | *OptionalNullable[str]* | :heavy_minus_sign: | The password of the user | supersecretpassword | +| `addresses` | List[[models.Address](../../models/address.md)] | :heavy_minus_sign: | N/A | | +| `phone_numbers` | List[[models.PhoneNumber](../../models/phonenumber.md)] | :heavy_minus_sign: | N/A | | +| `pass_through` | List[[models.PassThroughBody](../../models/passthroughbody.md)] | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -488,11 +489,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.crm.users.delete(id="", service_id="salesforce") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/validateconnection/README.md b/docs/sdks/validateconnection/README.md index fcc27cb0..283dce87 100644 --- a/docs/sdks/validateconnection/README.md +++ b/docs/sdks/validateconnection/README.md @@ -28,11 +28,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.vault.validate_connection.state(service_id="pipedrive", unified_api="crm") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index 139a6054..8de7cc71 100644 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -26,11 +26,13 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.webhook.webhooks.list() - if res is not None: - # handle response - pass + while res is not None: + # Handle items + + res = res.next() ``` @@ -73,29 +75,27 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.webhook.webhooks.create(request={ - "unified_api": apideck_unify.UnifiedAPIID.CRM, - "status": apideck_unify.Status.ENABLED, - "delivery_url": "https://example.com/my/webhook/endpoint", - "events": [ - apideck_unify.WebhookEventType.VAULT_CONNECTION_CREATED, - apideck_unify.WebhookEventType.VAULT_CONNECTION_UPDATED, - ], - "description": "A description", - }) - - if res is not None: - # handle response - pass + + res = apideck.webhook.webhooks.create(unified_api=apideck_unify.UnifiedAPIID.CRM, status=apideck_unify.Status.ENABLED, delivery_url="https://example.com/my/webhook/endpoint", events=[ + apideck_unify.WebhookEventType.VAULT_CONNECTION_CREATED, + apideck_unify.WebhookEventType.VAULT_CONNECTION_UPDATED, + ], description="A description") + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `request` | [models.CreateWebhookRequest](../../models/createwebhookrequest.md) | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `unified_api` | [models.UnifiedAPIID](../../models/unifiedapiid.md) | :heavy_check_mark: | Name of Apideck Unified API | crm | +| `status` | [models.Status](../../models/status.md) | :heavy_check_mark: | The status of the webhook. | enabled | +| `delivery_url` | *str* | :heavy_check_mark: | The delivery url of the webhook endpoint. | https://example.com/my/webhook/endpoint | +| `events` | List[[models.WebhookEventType](../../models/webhookeventtype.md)] | :heavy_check_mark: | The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. | [
"vault.connection.created",
"vault.connection.updated"
] | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -127,11 +127,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.webhook.webhooks.get(id="") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -173,29 +173,27 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: - res = apideck.webhook.webhooks.update(id="", update_webhook_request={ - "description": "A description", - "status": apideck_unify.Status.ENABLED, - "delivery_url": "https://example.com/my/webhook/endpoint", - "events": [ - apideck_unify.WebhookEventType.VAULT_CONNECTION_CREATED, - apideck_unify.WebhookEventType.VAULT_CONNECTION_UPDATED, - ], - }) - - if res is not None: - # handle response - pass + + res = apideck.webhook.webhooks.update(id="", description="A description", status=apideck_unify.Status.ENABLED, delivery_url="https://example.com/my/webhook/endpoint", events=[ + apideck_unify.WebhookEventType.VAULT_CONNECTION_CREATED, + apideck_unify.WebhookEventType.VAULT_CONNECTION_UPDATED, + ]) + + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. | -| `update_webhook_request` | [models.UpdateWebhookRequest](../../models/updatewebhookrequest.md) | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. | | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | A description of the object. | A description | +| `status` | [Optional[models.Status]](../../models/status.md) | :heavy_minus_sign: | The status of the webhook. | enabled | +| `delivery_url` | *Optional[str]* | :heavy_minus_sign: | The delivery url of the webhook endpoint. | https://example.com/my/webhook/endpoint | +| `events` | List[[models.WebhookEventType](../../models/webhookeventtype.md)] | :heavy_minus_sign: | The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. | [
"vault.connection.created",
"vault.connection.updated"
] | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -227,11 +225,11 @@ with Apideck( consumer_id="test-consumer", app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", ) as apideck: + res = apideck.webhook.webhooks.delete(id="") - if res is not None: - # handle response - pass + # Handle response + print(res) ``` diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..bd877bc1 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,594 @@ +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + +[[package]] +name = "anyio" +version = "4.5.2" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.8" +files = [ + {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, + {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} + +[package.extras] +doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +trio = ["trio (>=0.26.1)"] + +[[package]] +name = "astroid" +version = "3.2.4" +description = "An abstract syntax tree for Python with inference support." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, + {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} + +[[package]] +name = "certifi" +version = "2024.12.14" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56"}, + {file = "certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "dill" +version = "0.3.9" +description = "serialize all of Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, + {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, +] + +[package.extras] +graph = ["objgraph (>=1.7.2)"] +profile = ["gprof2dot (>=2022.7.29)"] + +[[package]] +name = "eval-type-backport" +version = "0.2.0" +description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." +optional = false +python-versions = ">=3.8" +files = [ + {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, + {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, +] + +[package.extras] +tests = ["pytest"] + +[[package]] +name = "exceptiongroup" +version = "1.2.2" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + +[[package]] +name = "httpcore" +version = "1.0.7" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, + {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.13,<0.15" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.28.1" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "idna" +version = "3.10" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + +[[package]] +name = "jsonpath-python" +version = "1.0.6" +description = "A more powerful JSONPath implementation in modern python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, + {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, +] + +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + +[[package]] +name = "mypy" +version = "1.13.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, + {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, + {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, + {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, + {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, + {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, + {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, + {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, + {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, + {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, + {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, + {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, + {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, + {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, + {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, + {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, + {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, + {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, + {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, + {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, + {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, + {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.6.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "platformdirs" +version = "4.3.6" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +optional = false +python-versions = ">=3.8" +files = [ + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] + +[[package]] +name = "pydantic" +version = "2.10.3" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d"}, + {file = "pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9"}, +] + +[package.dependencies] +annotated-types = ">=0.6.0" +pydantic-core = "2.27.1" +typing-extensions = ">=4.12.2" + +[package.extras] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] + +[[package]] +name = "pydantic-core" +version = "2.27.1" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.27.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71a5e35c75c021aaf400ac048dacc855f000bdfed91614b4a726f7432f1f3d6a"}, + {file = "pydantic_core-2.27.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f82d068a2d6ecfc6e054726080af69a6764a10015467d7d7b9f66d6ed5afa23b"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:121ceb0e822f79163dd4699e4c54f5ad38b157084d97b34de8b232bcaad70278"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4603137322c18eaf2e06a4495f426aa8d8388940f3c457e7548145011bb68e05"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a33cd6ad9017bbeaa9ed78a2e0752c5e250eafb9534f308e7a5f7849b0b1bfb4"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15cc53a3179ba0fcefe1e3ae50beb2784dede4003ad2dfd24f81bba4b23a454f"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45d9c5eb9273aa50999ad6adc6be5e0ecea7e09dbd0d31bd0c65a55a2592ca08"}, + {file = "pydantic_core-2.27.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8bf7b66ce12a2ac52d16f776b31d16d91033150266eb796967a7e4621707e4f6"}, + {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:655d7dd86f26cb15ce8a431036f66ce0318648f8853d709b4167786ec2fa4807"}, + {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:5556470f1a2157031e676f776c2bc20acd34c1990ca5f7e56f1ebf938b9ab57c"}, + {file = "pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f69ed81ab24d5a3bd93861c8c4436f54afdf8e8cc421562b0c7504cf3be58206"}, + {file = "pydantic_core-2.27.1-cp310-none-win32.whl", hash = "sha256:f5a823165e6d04ccea61a9f0576f345f8ce40ed533013580e087bd4d7442b52c"}, + {file = "pydantic_core-2.27.1-cp310-none-win_amd64.whl", hash = "sha256:57866a76e0b3823e0b56692d1a0bf722bffb324839bb5b7226a7dbd6c9a40b17"}, + {file = "pydantic_core-2.27.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:ac3b20653bdbe160febbea8aa6c079d3df19310d50ac314911ed8cc4eb7f8cb8"}, + {file = "pydantic_core-2.27.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a5a8e19d7c707c4cadb8c18f5f60c843052ae83c20fa7d44f41594c644a1d330"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f7059ca8d64fea7f238994c97d91f75965216bcbe5f695bb44f354893f11d52"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bed0f8a0eeea9fb72937ba118f9db0cb7e90773462af7962d382445f3005e5a4"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3cb37038123447cf0f3ea4c74751f6a9d7afef0eb71aa07bf5f652b5e6a132c"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:84286494f6c5d05243456e04223d5a9417d7f443c3b76065e75001beb26f88de"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acc07b2cfc5b835444b44a9956846b578d27beeacd4b52e45489e93276241025"}, + {file = "pydantic_core-2.27.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4fefee876e07a6e9aad7a8c8c9f85b0cdbe7df52b8a9552307b09050f7512c7e"}, + {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:258c57abf1188926c774a4c94dd29237e77eda19462e5bb901d88adcab6af919"}, + {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:35c14ac45fcfdf7167ca76cc80b2001205a8d5d16d80524e13508371fb8cdd9c"}, + {file = "pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d1b26e1dff225c31897696cab7d4f0a315d4c0d9e8666dbffdb28216f3b17fdc"}, + {file = "pydantic_core-2.27.1-cp311-none-win32.whl", hash = "sha256:2cdf7d86886bc6982354862204ae3b2f7f96f21a3eb0ba5ca0ac42c7b38598b9"}, + {file = "pydantic_core-2.27.1-cp311-none-win_amd64.whl", hash = "sha256:3af385b0cee8df3746c3f406f38bcbfdc9041b5c2d5ce3e5fc6637256e60bbc5"}, + {file = "pydantic_core-2.27.1-cp311-none-win_arm64.whl", hash = "sha256:81f2ec23ddc1b476ff96563f2e8d723830b06dceae348ce02914a37cb4e74b89"}, + {file = "pydantic_core-2.27.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9cbd94fc661d2bab2bc702cddd2d3370bbdcc4cd0f8f57488a81bcce90c7a54f"}, + {file = "pydantic_core-2.27.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f8c4718cd44ec1580e180cb739713ecda2bdee1341084c1467802a417fe0f02"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15aae984e46de8d376df515f00450d1522077254ef6b7ce189b38ecee7c9677c"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ba5e3963344ff25fc8c40da90f44b0afca8cfd89d12964feb79ac1411a260ac"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:992cea5f4f3b29d6b4f7f1726ed8ee46c8331c6b4eed6db5b40134c6fe1768bb"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0325336f348dbee6550d129b1627cb8f5351a9dc91aad141ffb96d4937bd9529"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7597c07fbd11515f654d6ece3d0e4e5093edc30a436c63142d9a4b8e22f19c35"}, + {file = "pydantic_core-2.27.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3bbd5d8cc692616d5ef6fbbbd50dbec142c7e6ad9beb66b78a96e9c16729b089"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:dc61505e73298a84a2f317255fcc72b710b72980f3a1f670447a21efc88f8381"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:e1f735dc43da318cad19b4173dd1ffce1d84aafd6c9b782b3abc04a0d5a6f5bb"}, + {file = "pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f4e5658dbffe8843a0f12366a4c2d1c316dbe09bb4dfbdc9d2d9cd6031de8aae"}, + {file = "pydantic_core-2.27.1-cp312-none-win32.whl", hash = "sha256:672ebbe820bb37988c4d136eca2652ee114992d5d41c7e4858cdd90ea94ffe5c"}, + {file = "pydantic_core-2.27.1-cp312-none-win_amd64.whl", hash = "sha256:66ff044fd0bb1768688aecbe28b6190f6e799349221fb0de0e6f4048eca14c16"}, + {file = "pydantic_core-2.27.1-cp312-none-win_arm64.whl", hash = "sha256:9a3b0793b1bbfd4146304e23d90045f2a9b5fd5823aa682665fbdaf2a6c28f3e"}, + {file = "pydantic_core-2.27.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:f216dbce0e60e4d03e0c4353c7023b202d95cbaeff12e5fd2e82ea0a66905073"}, + {file = "pydantic_core-2.27.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a2e02889071850bbfd36b56fd6bc98945e23670773bc7a76657e90e6b6603c08"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42b0e23f119b2b456d07ca91b307ae167cc3f6c846a7b169fca5326e32fdc6cf"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:764be71193f87d460a03f1f7385a82e226639732214b402f9aa61f0d025f0737"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c00666a3bd2f84920a4e94434f5974d7bbc57e461318d6bb34ce9cdbbc1f6b2"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ccaa88b24eebc0f849ce0a4d09e8a408ec5a94afff395eb69baf868f5183107"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c65af9088ac534313e1963443d0ec360bb2b9cba6c2909478d22c2e363d98a51"}, + {file = "pydantic_core-2.27.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:206b5cf6f0c513baffaeae7bd817717140770c74528f3e4c3e1cec7871ddd61a"}, + {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:062f60e512fc7fff8b8a9d680ff0ddaaef0193dba9fa83e679c0c5f5fbd018bc"}, + {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a0697803ed7d4af5e4c1adf1670af078f8fcab7a86350e969f454daf598c4960"}, + {file = "pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:58ca98a950171f3151c603aeea9303ef6c235f692fe555e883591103da709b23"}, + {file = "pydantic_core-2.27.1-cp313-none-win32.whl", hash = "sha256:8065914ff79f7eab1599bd80406681f0ad08f8e47c880f17b416c9f8f7a26d05"}, + {file = "pydantic_core-2.27.1-cp313-none-win_amd64.whl", hash = "sha256:ba630d5e3db74c79300d9a5bdaaf6200172b107f263c98a0539eeecb857b2337"}, + {file = "pydantic_core-2.27.1-cp313-none-win_arm64.whl", hash = "sha256:45cf8588c066860b623cd11c4ba687f8d7175d5f7ef65f7129df8a394c502de5"}, + {file = "pydantic_core-2.27.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:5897bec80a09b4084aee23f9b73a9477a46c3304ad1d2d07acca19723fb1de62"}, + {file = "pydantic_core-2.27.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d0165ab2914379bd56908c02294ed8405c252250668ebcb438a55494c69f44ab"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b9af86e1d8e4cfc82c2022bfaa6f459381a50b94a29e95dcdda8442d6d83864"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f6c8a66741c5f5447e047ab0ba7a1c61d1e95580d64bce852e3df1f895c4067"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a42d6a8156ff78981f8aa56eb6394114e0dedb217cf8b729f438f643608cbcd"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:64c65f40b4cd8b0e049a8edde07e38b476da7e3aaebe63287c899d2cff253fa5"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdcf339322a3fae5cbd504edcefddd5a50d9ee00d968696846f089b4432cf78"}, + {file = "pydantic_core-2.27.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bf99c8404f008750c846cb4ac4667b798a9f7de673ff719d705d9b2d6de49c5f"}, + {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8f1edcea27918d748c7e5e4d917297b2a0ab80cad10f86631e488b7cddf76a36"}, + {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:159cac0a3d096f79ab6a44d77a961917219707e2a130739c64d4dd46281f5c2a"}, + {file = "pydantic_core-2.27.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:029d9757eb621cc6e1848fa0b0310310de7301057f623985698ed7ebb014391b"}, + {file = "pydantic_core-2.27.1-cp38-none-win32.whl", hash = "sha256:a28af0695a45f7060e6f9b7092558a928a28553366519f64083c63a44f70e618"}, + {file = "pydantic_core-2.27.1-cp38-none-win_amd64.whl", hash = "sha256:2d4567c850905d5eaaed2f7a404e61012a51caf288292e016360aa2b96ff38d4"}, + {file = "pydantic_core-2.27.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e9386266798d64eeb19dd3677051f5705bf873e98e15897ddb7d76f477131967"}, + {file = "pydantic_core-2.27.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4228b5b646caa73f119b1ae756216b59cc6e2267201c27d3912b592c5e323b60"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b3dfe500de26c52abe0477dde16192ac39c98f05bf2d80e76102d394bd13854"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aee66be87825cdf72ac64cb03ad4c15ffef4143dbf5c113f64a5ff4f81477bf9"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b748c44bb9f53031c8cbc99a8a061bc181c1000c60a30f55393b6e9c45cc5bd"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ca038c7f6a0afd0b2448941b6ef9d5e1949e999f9e5517692eb6da58e9d44be"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e0bd57539da59a3e4671b90a502da9a28c72322a4f17866ba3ac63a82c4498e"}, + {file = "pydantic_core-2.27.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ac6c2c45c847bbf8f91930d88716a0fb924b51e0c6dad329b793d670ec5db792"}, + {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b94d4ba43739bbe8b0ce4262bcc3b7b9f31459ad120fb595627eaeb7f9b9ca01"}, + {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:00e6424f4b26fe82d44577b4c842d7df97c20be6439e8e685d0d715feceb9fb9"}, + {file = "pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:38de0a70160dd97540335b7ad3a74571b24f1dc3ed33f815f0880682e6880131"}, + {file = "pydantic_core-2.27.1-cp39-none-win32.whl", hash = "sha256:7ccebf51efc61634f6c2344da73e366c75e735960b5654b63d7e6f69a5885fa3"}, + {file = "pydantic_core-2.27.1-cp39-none-win_amd64.whl", hash = "sha256:a57847b090d7892f123726202b7daa20df6694cbd583b67a592e856bff603d6c"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3fa80ac2bd5856580e242dbc202db873c60a01b20309c8319b5c5986fbe53ce6"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d950caa237bb1954f1b8c9227b5065ba6875ac9771bb8ec790d956a699b78676"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e4216e64d203e39c62df627aa882f02a2438d18a5f21d7f721621f7a5d3611d"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:02a3d637bd387c41d46b002f0e49c52642281edacd2740e5a42f7017feea3f2c"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:161c27ccce13b6b0c8689418da3885d3220ed2eae2ea5e9b2f7f3d48f1d52c27"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:19910754e4cc9c63bc1c7f6d73aa1cfee82f42007e407c0f413695c2f7ed777f"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:e173486019cc283dc9778315fa29a363579372fe67045e971e89b6365cc035ed"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:af52d26579b308921b73b956153066481f064875140ccd1dfd4e77db89dbb12f"}, + {file = "pydantic_core-2.27.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:981fb88516bd1ae8b0cbbd2034678a39dedc98752f264ac9bc5839d3923fa04c"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5fde892e6c697ce3e30c61b239330fc5d569a71fefd4eb6512fc6caec9dd9e2f"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:816f5aa087094099fff7edabb5e01cc370eb21aa1a1d44fe2d2aefdfb5599b31"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c10c309e18e443ddb108f0ef64e8729363adbfd92d6d57beec680f6261556f3"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98476c98b02c8e9b2eec76ac4156fd006628b1b2d0ef27e548ffa978393fd154"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c3027001c28434e7ca5a6e1e527487051136aa81803ac812be51802150d880dd"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:7699b1df36a48169cdebda7ab5a2bac265204003f153b4bd17276153d997670a"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1c39b07d90be6b48968ddc8c19e7585052088fd7ec8d568bb31ff64c70ae3c97"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:46ccfe3032b3915586e469d4972973f893c0a2bb65669194a5bdea9bacc088c2"}, + {file = "pydantic_core-2.27.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:62ba45e21cf6571d7f716d903b5b7b6d2617e2d5d67c0923dc47b9d41369f840"}, + {file = "pydantic_core-2.27.1.tar.gz", hash = "sha256:62a763352879b84aa31058fc931884055fd75089cccbd9d58bb6afd01141b235"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pylint" +version = "3.2.3" +description = "python code static checker" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, + {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, +] + +[package.dependencies] +astroid = ">=3.2.2,<=3.3.0-dev0" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +dill = [ + {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, +] +isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" +mccabe = ">=0.6,<0.8" +platformdirs = ">=2.2.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +tomlkit = ">=0.10.1" +typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} + +[package.extras] +spelling = ["pyenchant (>=3.2,<4.0)"] +testutils = ["gitpython (>3)"] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "six" +version = "1.17.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + +[[package]] +name = "tomli" +version = "2.2.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, + {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, + {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, + {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, + {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, + {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, + {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, + {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, + {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, +] + +[[package]] +name = "tomlkit" +version = "0.13.2" +description = "Style preserving TOML library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, + {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, +] + +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20241206" +description = "Typing stubs for python-dateutil" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"}, + {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"}, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + +[[package]] +name = "typing-inspect" +version = "0.9.0" +description = "Runtime inspection utilities for typing module." +optional = false +python-versions = "*" +files = [ + {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, + {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, +] + +[package.dependencies] +mypy-extensions = ">=0.3.0" +typing-extensions = ">=3.7.4" + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "231d09484040ca8e2e4ea801ceedb0b672113dd483caa7cb13d217c3e92d7655" diff --git a/pyproject.toml b/pyproject.toml index 617150ce..2b9764e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,10 @@ [tool.poetry] name = "apideck-unify" -version = "0.1.7" +version = "0.2.0" description = "Python Client SDK Generated by Speakeasy." authors = ["Speakeasy",] readme = "README-PYPI.md" +repository = "https://github.com/apideck-libraries/sdk-python.git" packages = [ { include = "apideck_unify", from = "src" } ] diff --git a/scripts/prepare-readme.py b/scripts/prepare-readme.py index 825d9ded..46a73fee 100644 --- a/scripts/prepare-readme.py +++ b/scripts/prepare-readme.py @@ -1,9 +1,33 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +import re import shutil try: - shutil.copyfile("README.md", "README-PYPI.md") + with open("README.md", "r") as rh: + readme_contents = rh.read() + GITHUB_URL = "https://github.com/apideck-libraries/sdk-python.git" + GITHUB_URL = ( + GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL + ) + # links on PyPI should have absolute URLs + readme_contents = re.sub( + r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))", + lambda m: m.group(1) + + GITHUB_URL + + "/blob/master/" + + m.group(2) + + m.group(3), + readme_contents, + ) + + with open("README-PYPI.md", "w") as wh: + wh.write(readme_contents) except Exception as e: - print("Failed to copy README.md to README-PYPI.md") - print(e) + try: + print("Failed to rewrite README.md to README-PYPI.md, copying original instead") + print(e) + shutil.copyfile("README.md", "README-PYPI.md") + except Exception as e: + print("Failed to copy README.md to README-PYPI.md") + print(e) diff --git a/src/apideck_unify/_version.py b/src/apideck_unify/_version.py index 7229bdc4..74eb8b9a 100644 --- a/src/apideck_unify/_version.py +++ b/src/apideck_unify/_version.py @@ -3,7 +3,7 @@ import importlib.metadata __title__: str = "apideck-unify" -__version__: str = "0.1.7" +__version__: str = "0.2.0" try: if __package__ is not None: diff --git a/src/apideck_unify/accounting.py b/src/apideck_unify/accounting.py index c4efd1fd..3b930dff 100644 --- a/src/apideck_unify/accounting.py +++ b/src/apideck_unify/accounting.py @@ -2,6 +2,8 @@ from .basesdk import BaseSDK from .sdkconfiguration import SDKConfiguration +from apideck_unify.agedcreditors_sdk import AgedCreditorsSDK +from apideck_unify.ageddebtors_sdk import AgedDebtorsSDK from apideck_unify.attachments import Attachments from apideck_unify.balancesheet_sdk import BalanceSheetSDK from apideck_unify.billpayments import BillPayments @@ -47,6 +49,8 @@ class Accounting(BaseSDK): tracking_categories: TrackingCategories bill_payments: BillPayments expenses: Expenses + aged_creditors: AgedCreditorsSDK + aged_debtors: AgedDebtorsSDK def __init__(self, sdk_config: SDKConfiguration) -> None: BaseSDK.__init__(self, sdk_config) @@ -75,3 +79,5 @@ def _init_sdks(self): self.tracking_categories = TrackingCategories(self.sdk_configuration) self.bill_payments = BillPayments(self.sdk_configuration) self.expenses = Expenses(self.sdk_configuration) + self.aged_creditors = AgedCreditorsSDK(self.sdk_configuration) + self.aged_debtors = AgedDebtorsSDK(self.sdk_configuration) diff --git a/src/apideck_unify/activities.py b/src/apideck_unify/activities.py index 58e90dce..c9ab3fb2 100644 --- a/src/apideck_unify/activities.py +++ b/src/apideck_unify/activities.py @@ -3,30 +3,49 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Activities(BaseSDK): def list( self, *, - request: Union[ - models.CrmActivitiesAllRequest, models.CrmActivitiesAllRequestTypedDict - ] = models.CrmActivitiesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.ActivitiesFilter, models.ActivitiesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.ActivitiesSort, models.ActivitiesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmActivitiesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmActivitiesAllResponse]: r"""List activities List activities - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +55,18 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmActivitiesAllRequest) - request = cast(models.CrmActivitiesAllRequest, request) + request = models.CrmActivitiesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.ActivitiesFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.ActivitiesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +79,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +113,34 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmActivitiesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetActivitiesResponse) + return models.CrmActivitiesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetActivitiesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +164,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmActivitiesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +183,39 @@ def list( async def list_async( self, *, - request: Union[ - models.CrmActivitiesAllRequest, models.CrmActivitiesAllRequestTypedDict - ] = models.CrmActivitiesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.ActivitiesFilter, models.ActivitiesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.ActivitiesSort, models.ActivitiesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmActivitiesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmActivitiesAllResponse]: r"""List activities List activities - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +225,18 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmActivitiesAllRequest) - request = cast(models.CrmActivitiesAllRequest, request) + request = models.CrmActivitiesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.ActivitiesFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.ActivitiesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +249,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +283,34 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmActivitiesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetActivitiesResponse) + return models.CrmActivitiesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetActivitiesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +334,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmActivitiesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +353,122 @@ async def list_async( def create( self, *, - activity: Union[models.ActivityInput, models.ActivityInputTypedDict], + type_: Nullable[models.ActivityType], raw: Optional[bool] = False, service_id: Optional[str] = None, + activity_datetime: OptionalNullable[str] = UNSET, + duration_seconds: OptionalNullable[int] = UNSET, + user_id: OptionalNullable[str] = UNSET, + account_id: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + opportunity_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + campaign_id: OptionalNullable[str] = UNSET, + case_id: OptionalNullable[str] = UNSET, + asset_id: OptionalNullable[str] = UNSET, + contract_id: OptionalNullable[str] = UNSET, + product_id: OptionalNullable[str] = UNSET, + solution_id: OptionalNullable[str] = UNSET, + custom_object_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + note: OptionalNullable[str] = UNSET, + location: OptionalNullable[str] = UNSET, + location_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + all_day_event: OptionalNullable[bool] = UNSET, + private: OptionalNullable[bool] = UNSET, + group_event: OptionalNullable[bool] = UNSET, + event_sub_type: OptionalNullable[str] = UNSET, + group_event_type: OptionalNullable[str] = UNSET, + child: OptionalNullable[bool] = UNSET, + archived: OptionalNullable[bool] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + show_as: OptionalNullable[models.ShowAs] = UNSET, + done: OptionalNullable[bool] = UNSET, + start_datetime: OptionalNullable[str] = UNSET, + end_datetime: OptionalNullable[str] = UNSET, + activity_date: OptionalNullable[str] = UNSET, + end_date: OptionalNullable[str] = UNSET, + recurrent: Optional[bool] = None, + reminder_datetime: OptionalNullable[str] = UNSET, + reminder_set: OptionalNullable[bool] = UNSET, + video_conference_url: OptionalNullable[str] = UNSET, + video_conference_id: OptionalNullable[str] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + attendees: Optional[ + Union[ + List[models.ActivityAttendeeInput], + List[models.ActivityAttendeeInputTypedDict], + ] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmActivitiesAddResponse: r"""Create activity Create activity - :param activity: + :param type: The type of the activity :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param activity_datetime: The date and time of the activity + :param duration_seconds: The duration of the activity in seconds + :param user_id: The user related to the activity + :param account_id: The account related to the activity + :param contact_id: The contact related to the activity + :param company_id: The company related to the activity + :param opportunity_id: The opportunity related to the activity + :param lead_id: The lead related to the activity + :param owner_id: The owner of the activity + :param campaign_id: The campaign related to the activity + :param case_id: The case related to the activity + :param asset_id: The asset related to the activity + :param contract_id: The contract related to the activity + :param product_id: The product related to the activity + :param solution_id: The solution related to the activity + :param custom_object_id: The custom object related to the activity + :param title: The title of the activity + :param description: A description of the activity + :param note: An internal note about the activity + :param location: The location of the activity + :param location_address: + :param all_day_event: Whether the Activity is an all day event or not + :param private: Whether the Activity is private or not + :param group_event: Whether the Activity is a group event or not + :param event_sub_type: The sub type of the group event + :param group_event_type: The type of the group event + :param child: Whether the activity is a child of another activity or not + :param archived: Whether the activity is archived or not + :param deleted: Whether the activity is deleted or not + :param show_as: + :param done: Whether the Activity is done or not + :param start_datetime: The start date and time of the activity + :param end_datetime: The end date and time of the activity + :param activity_date: The date of the activity + :param end_date: The end date of the activity + :param recurrent: Whether the activity is recurrent or not + :param reminder_datetime: The date and time of the reminder + :param reminder_set: Whether the reminder is set or not + :param video_conference_url: The URL of the video conference + :param video_conference_id: The ID of the video conference + :param custom_fields: Custom fields of the activity + :param attendees: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +481,60 @@ def create( request = models.CrmActivitiesAddRequest( raw=raw, service_id=service_id, - activity=utils.get_pydantic_model(activity, models.ActivityInput), + activity=models.ActivityInput( + activity_datetime=activity_datetime, + duration_seconds=duration_seconds, + user_id=user_id, + account_id=account_id, + contact_id=contact_id, + company_id=company_id, + opportunity_id=opportunity_id, + lead_id=lead_id, + owner_id=owner_id, + campaign_id=campaign_id, + case_id=case_id, + asset_id=asset_id, + contract_id=contract_id, + product_id=product_id, + solution_id=solution_id, + custom_object_id=custom_object_id, + type=type_, + title=title, + description=description, + note=note, + location=location, + location_address=utils.get_pydantic_model( + location_address, Optional[models.Address] + ), + all_day_event=all_day_event, + private=private, + group_event=group_event, + event_sub_type=event_sub_type, + group_event_type=group_event_type, + child=child, + archived=archived, + deleted=deleted, + show_as=show_as, + done=done, + start_datetime=start_datetime, + end_datetime=end_datetime, + activity_date=activity_date, + end_date=end_date, + recurrent=recurrent, + reminder_datetime=reminder_datetime, + reminder_set=reminder_set, + video_conference_url=video_conference_url, + video_conference_id=video_conference_id, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + attendees=utils.get_pydantic_model( + attendees, Optional[List[models.ActivityAttendeeInput]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +548,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +625,122 @@ def create( async def create_async( self, *, - activity: Union[models.ActivityInput, models.ActivityInputTypedDict], + type_: Nullable[models.ActivityType], raw: Optional[bool] = False, service_id: Optional[str] = None, + activity_datetime: OptionalNullable[str] = UNSET, + duration_seconds: OptionalNullable[int] = UNSET, + user_id: OptionalNullable[str] = UNSET, + account_id: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + opportunity_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + campaign_id: OptionalNullable[str] = UNSET, + case_id: OptionalNullable[str] = UNSET, + asset_id: OptionalNullable[str] = UNSET, + contract_id: OptionalNullable[str] = UNSET, + product_id: OptionalNullable[str] = UNSET, + solution_id: OptionalNullable[str] = UNSET, + custom_object_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + note: OptionalNullable[str] = UNSET, + location: OptionalNullable[str] = UNSET, + location_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + all_day_event: OptionalNullable[bool] = UNSET, + private: OptionalNullable[bool] = UNSET, + group_event: OptionalNullable[bool] = UNSET, + event_sub_type: OptionalNullable[str] = UNSET, + group_event_type: OptionalNullable[str] = UNSET, + child: OptionalNullable[bool] = UNSET, + archived: OptionalNullable[bool] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + show_as: OptionalNullable[models.ShowAs] = UNSET, + done: OptionalNullable[bool] = UNSET, + start_datetime: OptionalNullable[str] = UNSET, + end_datetime: OptionalNullable[str] = UNSET, + activity_date: OptionalNullable[str] = UNSET, + end_date: OptionalNullable[str] = UNSET, + recurrent: Optional[bool] = None, + reminder_datetime: OptionalNullable[str] = UNSET, + reminder_set: OptionalNullable[bool] = UNSET, + video_conference_url: OptionalNullable[str] = UNSET, + video_conference_id: OptionalNullable[str] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + attendees: Optional[ + Union[ + List[models.ActivityAttendeeInput], + List[models.ActivityAttendeeInputTypedDict], + ] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmActivitiesAddResponse: r"""Create activity Create activity - :param activity: + :param type: The type of the activity :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param activity_datetime: The date and time of the activity + :param duration_seconds: The duration of the activity in seconds + :param user_id: The user related to the activity + :param account_id: The account related to the activity + :param contact_id: The contact related to the activity + :param company_id: The company related to the activity + :param opportunity_id: The opportunity related to the activity + :param lead_id: The lead related to the activity + :param owner_id: The owner of the activity + :param campaign_id: The campaign related to the activity + :param case_id: The case related to the activity + :param asset_id: The asset related to the activity + :param contract_id: The contract related to the activity + :param product_id: The product related to the activity + :param solution_id: The solution related to the activity + :param custom_object_id: The custom object related to the activity + :param title: The title of the activity + :param description: A description of the activity + :param note: An internal note about the activity + :param location: The location of the activity + :param location_address: + :param all_day_event: Whether the Activity is an all day event or not + :param private: Whether the Activity is private or not + :param group_event: Whether the Activity is a group event or not + :param event_sub_type: The sub type of the group event + :param group_event_type: The type of the group event + :param child: Whether the activity is a child of another activity or not + :param archived: Whether the activity is archived or not + :param deleted: Whether the activity is deleted or not + :param show_as: + :param done: Whether the Activity is done or not + :param start_datetime: The start date and time of the activity + :param end_datetime: The end date and time of the activity + :param activity_date: The date of the activity + :param end_date: The end date of the activity + :param recurrent: Whether the activity is recurrent or not + :param reminder_datetime: The date and time of the reminder + :param reminder_set: Whether the reminder is set or not + :param video_conference_url: The URL of the video conference + :param video_conference_id: The ID of the video conference + :param custom_fields: Custom fields of the activity + :param attendees: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +753,60 @@ async def create_async( request = models.CrmActivitiesAddRequest( raw=raw, service_id=service_id, - activity=utils.get_pydantic_model(activity, models.ActivityInput), + activity=models.ActivityInput( + activity_datetime=activity_datetime, + duration_seconds=duration_seconds, + user_id=user_id, + account_id=account_id, + contact_id=contact_id, + company_id=company_id, + opportunity_id=opportunity_id, + lead_id=lead_id, + owner_id=owner_id, + campaign_id=campaign_id, + case_id=case_id, + asset_id=asset_id, + contract_id=contract_id, + product_id=product_id, + solution_id=solution_id, + custom_object_id=custom_object_id, + type=type_, + title=title, + description=description, + note=note, + location=location, + location_address=utils.get_pydantic_model( + location_address, Optional[models.Address] + ), + all_day_event=all_day_event, + private=private, + group_event=group_event, + event_sub_type=event_sub_type, + group_event_type=group_event_type, + child=child, + archived=archived, + deleted=deleted, + show_as=show_as, + done=done, + start_datetime=start_datetime, + end_datetime=end_datetime, + activity_date=activity_date, + end_date=end_date, + recurrent=recurrent, + reminder_datetime=reminder_datetime, + reminder_set=reminder_set, + video_conference_url=video_conference_url, + video_conference_id=video_conference_id, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + attendees=utils.get_pydantic_model( + attendees, Optional[List[models.ActivityAttendeeInput]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +820,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +904,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmActivitiesOneResponse: r"""Get activity @@ -493,6 +917,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +945,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +1026,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmActivitiesOneResponse: r"""Get activity @@ -612,6 +1039,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +1067,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +1142,123 @@ def update( self, *, id: str, - activity: Union[models.ActivityInput, models.ActivityInputTypedDict], + type_: Nullable[models.ActivityType], service_id: Optional[str] = None, raw: Optional[bool] = False, + activity_datetime: OptionalNullable[str] = UNSET, + duration_seconds: OptionalNullable[int] = UNSET, + user_id: OptionalNullable[str] = UNSET, + account_id: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + opportunity_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + campaign_id: OptionalNullable[str] = UNSET, + case_id: OptionalNullable[str] = UNSET, + asset_id: OptionalNullable[str] = UNSET, + contract_id: OptionalNullable[str] = UNSET, + product_id: OptionalNullable[str] = UNSET, + solution_id: OptionalNullable[str] = UNSET, + custom_object_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + note: OptionalNullable[str] = UNSET, + location: OptionalNullable[str] = UNSET, + location_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + all_day_event: OptionalNullable[bool] = UNSET, + private: OptionalNullable[bool] = UNSET, + group_event: OptionalNullable[bool] = UNSET, + event_sub_type: OptionalNullable[str] = UNSET, + group_event_type: OptionalNullable[str] = UNSET, + child: OptionalNullable[bool] = UNSET, + archived: OptionalNullable[bool] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + show_as: OptionalNullable[models.ShowAs] = UNSET, + done: OptionalNullable[bool] = UNSET, + start_datetime: OptionalNullable[str] = UNSET, + end_datetime: OptionalNullable[str] = UNSET, + activity_date: OptionalNullable[str] = UNSET, + end_date: OptionalNullable[str] = UNSET, + recurrent: Optional[bool] = None, + reminder_datetime: OptionalNullable[str] = UNSET, + reminder_set: OptionalNullable[bool] = UNSET, + video_conference_url: OptionalNullable[str] = UNSET, + video_conference_id: OptionalNullable[str] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + attendees: Optional[ + Union[ + List[models.ActivityAttendeeInput], + List[models.ActivityAttendeeInputTypedDict], + ] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmActivitiesUpdateResponse: r"""Update activity Update activity :param id: ID of the record you are acting upon. - :param activity: + :param type: The type of the activity :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param activity_datetime: The date and time of the activity + :param duration_seconds: The duration of the activity in seconds + :param user_id: The user related to the activity + :param account_id: The account related to the activity + :param contact_id: The contact related to the activity + :param company_id: The company related to the activity + :param opportunity_id: The opportunity related to the activity + :param lead_id: The lead related to the activity + :param owner_id: The owner of the activity + :param campaign_id: The campaign related to the activity + :param case_id: The case related to the activity + :param asset_id: The asset related to the activity + :param contract_id: The contract related to the activity + :param product_id: The product related to the activity + :param solution_id: The solution related to the activity + :param custom_object_id: The custom object related to the activity + :param title: The title of the activity + :param description: A description of the activity + :param note: An internal note about the activity + :param location: The location of the activity + :param location_address: + :param all_day_event: Whether the Activity is an all day event or not + :param private: Whether the Activity is private or not + :param group_event: Whether the Activity is a group event or not + :param event_sub_type: The sub type of the group event + :param group_event_type: The type of the group event + :param child: Whether the activity is a child of another activity or not + :param archived: Whether the activity is archived or not + :param deleted: Whether the activity is deleted or not + :param show_as: + :param done: Whether the Activity is done or not + :param start_datetime: The start date and time of the activity + :param end_datetime: The end date and time of the activity + :param activity_date: The date of the activity + :param end_date: The end date of the activity + :param recurrent: Whether the activity is recurrent or not + :param reminder_datetime: The date and time of the reminder + :param reminder_set: Whether the reminder is set or not + :param video_conference_url: The URL of the video conference + :param video_conference_id: The ID of the video conference + :param custom_fields: Custom fields of the activity + :param attendees: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +1272,60 @@ def update( id=id, service_id=service_id, raw=raw, - activity=utils.get_pydantic_model(activity, models.ActivityInput), + activity=models.ActivityInput( + activity_datetime=activity_datetime, + duration_seconds=duration_seconds, + user_id=user_id, + account_id=account_id, + contact_id=contact_id, + company_id=company_id, + opportunity_id=opportunity_id, + lead_id=lead_id, + owner_id=owner_id, + campaign_id=campaign_id, + case_id=case_id, + asset_id=asset_id, + contract_id=contract_id, + product_id=product_id, + solution_id=solution_id, + custom_object_id=custom_object_id, + type=type_, + title=title, + description=description, + note=note, + location=location, + location_address=utils.get_pydantic_model( + location_address, Optional[models.Address] + ), + all_day_event=all_day_event, + private=private, + group_event=group_event, + event_sub_type=event_sub_type, + group_event_type=group_event_type, + child=child, + archived=archived, + deleted=deleted, + show_as=show_as, + done=done, + start_datetime=start_datetime, + end_datetime=end_datetime, + activity_date=activity_date, + end_date=end_date, + recurrent=recurrent, + reminder_datetime=reminder_datetime, + reminder_set=reminder_set, + video_conference_url=video_conference_url, + video_conference_id=video_conference_id, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + attendees=utils.get_pydantic_model( + attendees, Optional[List[models.ActivityAttendeeInput]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +1339,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +1417,123 @@ async def update_async( self, *, id: str, - activity: Union[models.ActivityInput, models.ActivityInputTypedDict], + type_: Nullable[models.ActivityType], service_id: Optional[str] = None, raw: Optional[bool] = False, + activity_datetime: OptionalNullable[str] = UNSET, + duration_seconds: OptionalNullable[int] = UNSET, + user_id: OptionalNullable[str] = UNSET, + account_id: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + opportunity_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + campaign_id: OptionalNullable[str] = UNSET, + case_id: OptionalNullable[str] = UNSET, + asset_id: OptionalNullable[str] = UNSET, + contract_id: OptionalNullable[str] = UNSET, + product_id: OptionalNullable[str] = UNSET, + solution_id: OptionalNullable[str] = UNSET, + custom_object_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + note: OptionalNullable[str] = UNSET, + location: OptionalNullable[str] = UNSET, + location_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + all_day_event: OptionalNullable[bool] = UNSET, + private: OptionalNullable[bool] = UNSET, + group_event: OptionalNullable[bool] = UNSET, + event_sub_type: OptionalNullable[str] = UNSET, + group_event_type: OptionalNullable[str] = UNSET, + child: OptionalNullable[bool] = UNSET, + archived: OptionalNullable[bool] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + show_as: OptionalNullable[models.ShowAs] = UNSET, + done: OptionalNullable[bool] = UNSET, + start_datetime: OptionalNullable[str] = UNSET, + end_datetime: OptionalNullable[str] = UNSET, + activity_date: OptionalNullable[str] = UNSET, + end_date: OptionalNullable[str] = UNSET, + recurrent: Optional[bool] = None, + reminder_datetime: OptionalNullable[str] = UNSET, + reminder_set: OptionalNullable[bool] = UNSET, + video_conference_url: OptionalNullable[str] = UNSET, + video_conference_id: OptionalNullable[str] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + attendees: Optional[ + Union[ + List[models.ActivityAttendeeInput], + List[models.ActivityAttendeeInputTypedDict], + ] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmActivitiesUpdateResponse: r"""Update activity Update activity :param id: ID of the record you are acting upon. - :param activity: + :param type: The type of the activity :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param activity_datetime: The date and time of the activity + :param duration_seconds: The duration of the activity in seconds + :param user_id: The user related to the activity + :param account_id: The account related to the activity + :param contact_id: The contact related to the activity + :param company_id: The company related to the activity + :param opportunity_id: The opportunity related to the activity + :param lead_id: The lead related to the activity + :param owner_id: The owner of the activity + :param campaign_id: The campaign related to the activity + :param case_id: The case related to the activity + :param asset_id: The asset related to the activity + :param contract_id: The contract related to the activity + :param product_id: The product related to the activity + :param solution_id: The solution related to the activity + :param custom_object_id: The custom object related to the activity + :param title: The title of the activity + :param description: A description of the activity + :param note: An internal note about the activity + :param location: The location of the activity + :param location_address: + :param all_day_event: Whether the Activity is an all day event or not + :param private: Whether the Activity is private or not + :param group_event: Whether the Activity is a group event or not + :param event_sub_type: The sub type of the group event + :param group_event_type: The type of the group event + :param child: Whether the activity is a child of another activity or not + :param archived: Whether the activity is archived or not + :param deleted: Whether the activity is deleted or not + :param show_as: + :param done: Whether the Activity is done or not + :param start_datetime: The start date and time of the activity + :param end_datetime: The end date and time of the activity + :param activity_date: The date of the activity + :param end_date: The end date of the activity + :param recurrent: Whether the activity is recurrent or not + :param reminder_datetime: The date and time of the reminder + :param reminder_set: Whether the reminder is set or not + :param video_conference_url: The URL of the video conference + :param video_conference_id: The ID of the video conference + :param custom_fields: Custom fields of the activity + :param attendees: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1547,60 @@ async def update_async( id=id, service_id=service_id, raw=raw, - activity=utils.get_pydantic_model(activity, models.ActivityInput), + activity=models.ActivityInput( + activity_datetime=activity_datetime, + duration_seconds=duration_seconds, + user_id=user_id, + account_id=account_id, + contact_id=contact_id, + company_id=company_id, + opportunity_id=opportunity_id, + lead_id=lead_id, + owner_id=owner_id, + campaign_id=campaign_id, + case_id=case_id, + asset_id=asset_id, + contract_id=contract_id, + product_id=product_id, + solution_id=solution_id, + custom_object_id=custom_object_id, + type=type_, + title=title, + description=description, + note=note, + location=location, + location_address=utils.get_pydantic_model( + location_address, Optional[models.Address] + ), + all_day_event=all_day_event, + private=private, + group_event=group_event, + event_sub_type=event_sub_type, + group_event_type=group_event_type, + child=child, + archived=archived, + deleted=deleted, + show_as=show_as, + done=done, + start_datetime=start_datetime, + end_datetime=end_datetime, + activity_date=activity_date, + end_date=end_date, + recurrent=recurrent, + reminder_datetime=reminder_datetime, + reminder_set=reminder_set, + video_conference_url=video_conference_url, + video_conference_id=video_conference_id, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + attendees=utils.get_pydantic_model( + attendees, Optional[List[models.ActivityAttendeeInput]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1614,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1697,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmActivitiesDeleteResponse: r"""Delete activity @@ -973,6 +1709,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1736,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1816,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmActivitiesDeleteResponse: r"""Delete activity @@ -1089,6 +1828,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1855,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmActivitiesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/agedcreditors_sdk.py b/src/apideck_unify/agedcreditors_sdk.py new file mode 100644 index 00000000..a94a3633 --- /dev/null +++ b/src/apideck_unify/agedcreditors_sdk.py @@ -0,0 +1,268 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from apideck_unify import models, utils +from apideck_unify._hooks import HookContext +from apideck_unify.types import OptionalNullable, UNSET +from apideck_unify.utils import get_security_from_env +from typing import Any, Dict, Mapping, Optional, Union + + +class AgedCreditorsSDK(BaseSDK): + def get( + self, + *, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.AgedReportFilter, models.AgedReportFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AccountingAgedCreditorsOneResponse: + r"""Get Aged Creditors + + Get Aged Creditors + + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.AccountingAgedCreditorsOneRequest( + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model( + filter_, Optional[models.AgedReportFilter] + ), + pass_through=pass_through, + fields=fields, + ) + + req = self.build_request( + method="GET", + path="/accounting/aged-creditors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingAgedCreditorsOneGlobals( + consumer_id=self.sdk_configuration.globals.consumer_id, + app_id=self.sdk_configuration.globals.app_id, + ), + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="accounting.agedCreditorsOne", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "401", "402", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.GetAgedCreditorsResponse) + if utils.match_response(http_res, "400", "application/json"): + data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) + raise models.BadRequestResponse(data=data) + if utils.match_response(http_res, "401", "application/json"): + data = utils.unmarshal_json(http_res.text, models.UnauthorizedResponseData) + raise models.UnauthorizedResponse(data=data) + if utils.match_response(http_res, "402", "application/json"): + data = utils.unmarshal_json( + http_res.text, models.PaymentRequiredResponseData + ) + raise models.PaymentRequiredResponse(data=data) + if utils.match_response(http_res, "404", "application/json"): + data = utils.unmarshal_json(http_res.text, models.NotFoundResponseData) + raise models.NotFoundResponse(data=data) + if utils.match_response(http_res, "422", "application/json"): + data = utils.unmarshal_json(http_res.text, models.UnprocessableResponseData) + raise models.UnprocessableResponse(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "default", "application/json"): + return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.AgedReportFilter, models.AgedReportFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AccountingAgedCreditorsOneResponse: + r"""Get Aged Creditors + + Get Aged Creditors + + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.AccountingAgedCreditorsOneRequest( + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model( + filter_, Optional[models.AgedReportFilter] + ), + pass_through=pass_through, + fields=fields, + ) + + req = self.build_request_async( + method="GET", + path="/accounting/aged-creditors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingAgedCreditorsOneGlobals( + consumer_id=self.sdk_configuration.globals.consumer_id, + app_id=self.sdk_configuration.globals.app_id, + ), + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="accounting.agedCreditorsOne", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "401", "402", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.GetAgedCreditorsResponse) + if utils.match_response(http_res, "400", "application/json"): + data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) + raise models.BadRequestResponse(data=data) + if utils.match_response(http_res, "401", "application/json"): + data = utils.unmarshal_json(http_res.text, models.UnauthorizedResponseData) + raise models.UnauthorizedResponse(data=data) + if utils.match_response(http_res, "402", "application/json"): + data = utils.unmarshal_json( + http_res.text, models.PaymentRequiredResponseData + ) + raise models.PaymentRequiredResponse(data=data) + if utils.match_response(http_res, "404", "application/json"): + data = utils.unmarshal_json(http_res.text, models.NotFoundResponseData) + raise models.NotFoundResponse(data=data) + if utils.match_response(http_res, "422", "application/json"): + data = utils.unmarshal_json(http_res.text, models.UnprocessableResponseData) + raise models.UnprocessableResponse(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "default", "application/json"): + return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/src/apideck_unify/ageddebtors_sdk.py b/src/apideck_unify/ageddebtors_sdk.py new file mode 100644 index 00000000..f171e7f6 --- /dev/null +++ b/src/apideck_unify/ageddebtors_sdk.py @@ -0,0 +1,268 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from apideck_unify import models, utils +from apideck_unify._hooks import HookContext +from apideck_unify.types import OptionalNullable, UNSET +from apideck_unify.utils import get_security_from_env +from typing import Any, Dict, Mapping, Optional, Union + + +class AgedDebtorsSDK(BaseSDK): + def get( + self, + *, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.AgedReportFilter, models.AgedReportFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AccountingAgedDebtorsOneResponse: + r"""Get Aged Debtors + + Get Aged Debtors + + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.AccountingAgedDebtorsOneRequest( + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model( + filter_, Optional[models.AgedReportFilter] + ), + pass_through=pass_through, + fields=fields, + ) + + req = self.build_request( + method="GET", + path="/accounting/aged-debtors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingAgedDebtorsOneGlobals( + consumer_id=self.sdk_configuration.globals.consumer_id, + app_id=self.sdk_configuration.globals.app_id, + ), + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="accounting.agedDebtorsOne", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "401", "402", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.GetAgedDebtorsResponse) + if utils.match_response(http_res, "400", "application/json"): + data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) + raise models.BadRequestResponse(data=data) + if utils.match_response(http_res, "401", "application/json"): + data = utils.unmarshal_json(http_res.text, models.UnauthorizedResponseData) + raise models.UnauthorizedResponse(data=data) + if utils.match_response(http_res, "402", "application/json"): + data = utils.unmarshal_json( + http_res.text, models.PaymentRequiredResponseData + ) + raise models.PaymentRequiredResponse(data=data) + if utils.match_response(http_res, "404", "application/json"): + data = utils.unmarshal_json(http_res.text, models.NotFoundResponseData) + raise models.NotFoundResponse(data=data) + if utils.match_response(http_res, "422", "application/json"): + data = utils.unmarshal_json(http_res.text, models.UnprocessableResponseData) + raise models.UnprocessableResponse(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "default", "application/json"): + return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.AgedReportFilter, models.AgedReportFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.AccountingAgedDebtorsOneResponse: + r"""Get Aged Debtors + + Get Aged Debtors + + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + request = models.AccountingAgedDebtorsOneRequest( + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model( + filter_, Optional[models.AgedReportFilter] + ), + pass_through=pass_through, + fields=fields, + ) + + req = self.build_request_async( + method="GET", + path="/accounting/aged-debtors", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingAgedDebtorsOneGlobals( + consumer_id=self.sdk_configuration.globals.consumer_id, + app_id=self.sdk_configuration.globals.app_id, + ), + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="accounting.agedDebtorsOne", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "401", "402", "404", "422", "4XX", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.GetAgedDebtorsResponse) + if utils.match_response(http_res, "400", "application/json"): + data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) + raise models.BadRequestResponse(data=data) + if utils.match_response(http_res, "401", "application/json"): + data = utils.unmarshal_json(http_res.text, models.UnauthorizedResponseData) + raise models.UnauthorizedResponse(data=data) + if utils.match_response(http_res, "402", "application/json"): + data = utils.unmarshal_json( + http_res.text, models.PaymentRequiredResponseData + ) + raise models.PaymentRequiredResponse(data=data) + if utils.match_response(http_res, "404", "application/json"): + data = utils.unmarshal_json(http_res.text, models.NotFoundResponseData) + raise models.NotFoundResponse(data=data) + if utils.match_response(http_res, "422", "application/json"): + data = utils.unmarshal_json(http_res.text, models.UnprocessableResponseData) + raise models.UnprocessableResponse(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "default", "application/json"): + return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/src/apideck_unify/apideck_companies.py b/src/apideck_unify/apideck_companies.py index c161e8b3..1367419b 100644 --- a/src/apideck_unify/apideck_companies.py +++ b/src/apideck_unify/apideck_companies.py @@ -3,30 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class ApideckCompanies(BaseSDK): def list( self, *, - request: Union[ - models.HrisCompaniesAllRequest, models.HrisCompaniesAllRequestTypedDict - ] = models.HrisCompaniesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.HrisCompaniesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.HrisCompaniesAllResponse]: r"""List Companies List Companies - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisCompaniesAllRequest) - request = cast(models.HrisCompaniesAllRequest, request) + request = models.HrisCompaniesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +101,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.HrisCompaniesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetHrisCompaniesResponse) + return models.HrisCompaniesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetHrisCompaniesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +150,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.HrisCompaniesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +169,31 @@ def list( async def list_async( self, *, - request: Union[ - models.HrisCompaniesAllRequest, models.HrisCompaniesAllRequestTypedDict - ] = models.HrisCompaniesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.HrisCompaniesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.HrisCompaniesAllResponse]: r"""List Companies List Companies - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +203,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisCompaniesAllRequest) - request = cast(models.HrisCompaniesAllRequest, request) + request = models.HrisCompaniesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +223,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +257,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.HrisCompaniesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetHrisCompaniesResponse) + return models.HrisCompaniesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetHrisCompaniesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +306,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.HrisCompaniesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +325,55 @@ async def list_async( def create( self, *, - hris_company: Union[models.HrisCompanyInput, models.HrisCompanyInputTypedDict], + legal_name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + display_name: OptionalNullable[str] = UNSET, + subdomain: OptionalNullable[str] = UNSET, + status: Optional[models.HrisCompanyStatus] = None, + company_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + debtor_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisCompaniesAddResponse: r"""Create Company Create Company - :param hris_company: + :param legal_name: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_name: + :param subdomain: + :param status: + :param company_number: An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param debtor_id: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,8 +386,27 @@ def create( request = models.HrisCompaniesAddRequest( raw=raw, service_id=service_id, - hris_company=utils.get_pydantic_model( - hris_company, models.HrisCompanyInput + hris_company=models.HrisCompanyInput( + legal_name=legal_name, + display_name=display_name, + subdomain=subdomain, + status=status, + company_number=company_number, + currency=currency, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + debtor_id=debtor_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -281,6 +421,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +498,55 @@ def create( async def create_async( self, *, - hris_company: Union[models.HrisCompanyInput, models.HrisCompanyInputTypedDict], + legal_name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + display_name: OptionalNullable[str] = UNSET, + subdomain: OptionalNullable[str] = UNSET, + status: Optional[models.HrisCompanyStatus] = None, + company_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + debtor_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisCompaniesAddResponse: r"""Create Company Create Company - :param hris_company: + :param legal_name: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_name: + :param subdomain: + :param status: + :param company_number: An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param debtor_id: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,8 +559,27 @@ async def create_async( request = models.HrisCompaniesAddRequest( raw=raw, service_id=service_id, - hris_company=utils.get_pydantic_model( - hris_company, models.HrisCompanyInput + hris_company=models.HrisCompanyInput( + legal_name=legal_name, + display_name=display_name, + subdomain=subdomain, + status=status, + company_number=company_number, + currency=currency, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + debtor_id=debtor_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -402,6 +594,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -485,6 +678,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisCompaniesOneResponse: r"""Get Company @@ -497,6 +691,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -524,6 +719,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -604,6 +800,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisCompaniesOneResponse: r"""Get Company @@ -616,6 +813,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -643,6 +841,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -717,24 +916,56 @@ def update( self, *, id: str, - hris_company: Union[models.HrisCompanyInput, models.HrisCompanyInputTypedDict], + legal_name: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + display_name: OptionalNullable[str] = UNSET, + subdomain: OptionalNullable[str] = UNSET, + status: Optional[models.HrisCompanyStatus] = None, + company_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + debtor_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisCompaniesUpdateResponse: r"""Update Company Update Company :param id: ID of the record you are acting upon. - :param hris_company: + :param legal_name: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_name: + :param subdomain: + :param status: + :param company_number: An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param debtor_id: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -748,8 +979,27 @@ def update( id=id, service_id=service_id, raw=raw, - hris_company=utils.get_pydantic_model( - hris_company, models.HrisCompanyInput + hris_company=models.HrisCompanyInput( + legal_name=legal_name, + display_name=display_name, + subdomain=subdomain, + status=status, + company_number=company_number, + currency=currency, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + debtor_id=debtor_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -764,6 +1014,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -841,24 +1092,56 @@ async def update_async( self, *, id: str, - hris_company: Union[models.HrisCompanyInput, models.HrisCompanyInputTypedDict], + legal_name: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + display_name: OptionalNullable[str] = UNSET, + subdomain: OptionalNullable[str] = UNSET, + status: Optional[models.HrisCompanyStatus] = None, + company_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + debtor_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisCompaniesUpdateResponse: r"""Update Company Update Company :param id: ID of the record you are acting upon. - :param hris_company: + :param legal_name: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_name: + :param subdomain: + :param status: + :param company_number: An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param debtor_id: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -872,8 +1155,27 @@ async def update_async( id=id, service_id=service_id, raw=raw, - hris_company=utils.get_pydantic_model( - hris_company, models.HrisCompanyInput + hris_company=models.HrisCompanyInput( + legal_name=legal_name, + display_name=display_name, + subdomain=subdomain, + status=status, + company_number=company_number, + currency=currency, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + debtor_id=debtor_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -888,6 +1190,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -970,6 +1273,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisCompaniesDeleteResponse: r"""Delete Company @@ -981,6 +1285,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1007,6 +1312,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1086,6 +1392,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisCompaniesDeleteResponse: r"""Delete Company @@ -1097,6 +1404,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1123,6 +1431,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisCompaniesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/apideck_customers.py b/src/apideck_unify/apideck_customers.py index c294d83e..7145f21e 100644 --- a/src/apideck_unify/apideck_customers.py +++ b/src/apideck_unify/apideck_customers.py @@ -3,31 +3,48 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional, Union class ApideckCustomers(BaseSDK): def list( self, *, - request: Union[ - models.EcommerceCustomersAllRequest, - models.EcommerceCustomersAllRequestTypedDict, - ] = models.EcommerceCustomersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[ + models.EcommerceCustomersFilter, + models.EcommerceCustomersFilterTypedDict, + ] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.EcommerceCustomersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.EcommerceCustomersAllResponse]: r"""List Customers List Customers - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +54,17 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.EcommerceCustomersAllRequest) - request = cast(models.EcommerceCustomersAllRequest, request) + request = models.EcommerceCustomersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.EcommerceCustomersFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +77,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceCustomersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,10 +111,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.EcommerceCustomersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetEcommerceCustomersResponse + return models.EcommerceCustomersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetEcommerceCustomersResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -113,7 +161,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.EcommerceCustomersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +180,38 @@ def list( async def list_async( self, *, - request: Union[ - models.EcommerceCustomersAllRequest, - models.EcommerceCustomersAllRequestTypedDict, - ] = models.EcommerceCustomersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[ + models.EcommerceCustomersFilter, + models.EcommerceCustomersFilterTypedDict, + ] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.EcommerceCustomersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.EcommerceCustomersAllResponse]: r"""List Customers List Customers - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,9 +221,17 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.EcommerceCustomersAllRequest) - request = cast(models.EcommerceCustomersAllRequest, request) + request = models.EcommerceCustomersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.EcommerceCustomersFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -167,6 +244,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceCustomersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -200,10 +278,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.EcommerceCustomersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetEcommerceCustomersResponse + return models.EcommerceCustomersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetEcommerceCustomersResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -228,7 +328,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.EcommerceCustomersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -249,6 +354,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.EcommerceCustomersOneResponse: r"""Get Customer @@ -261,6 +367,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -288,6 +395,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceCustomersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -370,6 +478,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.EcommerceCustomersOneResponse: r"""Get Customer @@ -382,6 +491,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -409,6 +519,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceCustomersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/apideck_departments.py b/src/apideck_unify/apideck_departments.py index d976f0a4..d149d988 100644 --- a/src/apideck_unify/apideck_departments.py +++ b/src/apideck_unify/apideck_departments.py @@ -3,30 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class ApideckDepartments(BaseSDK): def list( self, *, - request: Union[ - models.HrisDepartmentsAllRequest, models.HrisDepartmentsAllRequestTypedDict - ] = models.HrisDepartmentsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.HrisDepartmentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.HrisDepartmentsAllResponse]: r"""List Departments List Departments - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisDepartmentsAllRequest) - request = cast(models.HrisDepartmentsAllRequest, request) + request = models.HrisDepartmentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +101,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.HrisDepartmentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetDepartmentsResponse) + return models.HrisDepartmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetDepartmentsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +150,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.HrisDepartmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +169,31 @@ def list( async def list_async( self, *, - request: Union[ - models.HrisDepartmentsAllRequest, models.HrisDepartmentsAllRequestTypedDict - ] = models.HrisDepartmentsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.HrisDepartmentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.HrisDepartmentsAllResponse]: r"""List Departments List Departments - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +203,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisDepartmentsAllRequest) - request = cast(models.HrisDepartmentsAllRequest, request) + request = models.HrisDepartmentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +223,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +257,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.HrisDepartmentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetDepartmentsResponse) + return models.HrisDepartmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetDepartmentsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +306,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.HrisDepartmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +325,33 @@ async def list_async( def create( self, *, - department: Union[models.DepartmentInput, models.DepartmentInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + name: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisDepartmentsAddResponse: r"""Create Department Create Department - :param department: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param name: Department name + :param code: + :param description: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +364,14 @@ def create( request = models.HrisDepartmentsAddRequest( raw=raw, service_id=service_id, - department=utils.get_pydantic_model(department, models.DepartmentInput), + department=models.DepartmentInput( + name=name, + code=code, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +385,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +462,33 @@ def create( async def create_async( self, *, - department: Union[models.DepartmentInput, models.DepartmentInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + name: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisDepartmentsAddResponse: r"""Create Department Create Department - :param department: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param name: Department name + :param code: + :param description: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +501,14 @@ async def create_async( request = models.HrisDepartmentsAddRequest( raw=raw, service_id=service_id, - department=utils.get_pydantic_model(department, models.DepartmentInput), + department=models.DepartmentInput( + name=name, + code=code, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +522,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +606,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisDepartmentsOneResponse: r"""Get Department @@ -493,6 +619,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +647,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +728,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisDepartmentsOneResponse: r"""Get Department @@ -612,6 +741,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +769,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +844,34 @@ def update( self, *, id: str, - department: Union[models.DepartmentInput, models.DepartmentInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisDepartmentsUpdateResponse: r"""Update Department Update Department :param id: ID of the record you are acting upon. - :param department: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: Department name + :param code: + :param description: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +885,14 @@ def update( id=id, service_id=service_id, raw=raw, - department=utils.get_pydantic_model(department, models.DepartmentInput), + department=models.DepartmentInput( + name=name, + code=code, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +906,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +984,34 @@ async def update_async( self, *, id: str, - department: Union[models.DepartmentInput, models.DepartmentInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisDepartmentsUpdateResponse: r"""Update Department Update Department :param id: ID of the record you are acting upon. - :param department: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: Department name + :param code: + :param description: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1025,14 @@ async def update_async( id=id, service_id=service_id, raw=raw, - department=utils.get_pydantic_model(department, models.DepartmentInput), + department=models.DepartmentInput( + name=name, + code=code, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1046,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1129,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisDepartmentsDeleteResponse: r"""Delete Department @@ -973,6 +1141,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1168,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1248,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisDepartmentsDeleteResponse: r"""Delete Department @@ -1089,6 +1260,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1287,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisDepartmentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/apiresourcecoverage_sdk.py b/src/apideck_unify/apiresourcecoverage_sdk.py index d6972e39..abf4b910 100644 --- a/src/apideck_unify/apiresourcecoverage_sdk.py +++ b/src/apideck_unify/apiresourcecoverage_sdk.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class APIResourceCoverageSDK(BaseSDK): @@ -17,6 +17,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorAPIResourceCoverageOneResponse: r"""Get API Resource Coverage @@ -27,6 +28,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -52,6 +54,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorAPIResourceCoverageOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -125,6 +128,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorAPIResourceCoverageOneResponse: r"""Get API Resource Coverage @@ -135,6 +139,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -160,6 +165,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorAPIResourceCoverageOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), diff --git a/src/apideck_unify/apiresources.py b/src/apideck_unify/apiresources.py index ecab4c6d..99980205 100644 --- a/src/apideck_unify/apiresources.py +++ b/src/apideck_unify/apiresources.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class APIResources(BaseSDK): @@ -17,6 +17,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorAPIResourcesOneResponse: r"""Get API Resource @@ -27,6 +28,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -52,6 +54,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorAPIResourcesOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -123,6 +126,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorAPIResourcesOneResponse: r"""Get API Resource @@ -133,6 +137,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -158,6 +163,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorAPIResourcesOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), diff --git a/src/apideck_unify/apis.py b/src/apideck_unify/apis.py index c457e573..2312140d 100644 --- a/src/apideck_unify/apis.py +++ b/src/apideck_unify/apis.py @@ -5,7 +5,8 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional, Union class Apis(BaseSDK): @@ -18,7 +19,8 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ConnectorApisAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ConnectorApisAllResponse]: r"""List APIs List APIs @@ -29,6 +31,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -55,6 +58,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorApisAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -87,9 +91,27 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.ConnectorApisAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetApisResponse) + return models.ConnectorApisAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetApisResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -107,7 +129,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.ConnectorApisAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,7 +154,8 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ConnectorApisAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ConnectorApisAllResponse]: r"""List APIs List APIs @@ -138,6 +166,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -164,6 +193,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorApisAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -196,9 +226,27 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.ConnectorApisAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetApisResponse) + return models.ConnectorApisAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetApisResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -216,7 +264,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.ConnectorApisAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -234,6 +287,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorApisOneResponse: r"""Get API @@ -243,6 +297,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,6 +322,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorApisOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -337,6 +393,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorApisOneResponse: r"""Get API @@ -346,6 +403,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -370,6 +428,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorApisOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), diff --git a/src/apideck_unify/applicants.py b/src/apideck_unify/applicants.py index b6b22bb7..9326389d 100644 --- a/src/apideck_unify/applicants.py +++ b/src/apideck_unify/applicants.py @@ -3,30 +3,46 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Applicants(BaseSDK): def list( self, *, - request: Union[ - models.AtsApplicantsAllRequest, models.AtsApplicantsAllRequestTypedDict - ] = models.AtsApplicantsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.ApplicantsFilter, models.ApplicantsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AtsApplicantsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AtsApplicantsAllResponse]: r"""List Applicants List Applicants - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +52,17 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AtsApplicantsAllRequest) - request = cast(models.AtsApplicantsAllRequest, request) + request = models.AtsApplicantsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.ApplicantsFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +75,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +109,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AtsApplicantsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetApplicantsResponse) + return models.AtsApplicantsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetApplicantsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +159,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AtsApplicantsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +178,35 @@ def list( async def list_async( self, *, - request: Union[ - models.AtsApplicantsAllRequest, models.AtsApplicantsAllRequestTypedDict - ] = models.AtsApplicantsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.ApplicantsFilter, models.ApplicantsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AtsApplicantsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AtsApplicantsAllResponse]: r"""List Applicants List Applicants - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +216,17 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AtsApplicantsAllRequest) - request = cast(models.AtsApplicantsAllRequest, request) + request = models.AtsApplicantsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.ApplicantsFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +239,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +273,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AtsApplicantsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetApplicantsResponse) + return models.AtsApplicantsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetApplicantsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +323,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AtsApplicantsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +342,97 @@ async def list_async( def create( self, *, - applicant: Union[models.ApplicantInput, models.ApplicantInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + name: Optional[str] = None, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + initials: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + cover_letter: Optional[str] = None, + photo_url: OptionalNullable[str] = UNSET, + headline: Optional[str] = None, + title: OptionalNullable[str] = UNSET, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + websites: Optional[ + Union[List[models.Websites], List[models.WebsitesTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLinks], List[models.SocialLinksTypedDict]] + ] = None, + stage_id: Optional[str] = None, + recruiter_id: Optional[str] = None, + coordinator_id: Optional[str] = None, + application_ids: OptionalNullable[List[str]] = UNSET, + applications: OptionalNullable[List[str]] = UNSET, + followers: OptionalNullable[List[str]] = UNSET, + sources: OptionalNullable[List[str]] = UNSET, + confidential: Optional[bool] = None, + anonymized: Optional[bool] = None, + tags: OptionalNullable[List[str]] = UNSET, + archived: OptionalNullable[bool] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + record_url: OptionalNullable[str] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicantsAddResponse: r"""Create Applicant Create Applicant - :param applicant: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param name: The name of an applicant. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param middle_name: Middle name of the person. + :param initials: The initials of the person, usually derived from their first, middle, and last names. + :param birthday: The date of birth of the person. + :param cover_letter: + :param photo_url: The URL of the photo of a person. + :param headline: Typically a list of previous companies where the contact has worked or schools that the contact has attended + :param title: The job title of the person. + :param emails: + :param custom_fields: + :param phone_numbers: + :param addresses: + :param websites: + :param social_links: + :param stage_id: + :param recruiter_id: + :param coordinator_id: + :param application_ids: + :param applications: + :param followers: + :param sources: + :param confidential: + :param anonymized: + :param tags: + :param archived: + :param owner_id: + :param record_url: + :param deleted: Flag to indicate if the object is deleted. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +445,51 @@ def create( request = models.AtsApplicantsAddRequest( raw=raw, service_id=service_id, - applicant=utils.get_pydantic_model(applicant, models.ApplicantInput), + applicant=models.ApplicantInput( + name=name, + first_name=first_name, + last_name=last_name, + middle_name=middle_name, + initials=initials, + birthday=birthday, + cover_letter=cover_letter, + photo_url=photo_url, + headline=headline, + title=title, + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Websites]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLinks]] + ), + stage_id=stage_id, + recruiter_id=recruiter_id, + coordinator_id=coordinator_id, + application_ids=application_ids, + applications=applications, + followers=followers, + sources=sources, + confidential=confidential, + anonymized=anonymized, + tags=tags, + archived=archived, + owner_id=owner_id, + record_url=record_url, + deleted=deleted, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +503,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +580,97 @@ def create( async def create_async( self, *, - applicant: Union[models.ApplicantInput, models.ApplicantInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + name: Optional[str] = None, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + initials: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + cover_letter: Optional[str] = None, + photo_url: OptionalNullable[str] = UNSET, + headline: Optional[str] = None, + title: OptionalNullable[str] = UNSET, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + websites: Optional[ + Union[List[models.Websites], List[models.WebsitesTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLinks], List[models.SocialLinksTypedDict]] + ] = None, + stage_id: Optional[str] = None, + recruiter_id: Optional[str] = None, + coordinator_id: Optional[str] = None, + application_ids: OptionalNullable[List[str]] = UNSET, + applications: OptionalNullable[List[str]] = UNSET, + followers: OptionalNullable[List[str]] = UNSET, + sources: OptionalNullable[List[str]] = UNSET, + confidential: Optional[bool] = None, + anonymized: Optional[bool] = None, + tags: OptionalNullable[List[str]] = UNSET, + archived: OptionalNullable[bool] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + record_url: OptionalNullable[str] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicantsAddResponse: r"""Create Applicant Create Applicant - :param applicant: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param name: The name of an applicant. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param middle_name: Middle name of the person. + :param initials: The initials of the person, usually derived from their first, middle, and last names. + :param birthday: The date of birth of the person. + :param cover_letter: + :param photo_url: The URL of the photo of a person. + :param headline: Typically a list of previous companies where the contact has worked or schools that the contact has attended + :param title: The job title of the person. + :param emails: + :param custom_fields: + :param phone_numbers: + :param addresses: + :param websites: + :param social_links: + :param stage_id: + :param recruiter_id: + :param coordinator_id: + :param application_ids: + :param applications: + :param followers: + :param sources: + :param confidential: + :param anonymized: + :param tags: + :param archived: + :param owner_id: + :param record_url: + :param deleted: Flag to indicate if the object is deleted. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +683,51 @@ async def create_async( request = models.AtsApplicantsAddRequest( raw=raw, service_id=service_id, - applicant=utils.get_pydantic_model(applicant, models.ApplicantInput), + applicant=models.ApplicantInput( + name=name, + first_name=first_name, + last_name=last_name, + middle_name=middle_name, + initials=initials, + birthday=birthday, + cover_letter=cover_letter, + photo_url=photo_url, + headline=headline, + title=title, + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Websites]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLinks]] + ), + stage_id=stage_id, + recruiter_id=recruiter_id, + coordinator_id=coordinator_id, + application_ids=application_ids, + applications=applications, + followers=followers, + sources=sources, + confidential=confidential, + anonymized=anonymized, + tags=tags, + archived=archived, + owner_id=owner_id, + record_url=record_url, + deleted=deleted, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +741,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +825,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicantsOneResponse: r"""Get Applicant @@ -493,6 +838,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +866,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +947,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicantsOneResponse: r"""Get Applicant @@ -612,6 +960,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +988,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +1063,98 @@ def update( self, *, id: str, - applicant: Union[models.ApplicantInput, models.ApplicantInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: Optional[str] = None, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + initials: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + cover_letter: Optional[str] = None, + photo_url: OptionalNullable[str] = UNSET, + headline: Optional[str] = None, + title: OptionalNullable[str] = UNSET, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + websites: Optional[ + Union[List[models.Websites], List[models.WebsitesTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLinks], List[models.SocialLinksTypedDict]] + ] = None, + stage_id: Optional[str] = None, + recruiter_id: Optional[str] = None, + coordinator_id: Optional[str] = None, + application_ids: OptionalNullable[List[str]] = UNSET, + applications: OptionalNullable[List[str]] = UNSET, + followers: OptionalNullable[List[str]] = UNSET, + sources: OptionalNullable[List[str]] = UNSET, + confidential: Optional[bool] = None, + anonymized: Optional[bool] = None, + tags: OptionalNullable[List[str]] = UNSET, + archived: OptionalNullable[bool] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + record_url: OptionalNullable[str] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicantsUpdateResponse: r"""Update Applicant Update Applicant :param id: ID of the record you are acting upon. - :param applicant: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: The name of an applicant. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param middle_name: Middle name of the person. + :param initials: The initials of the person, usually derived from their first, middle, and last names. + :param birthday: The date of birth of the person. + :param cover_letter: + :param photo_url: The URL of the photo of a person. + :param headline: Typically a list of previous companies where the contact has worked or schools that the contact has attended + :param title: The job title of the person. + :param emails: + :param custom_fields: + :param phone_numbers: + :param addresses: + :param websites: + :param social_links: + :param stage_id: + :param recruiter_id: + :param coordinator_id: + :param application_ids: + :param applications: + :param followers: + :param sources: + :param confidential: + :param anonymized: + :param tags: + :param archived: + :param owner_id: + :param record_url: + :param deleted: Flag to indicate if the object is deleted. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +1168,51 @@ def update( id=id, service_id=service_id, raw=raw, - applicant=utils.get_pydantic_model(applicant, models.ApplicantInput), + applicant=models.ApplicantInput( + name=name, + first_name=first_name, + last_name=last_name, + middle_name=middle_name, + initials=initials, + birthday=birthday, + cover_letter=cover_letter, + photo_url=photo_url, + headline=headline, + title=title, + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Websites]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLinks]] + ), + stage_id=stage_id, + recruiter_id=recruiter_id, + coordinator_id=coordinator_id, + application_ids=application_ids, + applications=applications, + followers=followers, + sources=sources, + confidential=confidential, + anonymized=anonymized, + tags=tags, + archived=archived, + owner_id=owner_id, + record_url=record_url, + deleted=deleted, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +1226,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +1304,98 @@ async def update_async( self, *, id: str, - applicant: Union[models.ApplicantInput, models.ApplicantInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: Optional[str] = None, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + initials: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + cover_letter: Optional[str] = None, + photo_url: OptionalNullable[str] = UNSET, + headline: Optional[str] = None, + title: OptionalNullable[str] = UNSET, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + websites: Optional[ + Union[List[models.Websites], List[models.WebsitesTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLinks], List[models.SocialLinksTypedDict]] + ] = None, + stage_id: Optional[str] = None, + recruiter_id: Optional[str] = None, + coordinator_id: Optional[str] = None, + application_ids: OptionalNullable[List[str]] = UNSET, + applications: OptionalNullable[List[str]] = UNSET, + followers: OptionalNullable[List[str]] = UNSET, + sources: OptionalNullable[List[str]] = UNSET, + confidential: Optional[bool] = None, + anonymized: Optional[bool] = None, + tags: OptionalNullable[List[str]] = UNSET, + archived: OptionalNullable[bool] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + record_url: OptionalNullable[str] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicantsUpdateResponse: r"""Update Applicant Update Applicant :param id: ID of the record you are acting upon. - :param applicant: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: The name of an applicant. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param middle_name: Middle name of the person. + :param initials: The initials of the person, usually derived from their first, middle, and last names. + :param birthday: The date of birth of the person. + :param cover_letter: + :param photo_url: The URL of the photo of a person. + :param headline: Typically a list of previous companies where the contact has worked or schools that the contact has attended + :param title: The job title of the person. + :param emails: + :param custom_fields: + :param phone_numbers: + :param addresses: + :param websites: + :param social_links: + :param stage_id: + :param recruiter_id: + :param coordinator_id: + :param application_ids: + :param applications: + :param followers: + :param sources: + :param confidential: + :param anonymized: + :param tags: + :param archived: + :param owner_id: + :param record_url: + :param deleted: Flag to indicate if the object is deleted. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1409,51 @@ async def update_async( id=id, service_id=service_id, raw=raw, - applicant=utils.get_pydantic_model(applicant, models.ApplicantInput), + applicant=models.ApplicantInput( + name=name, + first_name=first_name, + last_name=last_name, + middle_name=middle_name, + initials=initials, + birthday=birthday, + cover_letter=cover_letter, + photo_url=photo_url, + headline=headline, + title=title, + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Websites]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLinks]] + ), + stage_id=stage_id, + recruiter_id=recruiter_id, + coordinator_id=coordinator_id, + application_ids=application_ids, + applications=applications, + followers=followers, + sources=sources, + confidential=confidential, + anonymized=anonymized, + tags=tags, + archived=archived, + owner_id=owner_id, + record_url=record_url, + deleted=deleted, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1467,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1550,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicantsDeleteResponse: r"""Delete Applicant @@ -973,6 +1562,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1589,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1669,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicantsDeleteResponse: r"""Delete Applicant @@ -1089,6 +1681,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1708,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicantsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/applications.py b/src/apideck_unify/applications.py index 332b1d3f..162ba2f1 100644 --- a/src/apideck_unify/applications.py +++ b/src/apideck_unify/applications.py @@ -3,30 +3,39 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Applications(BaseSDK): def list( self, *, - request: Union[ - models.AtsApplicationsAllRequest, models.AtsApplicationsAllRequestTypedDict - ] = models.AtsApplicationsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + pass_through: Optional[Dict[str, Any]] = None, + limit: Optional[int] = 20, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AtsApplicationsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AtsApplicationsAllResponse]: r"""List Applications List Applications - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +45,13 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AtsApplicationsAllRequest) - request = cast(models.AtsApplicationsAllRequest, request) + request = models.AtsApplicationsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + pass_through=pass_through, + limit=limit, + ) req = self.build_request( method="GET", @@ -51,6 +64,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +98,31 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AtsApplicationsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + pass_through=pass_through, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetApplicationsResponse) + return models.AtsApplicationsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetApplicationsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +146,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AtsApplicationsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +165,29 @@ def list( async def list_async( self, *, - request: Union[ - models.AtsApplicationsAllRequest, models.AtsApplicationsAllRequestTypedDict - ] = models.AtsApplicationsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + pass_through: Optional[Dict[str, Any]] = None, + limit: Optional[int] = 20, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AtsApplicationsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AtsApplicationsAllResponse]: r"""List Applications List Applications - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +197,13 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AtsApplicationsAllRequest) - request = cast(models.AtsApplicationsAllRequest, request) + request = models.AtsApplicationsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + pass_through=pass_through, + limit=limit, + ) req = self.build_request_async( method="GET", @@ -163,6 +216,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +250,31 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AtsApplicationsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + pass_through=pass_through, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetApplicationsResponse) + return models.AtsApplicationsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetApplicationsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +298,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AtsApplicationsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +317,35 @@ async def list_async( def create( self, *, - application: Union[models.ApplicationInput, models.ApplicationInputTypedDict], + applicant_id: Nullable[str], + job_id: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + status: OptionalNullable[models.ApplicationStatus] = UNSET, + stage: Optional[Union[models.Stage, models.StageTypedDict]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicationsAddResponse: r"""Create Application Create Application - :param application: + :param applicant_id: + :param job_id: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param status: + :param stage: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +358,15 @@ def create( request = models.AtsApplicationsAddRequest( raw=raw, service_id=service_id, - application=utils.get_pydantic_model(application, models.ApplicationInput), + application=models.ApplicationInput( + applicant_id=applicant_id, + job_id=job_id, + status=status, + stage=utils.get_pydantic_model(stage, Optional[models.Stage]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +380,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +457,35 @@ def create( async def create_async( self, *, - application: Union[models.ApplicationInput, models.ApplicationInputTypedDict], + applicant_id: Nullable[str], + job_id: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + status: OptionalNullable[models.ApplicationStatus] = UNSET, + stage: Optional[Union[models.Stage, models.StageTypedDict]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicationsAddResponse: r"""Create Application Create Application - :param application: + :param applicant_id: + :param job_id: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param status: + :param stage: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +498,15 @@ async def create_async( request = models.AtsApplicationsAddRequest( raw=raw, service_id=service_id, - application=utils.get_pydantic_model(application, models.ApplicationInput), + application=models.ApplicationInput( + applicant_id=applicant_id, + job_id=job_id, + status=status, + stage=utils.get_pydantic_model(stage, Optional[models.Stage]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +520,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -480,6 +603,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicationsOneResponse: r"""Get Application @@ -491,6 +615,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -517,6 +642,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -596,6 +722,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicationsOneResponse: r"""Get Application @@ -607,6 +734,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -633,6 +761,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -707,24 +836,36 @@ def update( self, *, id: str, - application: Union[models.ApplicationInput, models.ApplicationInputTypedDict], + applicant_id: Nullable[str], + job_id: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + status: OptionalNullable[models.ApplicationStatus] = UNSET, + stage: Optional[Union[models.Stage, models.StageTypedDict]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicationsUpdateResponse: r"""Update Application Update Application :param id: ID of the record you are acting upon. - :param application: + :param applicant_id: + :param job_id: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param status: + :param stage: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -738,7 +879,15 @@ def update( id=id, service_id=service_id, raw=raw, - application=utils.get_pydantic_model(application, models.ApplicationInput), + application=models.ApplicationInput( + applicant_id=applicant_id, + job_id=job_id, + status=status, + stage=utils.get_pydantic_model(stage, Optional[models.Stage]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -752,6 +901,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -829,24 +979,36 @@ async def update_async( self, *, id: str, - application: Union[models.ApplicationInput, models.ApplicationInputTypedDict], + applicant_id: Nullable[str], + job_id: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + status: OptionalNullable[models.ApplicationStatus] = UNSET, + stage: Optional[Union[models.Stage, models.StageTypedDict]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicationsUpdateResponse: r"""Update Application Update Application :param id: ID of the record you are acting upon. - :param application: + :param applicant_id: + :param job_id: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param status: + :param stage: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -860,7 +1022,15 @@ async def update_async( id=id, service_id=service_id, raw=raw, - application=utils.get_pydantic_model(application, models.ApplicationInput), + application=models.ApplicationInput( + applicant_id=applicant_id, + job_id=job_id, + status=status, + stage=utils.get_pydantic_model(stage, Optional[models.Stage]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -874,6 +1044,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -956,6 +1127,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicationsDeleteResponse: r"""Delete Application @@ -967,6 +1139,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -993,6 +1166,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1072,6 +1246,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsApplicationsDeleteResponse: r"""Delete Application @@ -1083,6 +1258,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1109,6 +1285,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsApplicationsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/attachments.py b/src/apideck_unify/attachments.py index a7b63354..838cc987 100644 --- a/src/apideck_unify/attachments.py +++ b/src/apideck_unify/attachments.py @@ -3,10 +3,11 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env from enum import Enum -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional class DownloadAcceptEnum(str, Enum): @@ -18,22 +19,33 @@ class Attachments(BaseSDK): def list( self, *, - request: Union[ - models.AccountingAttachmentsAllRequest, - models.AccountingAttachmentsAllRequestTypedDict, - ], + reference_type: models.AttachmentReferenceType, + reference_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingAttachmentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingAttachmentsAllResponse]: r"""List Attachments List Attachments - :param request: The request object to send. + :param reference_type: The reference type of the document. + :param reference_id: The reference id of the object to retrieve. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -43,9 +55,15 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingAttachmentsAllRequest) - request = cast(models.AccountingAttachmentsAllRequest, request) + request = models.AccountingAttachmentsAllRequest( + reference_type=reference_type, + reference_id=reference_id, + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + ) req = self.build_request( method="GET", @@ -58,6 +76,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingAttachmentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -91,9 +110,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingAttachmentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + reference_type=reference_type, + reference_id=reference_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetAttachmentsResponse) + return models.AccountingAttachmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetAttachmentsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -117,7 +160,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingAttachmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -131,22 +179,33 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingAttachmentsAllRequest, - models.AccountingAttachmentsAllRequestTypedDict, - ], + reference_type: models.AttachmentReferenceType, + reference_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingAttachmentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingAttachmentsAllResponse]: r"""List Attachments List Attachments - :param request: The request object to send. + :param reference_type: The reference type of the document. + :param reference_id: The reference id of the object to retrieve. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -156,9 +215,15 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingAttachmentsAllRequest) - request = cast(models.AccountingAttachmentsAllRequest, request) + request = models.AccountingAttachmentsAllRequest( + reference_type=reference_type, + reference_id=reference_id, + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -171,6 +236,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingAttachmentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -204,9 +270,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingAttachmentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + reference_type=reference_type, + reference_id=reference_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetAttachmentsResponse) + return models.AccountingAttachmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetAttachmentsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -230,7 +320,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingAttachmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -244,22 +339,31 @@ async def list_async( def get( self, *, - request: Union[ - models.AccountingAttachmentsOneRequest, - models.AccountingAttachmentsOneRequestTypedDict, - ], + reference_type: models.AttachmentReferenceType, + reference_id: str, + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingAttachmentsOneResponse: r"""Get Attachment Get Attachment - :param request: The request object to send. + :param reference_type: The reference type of the document. + :param reference_id: The reference id of the object to retrieve. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -269,9 +373,14 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingAttachmentsOneRequest) - request = cast(models.AccountingAttachmentsOneRequest, request) + request = models.AccountingAttachmentsOneRequest( + reference_type=reference_type, + reference_id=reference_id, + id=id, + service_id=service_id, + raw=raw, + fields=fields, + ) req = self.build_request( method="GET", @@ -284,6 +393,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingAttachmentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,22 +467,31 @@ def get( async def get_async( self, *, - request: Union[ - models.AccountingAttachmentsOneRequest, - models.AccountingAttachmentsOneRequestTypedDict, - ], + reference_type: models.AttachmentReferenceType, + reference_id: str, + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingAttachmentsOneResponse: r"""Get Attachment Get Attachment - :param request: The request object to send. + :param reference_type: The reference type of the document. + :param reference_id: The reference id of the object to retrieve. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -382,9 +501,14 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingAttachmentsOneRequest) - request = cast(models.AccountingAttachmentsOneRequest, request) + request = models.AccountingAttachmentsOneRequest( + reference_type=reference_type, + reference_id=reference_id, + id=id, + service_id=service_id, + raw=raw, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -397,6 +521,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingAttachmentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -470,22 +595,29 @@ async def get_async( def delete( self, *, - request: Union[ - models.AccountingAttachmentsDeleteRequest, - models.AccountingAttachmentsDeleteRequestTypedDict, - ], + reference_type: models.AttachmentReferenceType, + reference_id: str, + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingAttachmentsDeleteResponse: r"""Delete Attachment Delete Attachment - :param request: The request object to send. + :param reference_type: The reference type of the document. + :param reference_id: The reference id of the object to retrieve. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -495,11 +627,13 @@ def delete( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingAttachmentsDeleteRequest - ) - request = cast(models.AccountingAttachmentsDeleteRequest, request) + request = models.AccountingAttachmentsDeleteRequest( + reference_type=reference_type, + reference_id=reference_id, + id=id, + service_id=service_id, + raw=raw, + ) req = self.build_request( method="DELETE", @@ -512,6 +646,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingAttachmentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -585,22 +720,29 @@ def delete( async def delete_async( self, *, - request: Union[ - models.AccountingAttachmentsDeleteRequest, - models.AccountingAttachmentsDeleteRequestTypedDict, - ], + reference_type: models.AttachmentReferenceType, + reference_id: str, + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingAttachmentsDeleteResponse: r"""Delete Attachment Delete Attachment - :param request: The request object to send. + :param reference_type: The reference type of the document. + :param reference_id: The reference id of the object to retrieve. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -610,11 +752,13 @@ async def delete_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingAttachmentsDeleteRequest - ) - request = cast(models.AccountingAttachmentsDeleteRequest, request) + request = models.AccountingAttachmentsDeleteRequest( + reference_type=reference_type, + reference_id=reference_id, + id=id, + service_id=service_id, + raw=raw, + ) req = self.build_request_async( method="DELETE", @@ -627,6 +771,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingAttachmentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -700,24 +845,31 @@ async def delete_async( def download( self, *, - request: Union[ - models.AccountingAttachmentsDownloadRequest, - models.AccountingAttachmentsDownloadRequestTypedDict, - ], + reference_type: models.AttachmentReferenceType, + reference_id: str, + id: str, + service_id: Optional[str] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, accept_header_override: Optional[DownloadAcceptEnum] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingAttachmentsDownloadResponse: r"""Download Attachment Download Attachment - :param request: The request object to send. + :param reference_type: The reference type of the document. + :param reference_id: The reference id of the object to retrieve. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -727,11 +879,13 @@ def download( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingAttachmentsDownloadRequest - ) - request = cast(models.AccountingAttachmentsDownloadRequest, request) + request = models.AccountingAttachmentsDownloadRequest( + reference_type=reference_type, + reference_id=reference_id, + id=id, + service_id=service_id, + fields=fields, + ) req = self.build_request( method="GET", @@ -746,6 +900,7 @@ def download( accept_header_value=accept_header_override.value if accept_header_override is not None else "application/json;q=1, */*;q=0", + http_headers=http_headers, _globals=models.AccountingAttachmentsDownloadGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -828,24 +983,31 @@ def download( async def download_async( self, *, - request: Union[ - models.AccountingAttachmentsDownloadRequest, - models.AccountingAttachmentsDownloadRequestTypedDict, - ], + reference_type: models.AttachmentReferenceType, + reference_id: str, + id: str, + service_id: Optional[str] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, accept_header_override: Optional[DownloadAcceptEnum] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingAttachmentsDownloadResponse: r"""Download Attachment Download Attachment - :param request: The request object to send. + :param reference_type: The reference type of the document. + :param reference_id: The reference id of the object to retrieve. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -855,11 +1017,13 @@ async def download_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingAttachmentsDownloadRequest - ) - request = cast(models.AccountingAttachmentsDownloadRequest, request) + request = models.AccountingAttachmentsDownloadRequest( + reference_type=reference_type, + reference_id=reference_id, + id=id, + service_id=service_id, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -874,6 +1038,7 @@ async def download_async( accept_header_value=accept_header_override.value if accept_header_override is not None else "application/json;q=1, */*;q=0", + http_headers=http_headers, _globals=models.AccountingAttachmentsDownloadGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/balancesheet_sdk.py b/src/apideck_unify/balancesheet_sdk.py index 995d3bb6..9e35ee1b 100644 --- a/src/apideck_unify/balancesheet_sdk.py +++ b/src/apideck_unify/balancesheet_sdk.py @@ -5,7 +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 typing import Any, Dict, Optional, Union +from typing import Any, Dict, Mapping, Optional, Union class BalanceSheetSDK(BaseSDK): @@ -21,6 +21,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBalanceSheetOneResponse: r"""Get BalanceSheet @@ -33,6 +34,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -62,6 +64,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBalanceSheetOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -144,6 +147,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBalanceSheetOneResponse: r"""Get BalanceSheet @@ -156,6 +160,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -185,6 +190,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBalanceSheetOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/basesdk.py b/src/apideck_unify/basesdk.py index 21b2b41b..97b8c4d6 100644 --- a/src/apideck_unify/basesdk.py +++ b/src/apideck_unify/basesdk.py @@ -9,7 +9,7 @@ ) from apideck_unify.utils import RetryConfig, SerializedRequestBody, get_body_content import httpx -from typing import Callable, List, Optional, Tuple +from typing import Callable, List, Mapping, Optional, Tuple from urllib.parse import parse_qs, urlparse @@ -49,6 +49,7 @@ def build_request_async( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: client = self.sdk_configuration.async_client return self.build_request_with_client( @@ -68,6 +69,7 @@ def build_request_async( timeout_ms, get_serialized_body, url_override, + http_headers, ) def build_request( @@ -89,6 +91,7 @@ def build_request( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: client = self.sdk_configuration.client return self.build_request_with_client( @@ -108,6 +111,7 @@ def build_request( timeout_ms, get_serialized_body, url_override, + http_headers, ) def build_request_with_client( @@ -130,6 +134,7 @@ def build_request_with_client( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: query_params = {} @@ -185,6 +190,10 @@ def build_request_with_client( ): headers["content-type"] = serialized_request_body.media_type + if http_headers is not None: + for header, value in http_headers.items(): + headers[header] = value + timeout = timeout_ms / 1000 if timeout_ms is not None else None return client.build_request( diff --git a/src/apideck_unify/billpayments.py b/src/apideck_unify/billpayments.py index 9c9929c7..3d98b22d 100644 --- a/src/apideck_unify/billpayments.py +++ b/src/apideck_unify/billpayments.py @@ -3,31 +3,48 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class BillPayments(BaseSDK): def list( self, *, - request: Union[ - models.AccountingBillPaymentsAllRequest, - models.AccountingBillPaymentsAllRequestTypedDict, - ] = models.AccountingBillPaymentsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.PaymentsFilter, models.PaymentsFilterTypedDict] + ] = None, + sort: Optional[Union[models.PaymentsSort, models.PaymentsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingBillPaymentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingBillPaymentsAllResponse]: r"""List Bill Payments List Bill Payments - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +54,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingBillPaymentsAllRequest) - request = cast(models.AccountingBillPaymentsAllRequest, request) + request = models.AccountingBillPaymentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.PaymentsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.PaymentsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +76,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +110,34 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingBillPaymentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetBillPaymentsResponse) + return models.AccountingBillPaymentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetBillPaymentsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +161,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingBillPaymentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +180,37 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingBillPaymentsAllRequest, - models.AccountingBillPaymentsAllRequestTypedDict, - ] = models.AccountingBillPaymentsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.PaymentsFilter, models.PaymentsFilterTypedDict] + ] = None, + sort: Optional[Union[models.PaymentsSort, models.PaymentsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingBillPaymentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingBillPaymentsAllResponse]: r"""List Bill Payments List Bill Payments - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +220,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingBillPaymentsAllRequest) - request = cast(models.AccountingBillPaymentsAllRequest, request) + request = models.AccountingBillPaymentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.PaymentsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.PaymentsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +242,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +276,34 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingBillPaymentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetBillPaymentsResponse) + return models.AccountingBillPaymentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetBillPaymentsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +327,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingBillPaymentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +346,88 @@ async def list_async( def create( self, *, - bill_payment: Union[models.BillPaymentInput, models.BillPaymentInputTypedDict], + total_amount: Nullable[float], + transaction_date: Nullable[datetime], raw: Optional[bool] = False, service_id: Optional[str] = None, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + reference: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + reconciled: OptionalNullable[bool] = UNSET, + status: Optional[models.PaymentStatus] = None, + type_: Optional[models.BillPaymentType] = None, + allocations: Optional[ + Union[ + List[models.BillPaymentAllocations], + List[models.BillPaymentAllocationsTypedDict], + ] + ] = None, + note: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + display_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillPaymentsAddResponse: r"""Create Bill Payment Create Bill Payment - :param bill_payment: + :param total_amount: The total amount of the transaction + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param reference: Optional transaction reference message ie: Debit remittance detail. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param payment_method_reference: Optional reference message returned by payment method on processing + :param payment_method_id: A unique identifier for an object. + :param account: + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param reconciled: Indicates if the transaction has been reconciled. + :param status: Status of payment + :param type: Type of payment + :param allocations: + :param note: Note associated with the transaction + :param number: Number associated with the transaction + :param tracking_categories: A list of linked tracking categories. + :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. + :param display_id: Id to be displayed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,8 +440,42 @@ def create( request = models.AccountingBillPaymentsAddRequest( raw=raw, service_id=service_id, - bill_payment=utils.get_pydantic_model( - bill_payment, models.BillPaymentInput + bill_payment=models.BillPaymentInput( + currency=currency, + currency_rate=currency_rate, + total_amount=total_amount, + reference=reference, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + transaction_date=transaction_date, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + reconciled=reconciled, + status=status, + type=type_, + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.BillPaymentAllocations]] + ), + note=note, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + display_id=display_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -283,6 +490,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -359,23 +567,88 @@ def create( async def create_async( self, *, - bill_payment: Union[models.BillPaymentInput, models.BillPaymentInputTypedDict], + total_amount: Nullable[float], + transaction_date: Nullable[datetime], raw: Optional[bool] = False, service_id: Optional[str] = None, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + reference: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + reconciled: OptionalNullable[bool] = UNSET, + status: Optional[models.PaymentStatus] = None, + type_: Optional[models.BillPaymentType] = None, + allocations: Optional[ + Union[ + List[models.BillPaymentAllocations], + List[models.BillPaymentAllocationsTypedDict], + ] + ] = None, + note: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + display_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillPaymentsAddResponse: r"""Create Bill Payment Create Bill Payment - :param bill_payment: + :param total_amount: The total amount of the transaction + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param reference: Optional transaction reference message ie: Debit remittance detail. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param payment_method_reference: Optional reference message returned by payment method on processing + :param payment_method_id: A unique identifier for an object. + :param account: + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param reconciled: Indicates if the transaction has been reconciled. + :param status: Status of payment + :param type: Type of payment + :param allocations: + :param note: Note associated with the transaction + :param number: Number associated with the transaction + :param tracking_categories: A list of linked tracking categories. + :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. + :param display_id: Id to be displayed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -388,8 +661,42 @@ async def create_async( request = models.AccountingBillPaymentsAddRequest( raw=raw, service_id=service_id, - bill_payment=utils.get_pydantic_model( - bill_payment, models.BillPaymentInput + bill_payment=models.BillPaymentInput( + currency=currency, + currency_rate=currency_rate, + total_amount=total_amount, + reference=reference, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + transaction_date=transaction_date, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + reconciled=reconciled, + status=status, + type=type_, + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.BillPaymentAllocations]] + ), + note=note, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + display_id=display_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -404,6 +711,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -487,6 +795,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillPaymentsOneResponse: r"""Get Bill Payment @@ -499,6 +808,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -526,6 +836,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -606,6 +917,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillPaymentsOneResponse: r"""Get Bill Payment @@ -618,6 +930,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -645,6 +958,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -719,24 +1033,89 @@ def update( self, *, id: str, - bill_payment: Union[models.BillPaymentInput, models.BillPaymentInputTypedDict], + total_amount: Nullable[float], + transaction_date: Nullable[datetime], service_id: Optional[str] = None, raw: Optional[bool] = False, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + reference: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + reconciled: OptionalNullable[bool] = UNSET, + status: Optional[models.PaymentStatus] = None, + type_: Optional[models.BillPaymentType] = None, + allocations: Optional[ + Union[ + List[models.BillPaymentAllocations], + List[models.BillPaymentAllocationsTypedDict], + ] + ] = None, + note: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + display_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillPaymentsUpdateResponse: r"""Update Bill Payment Update Bill Payment :param id: ID of the record you are acting upon. - :param bill_payment: + :param total_amount: The total amount of the transaction + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param reference: Optional transaction reference message ie: Debit remittance detail. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param payment_method_reference: Optional reference message returned by payment method on processing + :param payment_method_id: A unique identifier for an object. + :param account: + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param reconciled: Indicates if the transaction has been reconciled. + :param status: Status of payment + :param type: Type of payment + :param allocations: + :param note: Note associated with the transaction + :param number: Number associated with the transaction + :param tracking_categories: A list of linked tracking categories. + :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. + :param display_id: Id to be displayed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -750,8 +1129,42 @@ def update( id=id, service_id=service_id, raw=raw, - bill_payment=utils.get_pydantic_model( - bill_payment, models.BillPaymentInput + bill_payment=models.BillPaymentInput( + currency=currency, + currency_rate=currency_rate, + total_amount=total_amount, + reference=reference, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + transaction_date=transaction_date, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + reconciled=reconciled, + status=status, + type=type_, + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.BillPaymentAllocations]] + ), + note=note, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + display_id=display_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -766,6 +1179,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -843,24 +1257,89 @@ async def update_async( self, *, id: str, - bill_payment: Union[models.BillPaymentInput, models.BillPaymentInputTypedDict], + total_amount: Nullable[float], + transaction_date: Nullable[datetime], service_id: Optional[str] = None, raw: Optional[bool] = False, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + reference: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + reconciled: OptionalNullable[bool] = UNSET, + status: Optional[models.PaymentStatus] = None, + type_: Optional[models.BillPaymentType] = None, + allocations: Optional[ + Union[ + List[models.BillPaymentAllocations], + List[models.BillPaymentAllocationsTypedDict], + ] + ] = None, + note: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + display_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillPaymentsUpdateResponse: r"""Update Bill Payment Update Bill Payment :param id: ID of the record you are acting upon. - :param bill_payment: + :param total_amount: The total amount of the transaction + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param reference: Optional transaction reference message ie: Debit remittance detail. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param payment_method_reference: Optional reference message returned by payment method on processing + :param payment_method_id: A unique identifier for an object. + :param account: + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param reconciled: Indicates if the transaction has been reconciled. + :param status: Status of payment + :param type: Type of payment + :param allocations: + :param note: Note associated with the transaction + :param number: Number associated with the transaction + :param tracking_categories: A list of linked tracking categories. + :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. + :param display_id: Id to be displayed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -874,8 +1353,42 @@ async def update_async( id=id, service_id=service_id, raw=raw, - bill_payment=utils.get_pydantic_model( - bill_payment, models.BillPaymentInput + bill_payment=models.BillPaymentInput( + currency=currency, + currency_rate=currency_rate, + total_amount=total_amount, + reference=reference, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + transaction_date=transaction_date, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + reconciled=reconciled, + status=status, + type=type_, + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.BillPaymentAllocations]] + ), + note=note, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + display_id=display_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -890,6 +1403,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -972,6 +1486,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillPaymentsDeleteResponse: r"""Delete Bill Payment @@ -983,6 +1498,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1009,6 +1525,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1088,6 +1605,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillPaymentsDeleteResponse: r"""Delete Bill Payment @@ -1099,6 +1617,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1125,6 +1644,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillPaymentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/bills.py b/src/apideck_unify/bills.py index 537f472c..0047c19d 100644 --- a/src/apideck_unify/bills.py +++ b/src/apideck_unify/bills.py @@ -3,30 +3,48 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Bills(BaseSDK): def list( self, *, - request: Union[ - models.AccountingBillsAllRequest, models.AccountingBillsAllRequestTypedDict - ] = models.AccountingBillsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.BillsFilter, models.BillsFilterTypedDict] + ] = None, + sort: Optional[Union[models.BillsSort, models.BillsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingBillsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingBillsAllResponse]: r"""List Bills List Bills - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +54,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingBillsAllRequest) - request = cast(models.AccountingBillsAllRequest, request) + request = models.AccountingBillsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.BillsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.BillsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +76,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +110,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingBillsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetBillsResponse) + return models.AccountingBillsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetBillsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +159,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingBillsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +178,37 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingBillsAllRequest, models.AccountingBillsAllRequestTypedDict - ] = models.AccountingBillsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.BillsFilter, models.BillsFilterTypedDict] + ] = None, + sort: Optional[Union[models.BillsSort, models.BillsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingBillsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingBillsAllResponse]: r"""List Bills List Bills - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +218,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingBillsAllRequest) - request = cast(models.AccountingBillsAllRequest, request) + request = models.AccountingBillsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.BillsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.BillsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +240,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +274,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingBillsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetBillsResponse) + return models.AccountingBillsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetBillsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +323,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingBillsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +342,107 @@ async def list_async( def create( self, *, - bill: Union[models.BillInput, models.BillInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + bill_number: OptionalNullable[str] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + bill_date: Optional[date] = None, + due_date: Optional[date] = None, + paid_date: OptionalNullable[date] = UNSET, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + line_items: Optional[ + Union[ + List[models.BillLineItemInput], List[models.BillLineItemInputTypedDict] + ] + ] = None, + terms: OptionalNullable[str] = UNSET, + balance: OptionalNullable[float] = UNSET, + deposit: OptionalNullable[float] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + notes: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.BillStatus] = UNSET, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + accounting_by_row: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + discount_percentage: OptionalNullable[float] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + accounting_period: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillsAddResponse: r"""Create Bill Create Bill - :param bill: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param bill_number: Reference to supplier bill number + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param bill_date: Date bill was issued - YYYY-MM-DD. + :param due_date: The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. + :param paid_date: The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. + :param po_number: 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. + :param reference: Optional bill reference. + :param line_items: + :param terms: Terms of payment. + :param balance: Balance of bill due. + :param deposit: Amount of deposit made to this bill. + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this bill. + :param total: Total amount of bill, including tax. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param notes: + :param status: Invoice status + :param ledger_account: + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :param language: language code according to ISO 639-1. For the United States - EN + :param accounting_by_row: 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. + :param bank_account: + :param discount_percentage: Discount percentage applied to this transaction. + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param accounting_period: Accounting period :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +455,53 @@ def create( request = models.AccountingBillsAddRequest( raw=raw, service_id=service_id, - bill=utils.get_pydantic_model(bill, models.BillInput), + bill=models.BillInput( + bill_number=bill_number, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + bill_date=bill_date, + due_date=due_date, + paid_date=paid_date, + po_number=po_number, + reference=reference, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.BillLineItemInput]] + ), + terms=terms, + balance=balance, + deposit=deposit, + sub_total=sub_total, + total_tax=total_tax, + total=total, + tax_code=tax_code, + notes=notes, + status=status, + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + payment_method=payment_method, + channel=channel, + language=language, + accounting_by_row=accounting_by_row, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + discount_percentage=discount_percentage, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + accounting_period=accounting_period, + ), ) req = self.build_request( @@ -279,6 +515,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +592,107 @@ def create( async def create_async( self, *, - bill: Union[models.BillInput, models.BillInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + bill_number: OptionalNullable[str] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + bill_date: Optional[date] = None, + due_date: Optional[date] = None, + paid_date: OptionalNullable[date] = UNSET, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + line_items: Optional[ + Union[ + List[models.BillLineItemInput], List[models.BillLineItemInputTypedDict] + ] + ] = None, + terms: OptionalNullable[str] = UNSET, + balance: OptionalNullable[float] = UNSET, + deposit: OptionalNullable[float] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + notes: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.BillStatus] = UNSET, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + accounting_by_row: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + discount_percentage: OptionalNullable[float] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + accounting_period: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillsAddResponse: r"""Create Bill Create Bill - :param bill: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param bill_number: Reference to supplier bill number + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param bill_date: Date bill was issued - YYYY-MM-DD. + :param due_date: The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. + :param paid_date: The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. + :param po_number: 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. + :param reference: Optional bill reference. + :param line_items: + :param terms: Terms of payment. + :param balance: Balance of bill due. + :param deposit: Amount of deposit made to this bill. + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this bill. + :param total: Total amount of bill, including tax. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param notes: + :param status: Invoice status + :param ledger_account: + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :param language: language code according to ISO 639-1. For the United States - EN + :param accounting_by_row: 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. + :param bank_account: + :param discount_percentage: Discount percentage applied to this transaction. + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param accounting_period: Accounting period :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +705,53 @@ async def create_async( request = models.AccountingBillsAddRequest( raw=raw, service_id=service_id, - bill=utils.get_pydantic_model(bill, models.BillInput), + bill=models.BillInput( + bill_number=bill_number, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + bill_date=bill_date, + due_date=due_date, + paid_date=paid_date, + po_number=po_number, + reference=reference, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.BillLineItemInput]] + ), + terms=terms, + balance=balance, + deposit=deposit, + sub_total=sub_total, + total_tax=total_tax, + total=total, + tax_code=tax_code, + notes=notes, + status=status, + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + payment_method=payment_method, + channel=channel, + language=language, + accounting_by_row=accounting_by_row, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + discount_percentage=discount_percentage, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + accounting_period=accounting_period, + ), ) req = self.build_request_async( @@ -398,6 +765,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +849,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillsOneResponse: r"""Get Bill @@ -493,6 +862,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +890,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +971,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillsOneResponse: r"""Get Bill @@ -612,6 +984,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +1012,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +1087,108 @@ def update( self, *, id: str, - bill: Union[models.BillInput, models.BillInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + bill_number: OptionalNullable[str] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + bill_date: Optional[date] = None, + due_date: Optional[date] = None, + paid_date: OptionalNullable[date] = UNSET, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + line_items: Optional[ + Union[ + List[models.BillLineItemInput], List[models.BillLineItemInputTypedDict] + ] + ] = None, + terms: OptionalNullable[str] = UNSET, + balance: OptionalNullable[float] = UNSET, + deposit: OptionalNullable[float] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + notes: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.BillStatus] = UNSET, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + accounting_by_row: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + discount_percentage: OptionalNullable[float] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + accounting_period: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillsUpdateResponse: r"""Update Bill Update Bill :param id: ID of the record you are acting upon. - :param bill: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param bill_number: Reference to supplier bill number + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param bill_date: Date bill was issued - YYYY-MM-DD. + :param due_date: The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. + :param paid_date: The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. + :param po_number: 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. + :param reference: Optional bill reference. + :param line_items: + :param terms: Terms of payment. + :param balance: Balance of bill due. + :param deposit: Amount of deposit made to this bill. + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this bill. + :param total: Total amount of bill, including tax. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param notes: + :param status: Invoice status + :param ledger_account: + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :param language: language code according to ISO 639-1. For the United States - EN + :param accounting_by_row: 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. + :param bank_account: + :param discount_percentage: Discount percentage applied to this transaction. + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param accounting_period: Accounting period :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +1202,53 @@ def update( id=id, service_id=service_id, raw=raw, - bill=utils.get_pydantic_model(bill, models.BillInput), + bill=models.BillInput( + bill_number=bill_number, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + bill_date=bill_date, + due_date=due_date, + paid_date=paid_date, + po_number=po_number, + reference=reference, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.BillLineItemInput]] + ), + terms=terms, + balance=balance, + deposit=deposit, + sub_total=sub_total, + total_tax=total_tax, + total=total, + tax_code=tax_code, + notes=notes, + status=status, + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + payment_method=payment_method, + channel=channel, + language=language, + accounting_by_row=accounting_by_row, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + discount_percentage=discount_percentage, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + accounting_period=accounting_period, + ), ) req = self.build_request( @@ -758,6 +1262,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +1340,108 @@ async def update_async( self, *, id: str, - bill: Union[models.BillInput, models.BillInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + bill_number: OptionalNullable[str] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + bill_date: Optional[date] = None, + due_date: Optional[date] = None, + paid_date: OptionalNullable[date] = UNSET, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + line_items: Optional[ + Union[ + List[models.BillLineItemInput], List[models.BillLineItemInputTypedDict] + ] + ] = None, + terms: OptionalNullable[str] = UNSET, + balance: OptionalNullable[float] = UNSET, + deposit: OptionalNullable[float] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + notes: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.BillStatus] = UNSET, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + accounting_by_row: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + discount_percentage: OptionalNullable[float] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + accounting_period: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillsUpdateResponse: r"""Update Bill Update Bill :param id: ID of the record you are acting upon. - :param bill: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param bill_number: Reference to supplier bill number + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param bill_date: Date bill was issued - YYYY-MM-DD. + :param due_date: The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. + :param paid_date: The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. + :param po_number: 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. + :param reference: Optional bill reference. + :param line_items: + :param terms: Terms of payment. + :param balance: Balance of bill due. + :param deposit: Amount of deposit made to this bill. + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this bill. + :param total: Total amount of bill, including tax. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param notes: + :param status: Invoice status + :param ledger_account: + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :param language: language code according to ISO 639-1. For the United States - EN + :param accounting_by_row: 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. + :param bank_account: + :param discount_percentage: Discount percentage applied to this transaction. + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param accounting_period: Accounting period :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1455,53 @@ async def update_async( id=id, service_id=service_id, raw=raw, - bill=utils.get_pydantic_model(bill, models.BillInput), + bill=models.BillInput( + bill_number=bill_number, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + bill_date=bill_date, + due_date=due_date, + paid_date=paid_date, + po_number=po_number, + reference=reference, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.BillLineItemInput]] + ), + terms=terms, + balance=balance, + deposit=deposit, + sub_total=sub_total, + total_tax=total_tax, + total=total, + tax_code=tax_code, + notes=notes, + status=status, + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + payment_method=payment_method, + channel=channel, + language=language, + accounting_by_row=accounting_by_row, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + discount_percentage=discount_percentage, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + accounting_period=accounting_period, + ), ) req = self.build_request_async( @@ -880,6 +1515,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1598,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillsDeleteResponse: r"""Delete Bill @@ -973,6 +1610,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1637,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1717,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingBillsDeleteResponse: r"""Delete Bill @@ -1089,6 +1729,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1756,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingBillsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/collections.py b/src/apideck_unify/collections.py index 969afcba..9bc6d568 100644 --- a/src/apideck_unify/collections.py +++ b/src/apideck_unify/collections.py @@ -3,31 +3,45 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional, Union class Collections(BaseSDK): def list( self, *, - request: Union[ - models.IssueTrackingCollectionsAllRequest, - models.IssueTrackingCollectionsAllRequestTypedDict, - ] = models.IssueTrackingCollectionsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + sort: Optional[ + Union[models.CollectionsSort, models.CollectionsSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionsAllResponse]: r"""List Collections List Collections - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +51,15 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionsAllRequest - ) - request = cast(models.IssueTrackingCollectionsAllRequest, request) + request = models.IssueTrackingCollectionsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + sort=utils.get_pydantic_model(sort, Optional[models.CollectionsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -54,6 +72,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,9 +106,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.IssueTrackingCollectionsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCollectionsResponse) + return models.IssueTrackingCollectionsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetCollectionsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -113,7 +156,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +175,35 @@ def list( async def list_async( self, *, - request: Union[ - models.IssueTrackingCollectionsAllRequest, - models.IssueTrackingCollectionsAllRequestTypedDict, - ] = models.IssueTrackingCollectionsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + sort: Optional[ + Union[models.CollectionsSort, models.CollectionsSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionsAllResponse]: r"""List Collections List Collections - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,11 +213,15 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionsAllRequest - ) - request = cast(models.IssueTrackingCollectionsAllRequest, request) + request = models.IssueTrackingCollectionsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + sort=utils.get_pydantic_model(sort, Optional[models.CollectionsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -169,6 +234,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -202,9 +268,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.IssueTrackingCollectionsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCollectionsResponse) + return models.IssueTrackingCollectionsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetCollectionsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -228,7 +318,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -249,6 +344,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionsOneResponse: r"""Get Collection @@ -261,6 +357,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -288,6 +385,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -368,6 +466,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionsOneResponse: r"""Get Collection @@ -380,6 +479,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -407,6 +507,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/collectiontags.py b/src/apideck_unify/collectiontags.py index b28863e1..8fe1493c 100644 --- a/src/apideck_unify/collectiontags.py +++ b/src/apideck_unify/collectiontags.py @@ -3,31 +3,43 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional class CollectionTags(BaseSDK): def list( self, *, - request: Union[ - models.IssueTrackingCollectionTagsAllRequest, - models.IssueTrackingCollectionTagsAllRequestTypedDict, - ], + collection_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionTagsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionTagsAllResponse]: r"""List Tags List Tags - :param request: The request object to send. + :param collection_id: The collection ID + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +49,15 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTagsAllRequest - ) - request = cast(models.IssueTrackingCollectionTagsAllRequest, request) + request = models.IssueTrackingCollectionTagsAllRequest( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -54,6 +70,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTagsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,9 +104,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.IssueTrackingCollectionTagsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCollectionTagsResponse) + return models.IssueTrackingCollectionTagsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetCollectionTagsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -113,7 +154,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionTagsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +173,33 @@ def list( async def list_async( self, *, - request: Union[ - models.IssueTrackingCollectionTagsAllRequest, - models.IssueTrackingCollectionTagsAllRequestTypedDict, - ], + collection_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionTagsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionTagsAllResponse]: r"""List Tags List Tags - :param request: The request object to send. + :param collection_id: The collection ID + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,11 +209,15 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTagsAllRequest - ) - request = cast(models.IssueTrackingCollectionTagsAllRequest, request) + request = models.IssueTrackingCollectionTagsAllRequest( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -169,6 +230,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTagsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -202,9 +264,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.IssueTrackingCollectionTagsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCollectionTagsResponse) + return models.IssueTrackingCollectionTagsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetCollectionTagsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -228,7 +314,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionTagsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) diff --git a/src/apideck_unify/collectionticketcomments.py b/src/apideck_unify/collectionticketcomments.py index c99fa29a..53218026 100644 --- a/src/apideck_unify/collectionticketcomments.py +++ b/src/apideck_unify/collectionticketcomments.py @@ -3,31 +3,47 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class CollectionTicketComments(BaseSDK): def list( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsAllRequest, - models.IssueTrackingCollectionTicketCommentsAllRequestTypedDict, - ], + collection_id: str, + ticket_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + sort: Optional[Union[models.CommentsSort, models.CommentsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionTicketCommentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionTicketCommentsAllResponse]: r"""List Comments List Comments - :param request: The request object to send. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +53,17 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsAllRequest - ) - request = cast(models.IssueTrackingCollectionTicketCommentsAllRequest, request) + request = models.IssueTrackingCollectionTicketCommentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + collection_id=collection_id, + ticket_id=ticket_id, + sort=utils.get_pydantic_model(sort, Optional[models.CommentsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -54,6 +76,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,9 +110,35 @@ def list( retry_config=retry_config, ) + def next_func() -> ( + Optional[models.IssueTrackingCollectionTicketCommentsAllResponse] + ): + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + collection_id=collection_id, + ticket_id=ticket_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCommentsResponse) + return models.IssueTrackingCollectionTicketCommentsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetCommentsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -113,7 +162,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionTicketCommentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +181,37 @@ def list( async def list_async( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsAllRequest, - models.IssueTrackingCollectionTicketCommentsAllRequestTypedDict, - ], + collection_id: str, + ticket_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + sort: Optional[Union[models.CommentsSort, models.CommentsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionTicketCommentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionTicketCommentsAllResponse]: r"""List Comments List Comments - :param request: The request object to send. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,11 +221,17 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsAllRequest - ) - request = cast(models.IssueTrackingCollectionTicketCommentsAllRequest, request) + request = models.IssueTrackingCollectionTicketCommentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + collection_id=collection_id, + ticket_id=ticket_id, + sort=utils.get_pydantic_model(sort, Optional[models.CommentsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -169,6 +244,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -202,9 +278,35 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> ( + Optional[models.IssueTrackingCollectionTicketCommentsAllResponse] + ): + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + collection_id=collection_id, + ticket_id=ticket_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCommentsResponse) + return models.IssueTrackingCollectionTicketCommentsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetCommentsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -228,7 +330,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionTicketCommentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -242,22 +349,33 @@ async def list_async( def create( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsAddRequest, - models.IssueTrackingCollectionTicketCommentsAddRequestTypedDict, - ], + collection_id: str, + ticket_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + body: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketCommentsAddResponse: r"""Create Comment Create Comment - :param request: The request object to send. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param body: Body of the comment + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,11 +385,18 @@ def create( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsAddRequest - ) - request = cast(models.IssueTrackingCollectionTicketCommentsAddRequest, request) + request = models.IssueTrackingCollectionTicketCommentsAddRequest( + raw=raw, + service_id=service_id, + collection_id=collection_id, + ticket_id=ticket_id, + collection_ticket_comment=models.CollectionTicketCommentInput( + body=body, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), + ) req = self.build_request( method="POST", @@ -284,6 +409,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -364,22 +490,33 @@ def create( async def create_async( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsAddRequest, - models.IssueTrackingCollectionTicketCommentsAddRequestTypedDict, - ], + collection_id: str, + ticket_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + body: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketCommentsAddResponse: r"""Create Comment Create Comment - :param request: The request object to send. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param body: Body of the comment + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -389,11 +526,18 @@ async def create_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsAddRequest - ) - request = cast(models.IssueTrackingCollectionTicketCommentsAddRequest, request) + request = models.IssueTrackingCollectionTicketCommentsAddRequest( + raw=raw, + service_id=service_id, + collection_id=collection_id, + ticket_id=ticket_id, + collection_ticket_comment=models.CollectionTicketCommentInput( + body=body, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), + ) req = self.build_request_async( method="POST", @@ -406,6 +550,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -486,22 +631,35 @@ async def create_async( def get( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsOneRequest, - models.IssueTrackingCollectionTicketCommentsOneRequestTypedDict, - ], + id: str, + collection_id: str, + ticket_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionTicketCommentsOneResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionTicketCommentsOneResponse]: r"""Get Comment Get Comment - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -511,11 +669,16 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsOneRequest - ) - request = cast(models.IssueTrackingCollectionTicketCommentsOneRequest, request) + request = models.IssueTrackingCollectionTicketCommentsOneRequest( + id=id, + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + collection_id=collection_id, + ticket_id=ticket_id, + fields=fields, + ) req = self.build_request( method="GET", @@ -528,6 +691,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -561,9 +725,34 @@ def get( retry_config=retry_config, ) + def next_func() -> ( + Optional[models.IssueTrackingCollectionTicketCommentsOneResponse] + ): + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.get( + id=id, + collection_id=collection_id, + ticket_id=ticket_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCommentResponse) + return models.IssueTrackingCollectionTicketCommentsOneResponse( + result=utils.unmarshal_json(http_res.text, models.GetCommentResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -587,7 +776,12 @@ def get( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionTicketCommentsOneResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -601,22 +795,35 @@ def get( async def get_async( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsOneRequest, - models.IssueTrackingCollectionTicketCommentsOneRequestTypedDict, - ], + id: str, + collection_id: str, + ticket_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionTicketCommentsOneResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionTicketCommentsOneResponse]: r"""Get Comment Get Comment - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -626,11 +833,16 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsOneRequest - ) - request = cast(models.IssueTrackingCollectionTicketCommentsOneRequest, request) + request = models.IssueTrackingCollectionTicketCommentsOneRequest( + id=id, + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + collection_id=collection_id, + ticket_id=ticket_id, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -643,6 +855,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -676,9 +889,34 @@ async def get_async( retry_config=retry_config, ) + def next_func() -> ( + Optional[models.IssueTrackingCollectionTicketCommentsOneResponse] + ): + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.get( + id=id, + collection_id=collection_id, + ticket_id=ticket_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCommentResponse) + return models.IssueTrackingCollectionTicketCommentsOneResponse( + result=utils.unmarshal_json(http_res.text, models.GetCommentResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -702,7 +940,12 @@ async def get_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionTicketCommentsOneResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -716,22 +959,35 @@ async def get_async( def update( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsUpdateRequest, - models.IssueTrackingCollectionTicketCommentsUpdateRequestTypedDict, - ], + id: str, + collection_id: str, + ticket_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + body: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketCommentsUpdateResponse: r"""Update Comment Update Comment - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param body: Body of the comment + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -741,12 +997,18 @@ def update( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsUpdateRequest - ) - request = cast( - models.IssueTrackingCollectionTicketCommentsUpdateRequest, request + request = models.IssueTrackingCollectionTicketCommentsUpdateRequest( + id=id, + service_id=service_id, + raw=raw, + collection_id=collection_id, + ticket_id=ticket_id, + collection_ticket_comment=models.CollectionTicketCommentInput( + body=body, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +1022,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -840,22 +1103,35 @@ def update( async def update_async( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsUpdateRequest, - models.IssueTrackingCollectionTicketCommentsUpdateRequestTypedDict, - ], + id: str, + collection_id: str, + ticket_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + body: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketCommentsUpdateResponse: r"""Update Comment Update Comment - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param body: Body of the comment + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -865,12 +1141,18 @@ async def update_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsUpdateRequest - ) - request = cast( - models.IssueTrackingCollectionTicketCommentsUpdateRequest, request + request = models.IssueTrackingCollectionTicketCommentsUpdateRequest( + id=id, + service_id=service_id, + raw=raw, + collection_id=collection_id, + ticket_id=ticket_id, + collection_ticket_comment=models.CollectionTicketCommentInput( + body=body, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -884,6 +1166,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,22 +1247,29 @@ async def update_async( def delete( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsDeleteRequest, - models.IssueTrackingCollectionTicketCommentsDeleteRequestTypedDict, - ], + id: str, + collection_id: str, + ticket_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketCommentsDeleteResponse: r"""Delete Comment Delete Comment - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -989,12 +1279,12 @@ def delete( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsDeleteRequest - ) - request = cast( - models.IssueTrackingCollectionTicketCommentsDeleteRequest, request + request = models.IssueTrackingCollectionTicketCommentsDeleteRequest( + id=id, + service_id=service_id, + raw=raw, + collection_id=collection_id, + ticket_id=ticket_id, ) req = self.build_request( @@ -1008,6 +1298,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1081,22 +1372,29 @@ def delete( async def delete_async( self, *, - request: Union[ - models.IssueTrackingCollectionTicketCommentsDeleteRequest, - models.IssueTrackingCollectionTicketCommentsDeleteRequestTypedDict, - ], + id: str, + collection_id: str, + ticket_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketCommentsDeleteResponse: r"""Delete Comment Delete Comment - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param collection_id: The collection ID + :param ticket_id: ID of the ticket you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1106,12 +1404,12 @@ async def delete_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketCommentsDeleteRequest - ) - request = cast( - models.IssueTrackingCollectionTicketCommentsDeleteRequest, request + request = models.IssueTrackingCollectionTicketCommentsDeleteRequest( + id=id, + service_id=service_id, + raw=raw, + collection_id=collection_id, + ticket_id=ticket_id, ) req = self.build_request_async( @@ -1125,6 +1423,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketCommentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/collectiontickets.py b/src/apideck_unify/collectiontickets.py index 8b1d9295..f454c3bd 100644 --- a/src/apideck_unify/collectiontickets.py +++ b/src/apideck_unify/collectiontickets.py @@ -3,31 +3,50 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class CollectionTickets(BaseSDK): def list( self, *, - request: Union[ - models.IssueTrackingCollectionTicketsAllRequest, - models.IssueTrackingCollectionTicketsAllRequestTypedDict, - ], + collection_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + sort: Optional[Union[models.TicketsSort, models.TicketsSortTypedDict]] = None, + filter_: Optional[ + Union[models.IssuesFilter, models.IssuesFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionTicketsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionTicketsAllResponse]: r"""List Tickets List Tickets - :param request: The request object to send. + :param collection_id: The collection ID + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param sort: Apply sorting + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +56,17 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketsAllRequest - ) - request = cast(models.IssueTrackingCollectionTicketsAllRequest, request) + request = models.IssueTrackingCollectionTicketsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + collection_id=collection_id, + sort=utils.get_pydantic_model(sort, Optional[models.TicketsSort]), + filter_=utils.get_pydantic_model(filter_, Optional[models.IssuesFilter]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -54,6 +79,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,9 +113,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.IssueTrackingCollectionTicketsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + sort=sort, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetTicketsResponse) + return models.IssueTrackingCollectionTicketsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetTicketsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -113,7 +163,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionTicketsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +182,39 @@ def list( async def list_async( self, *, - request: Union[ - models.IssueTrackingCollectionTicketsAllRequest, - models.IssueTrackingCollectionTicketsAllRequestTypedDict, - ], + collection_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + sort: Optional[Union[models.TicketsSort, models.TicketsSortTypedDict]] = None, + filter_: Optional[ + Union[models.IssuesFilter, models.IssuesFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionTicketsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionTicketsAllResponse]: r"""List Tickets List Tickets - :param request: The request object to send. + :param collection_id: The collection ID + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param sort: Apply sorting + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,11 +224,17 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketsAllRequest - ) - request = cast(models.IssueTrackingCollectionTicketsAllRequest, request) + request = models.IssueTrackingCollectionTicketsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + collection_id=collection_id, + sort=utils.get_pydantic_model(sort, Optional[models.TicketsSort]), + filter_=utils.get_pydantic_model(filter_, Optional[models.IssuesFilter]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -169,6 +247,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -202,9 +281,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.IssueTrackingCollectionTicketsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + sort=sort, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetTicketsResponse) + return models.IssueTrackingCollectionTicketsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetTicketsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -228,7 +331,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionTicketsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -243,24 +351,53 @@ def create( self, *, collection_id: str, - ticket: Union[models.TicketInput, models.TicketInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + type_: OptionalNullable[str] = UNSET, + subject: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + priority: OptionalNullable[models.Priority] = UNSET, + assignees: Optional[ + Union[List[models.AssigneeInput], List[models.AssigneeInputTypedDict]] + ] = None, + due_date: OptionalNullable[datetime] = UNSET, + tags: Optional[ + Union[ + List[models.CollectionTagInput], + List[models.CollectionTagInputTypedDict], + ] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketsAddResponse: r"""Create Ticket Create Ticket :param collection_id: The collection ID - :param ticket: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: The ticket's parent ID + :param type: The ticket's type + :param subject: Subject of the ticket + :param description: The ticket's description. HTML version of description is mapped if supported by the third-party platform + :param status: 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. + :param priority: Priority of the ticket + :param assignees: + :param due_date: Due date of the ticket + :param tags: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -274,7 +411,24 @@ def create( raw=raw, service_id=service_id, collection_id=collection_id, - ticket=utils.get_pydantic_model(ticket, models.TicketInput), + ticket=models.TicketInput( + parent_id=parent_id, + type=type_, + subject=subject, + description=description, + status=status, + priority=priority, + assignees=utils.get_pydantic_model( + assignees, Optional[List[models.AssigneeInput]] + ), + due_date=due_date, + tags=utils.get_pydantic_model( + tags, Optional[List[models.CollectionTagInput]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -288,6 +442,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -365,24 +520,53 @@ async def create_async( self, *, collection_id: str, - ticket: Union[models.TicketInput, models.TicketInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + type_: OptionalNullable[str] = UNSET, + subject: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + priority: OptionalNullable[models.Priority] = UNSET, + assignees: Optional[ + Union[List[models.AssigneeInput], List[models.AssigneeInputTypedDict]] + ] = None, + due_date: OptionalNullable[datetime] = UNSET, + tags: Optional[ + Union[ + List[models.CollectionTagInput], + List[models.CollectionTagInputTypedDict], + ] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketsAddResponse: r"""Create Ticket Create Ticket :param collection_id: The collection ID - :param ticket: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: The ticket's parent ID + :param type: The ticket's type + :param subject: Subject of the ticket + :param description: The ticket's description. HTML version of description is mapped if supported by the third-party platform + :param status: 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. + :param priority: Priority of the ticket + :param assignees: + :param due_date: Due date of the ticket + :param tags: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -396,7 +580,24 @@ async def create_async( raw=raw, service_id=service_id, collection_id=collection_id, - ticket=utils.get_pydantic_model(ticket, models.TicketInput), + ticket=models.TicketInput( + parent_id=parent_id, + type=type_, + subject=subject, + description=description, + status=status, + priority=priority, + assignees=utils.get_pydantic_model( + assignees, Optional[List[models.AssigneeInput]] + ), + due_date=due_date, + tags=utils.get_pydantic_model( + tags, Optional[List[models.CollectionTagInput]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -410,6 +611,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -486,22 +688,29 @@ async def create_async( def get( self, *, - request: Union[ - models.IssueTrackingCollectionTicketsOneRequest, - models.IssueTrackingCollectionTicketsOneRequestTypedDict, - ], + ticket_id: str, + collection_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketsOneResponse: r"""Get Ticket Get Ticket - :param request: The request object to send. + :param ticket_id: ID of the ticket you are acting upon. + :param collection_id: The collection ID + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -511,11 +720,13 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketsOneRequest - ) - request = cast(models.IssueTrackingCollectionTicketsOneRequest, request) + request = models.IssueTrackingCollectionTicketsOneRequest( + ticket_id=ticket_id, + service_id=service_id, + raw=raw, + collection_id=collection_id, + fields=fields, + ) req = self.build_request( method="GET", @@ -528,6 +739,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -601,22 +813,29 @@ def get( async def get_async( self, *, - request: Union[ - models.IssueTrackingCollectionTicketsOneRequest, - models.IssueTrackingCollectionTicketsOneRequestTypedDict, - ], + ticket_id: str, + collection_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketsOneResponse: r"""Get Ticket Get Ticket - :param request: The request object to send. + :param ticket_id: ID of the ticket you are acting upon. + :param collection_id: The collection ID + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -626,11 +845,13 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketsOneRequest - ) - request = cast(models.IssueTrackingCollectionTicketsOneRequest, request) + request = models.IssueTrackingCollectionTicketsOneRequest( + ticket_id=ticket_id, + service_id=service_id, + raw=raw, + collection_id=collection_id, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -643,6 +864,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -716,22 +938,56 @@ async def get_async( def update( self, *, - request: Union[ - models.IssueTrackingCollectionTicketsUpdateRequest, - models.IssueTrackingCollectionTicketsUpdateRequestTypedDict, - ], + ticket_id: str, + collection_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + type_: OptionalNullable[str] = UNSET, + subject: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + priority: OptionalNullable[models.Priority] = UNSET, + assignees: Optional[ + Union[List[models.AssigneeInput], List[models.AssigneeInputTypedDict]] + ] = None, + due_date: OptionalNullable[datetime] = UNSET, + tags: Optional[ + Union[ + List[models.CollectionTagInput], + List[models.CollectionTagInputTypedDict], + ] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketsUpdateResponse: r"""Update Ticket Update Ticket - :param request: The request object to send. + :param ticket_id: ID of the ticket you are acting upon. + :param collection_id: The collection ID + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: The ticket's parent ID + :param type: The ticket's type + :param subject: Subject of the ticket + :param description: The ticket's description. HTML version of description is mapped if supported by the third-party platform + :param status: 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. + :param priority: Priority of the ticket + :param assignees: + :param due_date: Due date of the ticket + :param tags: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -741,11 +997,30 @@ def update( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketsUpdateRequest - ) - request = cast(models.IssueTrackingCollectionTicketsUpdateRequest, request) + request = models.IssueTrackingCollectionTicketsUpdateRequest( + ticket_id=ticket_id, + service_id=service_id, + raw=raw, + collection_id=collection_id, + ticket=models.TicketInput( + parent_id=parent_id, + type=type_, + subject=subject, + description=description, + status=status, + priority=priority, + assignees=utils.get_pydantic_model( + assignees, Optional[List[models.AssigneeInput]] + ), + due_date=due_date, + tags=utils.get_pydantic_model( + tags, Optional[List[models.CollectionTagInput]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), + ) req = self.build_request( method="PATCH", @@ -758,6 +1033,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -834,22 +1110,56 @@ def update( async def update_async( self, *, - request: Union[ - models.IssueTrackingCollectionTicketsUpdateRequest, - models.IssueTrackingCollectionTicketsUpdateRequestTypedDict, - ], + ticket_id: str, + collection_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + type_: OptionalNullable[str] = UNSET, + subject: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + priority: OptionalNullable[models.Priority] = UNSET, + assignees: Optional[ + Union[List[models.AssigneeInput], List[models.AssigneeInputTypedDict]] + ] = None, + due_date: OptionalNullable[datetime] = UNSET, + tags: Optional[ + Union[ + List[models.CollectionTagInput], + List[models.CollectionTagInputTypedDict], + ] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketsUpdateResponse: r"""Update Ticket Update Ticket - :param request: The request object to send. + :param ticket_id: ID of the ticket you are acting upon. + :param collection_id: The collection ID + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: The ticket's parent ID + :param type: The ticket's type + :param subject: Subject of the ticket + :param description: The ticket's description. HTML version of description is mapped if supported by the third-party platform + :param status: 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. + :param priority: Priority of the ticket + :param assignees: + :param due_date: Due date of the ticket + :param tags: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -859,11 +1169,30 @@ async def update_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionTicketsUpdateRequest - ) - request = cast(models.IssueTrackingCollectionTicketsUpdateRequest, request) + request = models.IssueTrackingCollectionTicketsUpdateRequest( + ticket_id=ticket_id, + service_id=service_id, + raw=raw, + collection_id=collection_id, + ticket=models.TicketInput( + parent_id=parent_id, + type=type_, + subject=subject, + description=description, + status=status, + priority=priority, + assignees=utils.get_pydantic_model( + assignees, Optional[List[models.AssigneeInput]] + ), + due_date=due_date, + tags=utils.get_pydantic_model( + tags, Optional[List[models.CollectionTagInput]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), + ) req = self.build_request_async( method="PATCH", @@ -876,6 +1205,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -959,6 +1289,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketsDeleteResponse: r"""Delete Ticket @@ -971,6 +1302,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -998,6 +1330,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1411,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionTicketsDeleteResponse: r"""Delete Ticket @@ -1090,6 +1424,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1452,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionTicketsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/collectionusers.py b/src/apideck_unify/collectionusers.py index be82cede..3c4f14ca 100644 --- a/src/apideck_unify/collectionusers.py +++ b/src/apideck_unify/collectionusers.py @@ -3,31 +3,43 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional class CollectionUsers(BaseSDK): def list( self, *, - request: Union[ - models.IssueTrackingCollectionUsersAllRequest, - models.IssueTrackingCollectionUsersAllRequestTypedDict, - ], + collection_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionUsersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionUsersAllResponse]: r"""List Users List Users - :param request: The request object to send. + :param collection_id: The collection ID + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +49,15 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionUsersAllRequest - ) - request = cast(models.IssueTrackingCollectionUsersAllRequest, request) + request = models.IssueTrackingCollectionUsersAllRequest( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -54,6 +70,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionUsersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,10 +104,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.IssueTrackingCollectionUsersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetCollectionUsersResponse + return models.IssueTrackingCollectionUsersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetCollectionUsersResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -115,7 +154,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionUsersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -129,22 +173,33 @@ def list( async def list_async( self, *, - request: Union[ - models.IssueTrackingCollectionUsersAllRequest, - models.IssueTrackingCollectionUsersAllRequestTypedDict, - ], + collection_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.IssueTrackingCollectionUsersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.IssueTrackingCollectionUsersAllResponse]: r"""List Users List Users - :param request: The request object to send. + :param collection_id: The collection ID + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -154,11 +209,15 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionUsersAllRequest - ) - request = cast(models.IssueTrackingCollectionUsersAllRequest, request) + request = models.IssueTrackingCollectionUsersAllRequest( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -171,6 +230,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionUsersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -204,10 +264,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.IssueTrackingCollectionUsersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + collection_id=collection_id, + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetCollectionUsersResponse + return models.IssueTrackingCollectionUsersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetCollectionUsersResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -232,7 +314,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.IssueTrackingCollectionUsersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -246,22 +333,29 @@ async def list_async( def get( self, *, - request: Union[ - models.IssueTrackingCollectionUsersOneRequest, - models.IssueTrackingCollectionUsersOneRequestTypedDict, - ], + collection_id: str, + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionUsersOneResponse: r"""Get user Get user - :param request: The request object to send. + :param collection_id: The collection ID + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -271,11 +365,13 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionUsersOneRequest - ) - request = cast(models.IssueTrackingCollectionUsersOneRequest, request) + request = models.IssueTrackingCollectionUsersOneRequest( + collection_id=collection_id, + id=id, + service_id=service_id, + raw=raw, + fields=fields, + ) req = self.build_request( method="GET", @@ -288,6 +384,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionUsersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -361,22 +458,29 @@ def get( async def get_async( self, *, - request: Union[ - models.IssueTrackingCollectionUsersOneRequest, - models.IssueTrackingCollectionUsersOneRequestTypedDict, - ], + collection_id: str, + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.IssueTrackingCollectionUsersOneResponse: r"""Get user Get user - :param request: The request object to send. + :param collection_id: The collection ID + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,11 +490,13 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.IssueTrackingCollectionUsersOneRequest - ) - request = cast(models.IssueTrackingCollectionUsersOneRequest, request) + request = models.IssueTrackingCollectionUsersOneRequest( + collection_id=collection_id, + id=id, + service_id=service_id, + raw=raw, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -403,6 +509,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.IssueTrackingCollectionUsersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/companies.py b/src/apideck_unify/companies.py index f86bef34..9ea8499c 100644 --- a/src/apideck_unify/companies.py +++ b/src/apideck_unify/companies.py @@ -3,30 +3,50 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Companies(BaseSDK): def list( self, *, - request: Union[ - models.CrmCompaniesAllRequest, models.CrmCompaniesAllRequestTypedDict - ] = models.CrmCompaniesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.CompaniesFilter, models.CompaniesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.CompaniesSort, models.CompaniesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmCompaniesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmCompaniesAllResponse]: r"""List companies List companies - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +56,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmCompaniesAllRequest) - request = cast(models.CrmCompaniesAllRequest, request) + request = models.CrmCompaniesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.CompaniesFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.CompaniesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +78,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +112,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmCompaniesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCompaniesResponse) + return models.CrmCompaniesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetCompaniesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +161,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmCompaniesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +180,39 @@ def list( async def list_async( self, *, - request: Union[ - models.CrmCompaniesAllRequest, models.CrmCompaniesAllRequestTypedDict - ] = models.CrmCompaniesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.CompaniesFilter, models.CompaniesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.CompaniesSort, models.CompaniesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmCompaniesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmCompaniesAllResponse]: r"""List companies List companies - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +222,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmCompaniesAllRequest) - request = cast(models.CrmCompaniesAllRequest, request) + request = models.CrmCompaniesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.CompaniesFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.CompaniesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +244,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +278,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmCompaniesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCompaniesResponse) + return models.CrmCompaniesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetCompaniesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +327,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmCompaniesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +346,103 @@ async def list_async( def create( self, *, - company: Union[models.CompanyInput, models.CompanyInputTypedDict], + name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + owner_id: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + vat_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + status: OptionalNullable[str] = UNSET, + fax: OptionalNullable[str] = UNSET, + annual_revenue: OptionalNullable[str] = UNSET, + number_of_employees: OptionalNullable[str] = UNSET, + industry: OptionalNullable[str] = UNSET, + ownership: OptionalNullable[str] = UNSET, + sales_tax_number: OptionalNullable[str] = UNSET, + payee_number: OptionalNullable[str] = UNSET, + abn_or_tfn: OptionalNullable[str] = UNSET, + abn_branch: OptionalNullable[str] = UNSET, + acn: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + row_type: Optional[ + Union[models.CompanyRowType, models.CompanyRowTypeTypedDict] + ] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + read_only: OptionalNullable[bool] = UNSET, + salutation: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmCompaniesAddResponse: r"""Create company Create company - :param company: + :param name: Name of the company :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param owner_id: Owner ID + :param image: The Image URL of the company + :param description: A description of the company + :param vat_number: The VAT number of the company + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param status: The status of the company + :param fax: The fax number of the company + :param annual_revenue: The annual revenue of the company + :param number_of_employees: Number of employees + :param industry: The industry represents the type of business the company is in. + :param ownership: The ownership indicates the type of ownership of the company. + :param sales_tax_number: A sales tax number is a unique number that identifies a company for tax purposes. + :param payee_number: A payee number is a unique number that identifies a payee for tax purposes. + :param abn_or_tfn: An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. + :param abn_branch: 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. + :param acn: 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. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param bank_accounts: + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param row_type: + :param custom_fields: + :param tags: + :param read_only: Whether the company is read-only or not + :param salutation: A formal salutation for the person. For example, 'Mr', 'Mrs' + :param birthday: The date of birth of the person. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +455,56 @@ def create( request = models.CrmCompaniesAddRequest( raw=raw, service_id=service_id, - company=utils.get_pydantic_model(company, models.CompanyInput), + company=models.CompanyInput( + name=name, + owner_id=owner_id, + image=image, + description=description, + vat_number=vat_number, + currency=currency, + status=status, + fax=fax, + annual_revenue=annual_revenue, + number_of_employees=number_of_employees, + industry=industry, + ownership=ownership, + sales_tax_number=sales_tax_number, + payee_number=payee_number, + abn_or_tfn=abn_or_tfn, + abn_branch=abn_branch, + acn=acn, + first_name=first_name, + last_name=last_name, + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + row_type=utils.get_pydantic_model( + row_type, Optional[models.CompanyRowType] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + read_only=read_only, + salutation=salutation, + birthday=birthday, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +518,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +595,103 @@ def create( async def create_async( self, *, - company: Union[models.CompanyInput, models.CompanyInputTypedDict], + name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + owner_id: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + vat_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + status: OptionalNullable[str] = UNSET, + fax: OptionalNullable[str] = UNSET, + annual_revenue: OptionalNullable[str] = UNSET, + number_of_employees: OptionalNullable[str] = UNSET, + industry: OptionalNullable[str] = UNSET, + ownership: OptionalNullable[str] = UNSET, + sales_tax_number: OptionalNullable[str] = UNSET, + payee_number: OptionalNullable[str] = UNSET, + abn_or_tfn: OptionalNullable[str] = UNSET, + abn_branch: OptionalNullable[str] = UNSET, + acn: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + row_type: Optional[ + Union[models.CompanyRowType, models.CompanyRowTypeTypedDict] + ] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + read_only: OptionalNullable[bool] = UNSET, + salutation: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmCompaniesAddResponse: r"""Create company Create company - :param company: + :param name: Name of the company :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param owner_id: Owner ID + :param image: The Image URL of the company + :param description: A description of the company + :param vat_number: The VAT number of the company + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param status: The status of the company + :param fax: The fax number of the company + :param annual_revenue: The annual revenue of the company + :param number_of_employees: Number of employees + :param industry: The industry represents the type of business the company is in. + :param ownership: The ownership indicates the type of ownership of the company. + :param sales_tax_number: A sales tax number is a unique number that identifies a company for tax purposes. + :param payee_number: A payee number is a unique number that identifies a payee for tax purposes. + :param abn_or_tfn: An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. + :param abn_branch: 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. + :param acn: 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. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param bank_accounts: + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param row_type: + :param custom_fields: + :param tags: + :param read_only: Whether the company is read-only or not + :param salutation: A formal salutation for the person. For example, 'Mr', 'Mrs' + :param birthday: The date of birth of the person. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +704,56 @@ async def create_async( request = models.CrmCompaniesAddRequest( raw=raw, service_id=service_id, - company=utils.get_pydantic_model(company, models.CompanyInput), + company=models.CompanyInput( + name=name, + owner_id=owner_id, + image=image, + description=description, + vat_number=vat_number, + currency=currency, + status=status, + fax=fax, + annual_revenue=annual_revenue, + number_of_employees=number_of_employees, + industry=industry, + ownership=ownership, + sales_tax_number=sales_tax_number, + payee_number=payee_number, + abn_or_tfn=abn_or_tfn, + abn_branch=abn_branch, + acn=acn, + first_name=first_name, + last_name=last_name, + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + row_type=utils.get_pydantic_model( + row_type, Optional[models.CompanyRowType] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + read_only=read_only, + salutation=salutation, + birthday=birthday, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +767,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +851,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmCompaniesOneResponse: r"""Get company @@ -493,6 +864,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +892,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +973,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmCompaniesOneResponse: r"""Get company @@ -612,6 +986,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +1014,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +1089,104 @@ def update( self, *, id: str, - company: Union[models.CompanyInput, models.CompanyInputTypedDict], + name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + owner_id: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + vat_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + status: OptionalNullable[str] = UNSET, + fax: OptionalNullable[str] = UNSET, + annual_revenue: OptionalNullable[str] = UNSET, + number_of_employees: OptionalNullable[str] = UNSET, + industry: OptionalNullable[str] = UNSET, + ownership: OptionalNullable[str] = UNSET, + sales_tax_number: OptionalNullable[str] = UNSET, + payee_number: OptionalNullable[str] = UNSET, + abn_or_tfn: OptionalNullable[str] = UNSET, + abn_branch: OptionalNullable[str] = UNSET, + acn: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + row_type: Optional[ + Union[models.CompanyRowType, models.CompanyRowTypeTypedDict] + ] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + read_only: OptionalNullable[bool] = UNSET, + salutation: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmCompaniesUpdateResponse: r"""Update company Update company :param id: ID of the record you are acting upon. - :param company: + :param name: Name of the company :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param owner_id: Owner ID + :param image: The Image URL of the company + :param description: A description of the company + :param vat_number: The VAT number of the company + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param status: The status of the company + :param fax: The fax number of the company + :param annual_revenue: The annual revenue of the company + :param number_of_employees: Number of employees + :param industry: The industry represents the type of business the company is in. + :param ownership: The ownership indicates the type of ownership of the company. + :param sales_tax_number: A sales tax number is a unique number that identifies a company for tax purposes. + :param payee_number: A payee number is a unique number that identifies a payee for tax purposes. + :param abn_or_tfn: An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. + :param abn_branch: 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. + :param acn: 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. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param bank_accounts: + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param row_type: + :param custom_fields: + :param tags: + :param read_only: Whether the company is read-only or not + :param salutation: A formal salutation for the person. For example, 'Mr', 'Mrs' + :param birthday: The date of birth of the person. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +1200,56 @@ def update( id=id, raw=raw, service_id=service_id, - company=utils.get_pydantic_model(company, models.CompanyInput), + company=models.CompanyInput( + name=name, + owner_id=owner_id, + image=image, + description=description, + vat_number=vat_number, + currency=currency, + status=status, + fax=fax, + annual_revenue=annual_revenue, + number_of_employees=number_of_employees, + industry=industry, + ownership=ownership, + sales_tax_number=sales_tax_number, + payee_number=payee_number, + abn_or_tfn=abn_or_tfn, + abn_branch=abn_branch, + acn=acn, + first_name=first_name, + last_name=last_name, + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + row_type=utils.get_pydantic_model( + row_type, Optional[models.CompanyRowType] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + read_only=read_only, + salutation=salutation, + birthday=birthday, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +1263,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +1341,104 @@ async def update_async( self, *, id: str, - company: Union[models.CompanyInput, models.CompanyInputTypedDict], + name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + owner_id: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + vat_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + status: OptionalNullable[str] = UNSET, + fax: OptionalNullable[str] = UNSET, + annual_revenue: OptionalNullable[str] = UNSET, + number_of_employees: OptionalNullable[str] = UNSET, + industry: OptionalNullable[str] = UNSET, + ownership: OptionalNullable[str] = UNSET, + sales_tax_number: OptionalNullable[str] = UNSET, + payee_number: OptionalNullable[str] = UNSET, + abn_or_tfn: OptionalNullable[str] = UNSET, + abn_branch: OptionalNullable[str] = UNSET, + acn: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + row_type: Optional[ + Union[models.CompanyRowType, models.CompanyRowTypeTypedDict] + ] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + read_only: OptionalNullable[bool] = UNSET, + salutation: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmCompaniesUpdateResponse: r"""Update company Update company :param id: ID of the record you are acting upon. - :param company: + :param name: Name of the company :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param owner_id: Owner ID + :param image: The Image URL of the company + :param description: A description of the company + :param vat_number: The VAT number of the company + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param status: The status of the company + :param fax: The fax number of the company + :param annual_revenue: The annual revenue of the company + :param number_of_employees: Number of employees + :param industry: The industry represents the type of business the company is in. + :param ownership: The ownership indicates the type of ownership of the company. + :param sales_tax_number: A sales tax number is a unique number that identifies a company for tax purposes. + :param payee_number: A payee number is a unique number that identifies a payee for tax purposes. + :param abn_or_tfn: An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. + :param abn_branch: 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. + :param acn: 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. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param bank_accounts: + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param row_type: + :param custom_fields: + :param tags: + :param read_only: Whether the company is read-only or not + :param salutation: A formal salutation for the person. For example, 'Mr', 'Mrs' + :param birthday: The date of birth of the person. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1452,56 @@ async def update_async( id=id, raw=raw, service_id=service_id, - company=utils.get_pydantic_model(company, models.CompanyInput), + company=models.CompanyInput( + name=name, + owner_id=owner_id, + image=image, + description=description, + vat_number=vat_number, + currency=currency, + status=status, + fax=fax, + annual_revenue=annual_revenue, + number_of_employees=number_of_employees, + industry=industry, + ownership=ownership, + sales_tax_number=sales_tax_number, + payee_number=payee_number, + abn_or_tfn=abn_or_tfn, + abn_branch=abn_branch, + acn=acn, + first_name=first_name, + last_name=last_name, + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + row_type=utils.get_pydantic_model( + row_type, Optional[models.CompanyRowType] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + read_only=read_only, + salutation=salutation, + birthday=birthday, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1515,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1598,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmCompaniesDeleteResponse: r"""Delete company @@ -973,6 +1610,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1637,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1717,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmCompaniesDeleteResponse: r"""Delete company @@ -1089,6 +1729,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1756,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmCompaniesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/companyinfo_sdk.py b/src/apideck_unify/companyinfo_sdk.py index 4652494c..e887f765 100644 --- a/src/apideck_unify/companyinfo_sdk.py +++ b/src/apideck_unify/companyinfo_sdk.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class CompanyInfoSDK(BaseSDK): @@ -18,6 +18,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCompanyInfoOneResponse: r"""Get company info @@ -29,6 +30,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -55,6 +57,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCompanyInfoOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -134,6 +137,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCompanyInfoOneResponse: r"""Get company info @@ -145,6 +149,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -171,6 +176,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCompanyInfoOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/connectioncustommappings.py b/src/apideck_unify/connectioncustommappings.py index dfcf6c81..49057bc8 100644 --- a/src/apideck_unify/connectioncustommappings.py +++ b/src/apideck_unify/connectioncustommappings.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class ConnectionCustomMappings(BaseSDK): @@ -19,6 +19,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionCustomMappingsAllResponse: r"""List connection custom mappings @@ -31,6 +32,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -58,6 +60,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionCustomMappingsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -138,6 +141,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionCustomMappingsAllResponse: r"""List connection custom mappings @@ -150,6 +154,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -177,6 +182,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionCustomMappingsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/connections.py b/src/apideck_unify/connections.py index 1e400dbf..c1489363 100644 --- a/src/apideck_unify/connections.py +++ b/src/apideck_unify/connections.py @@ -5,7 +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 typing import Any, Optional, Union +from typing import Any, Dict, List, Mapping, Optional, Union class Connections(BaseSDK): @@ -17,6 +17,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsAllResponse: r"""Get all connections @@ -30,6 +31,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -55,6 +57,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -133,6 +136,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsAllResponse: r"""Get all connections @@ -146,6 +150,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -171,6 +176,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -249,6 +255,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsOneResponse: r"""Get connection @@ -259,6 +266,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -284,6 +292,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -362,6 +371,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsOneResponse: r"""Get connection @@ -372,6 +382,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -397,6 +408,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -472,10 +484,25 @@ def update( *, service_id: str, unified_api: str, - connection: Union[models.ConnectionInput, models.ConnectionInputTypedDict], + enabled: Optional[bool] = None, + settings: OptionalNullable[Dict[str, Any]] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + configuration: Optional[ + Union[ + List[models.ConnectionConfiguration], + List[models.ConnectionConfigurationTypedDict], + ] + ] = None, + custom_mappings: Optional[ + Union[ + List[models.CustomMappingInput], + List[models.CustomMappingInputTypedDict], + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsUpdateResponse: r"""Update connection @@ -483,10 +510,15 @@ def update( :param service_id: Service ID of the resource to return :param unified_api: Unified API - :param connection: Fields that need to be updated on the resource + :param enabled: Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. + :param settings: Connection settings. Values will persist to `form_fields` with corresponding id + :param metadata: Attach your own consumer specific metadata + :param configuration: + :param custom_mappings: List of custom mappings configured for this connection :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -499,7 +531,17 @@ def update( request = models.VaultConnectionsUpdateRequest( service_id=service_id, unified_api=unified_api, - connection=utils.get_pydantic_model(connection, models.ConnectionInput), + connection=models.ConnectionInput( + enabled=enabled, + settings=settings, + metadata=metadata, + configuration=utils.get_pydantic_model( + configuration, Optional[List[models.ConnectionConfiguration]] + ), + custom_mappings=utils.get_pydantic_model( + custom_mappings, Optional[List[models.CustomMappingInput]] + ), + ), ) req = self.build_request( @@ -513,6 +555,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -591,10 +634,25 @@ async def update_async( *, service_id: str, unified_api: str, - connection: Union[models.ConnectionInput, models.ConnectionInputTypedDict], + enabled: Optional[bool] = None, + settings: OptionalNullable[Dict[str, Any]] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + configuration: Optional[ + Union[ + List[models.ConnectionConfiguration], + List[models.ConnectionConfigurationTypedDict], + ] + ] = None, + custom_mappings: Optional[ + Union[ + List[models.CustomMappingInput], + List[models.CustomMappingInputTypedDict], + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsUpdateResponse: r"""Update connection @@ -602,10 +660,15 @@ async def update_async( :param service_id: Service ID of the resource to return :param unified_api: Unified API - :param connection: Fields that need to be updated on the resource + :param enabled: Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. + :param settings: Connection settings. Values will persist to `form_fields` with corresponding id + :param metadata: Attach your own consumer specific metadata + :param configuration: + :param custom_mappings: List of custom mappings configured for this connection :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -618,7 +681,17 @@ async def update_async( request = models.VaultConnectionsUpdateRequest( service_id=service_id, unified_api=unified_api, - connection=utils.get_pydantic_model(connection, models.ConnectionInput), + connection=models.ConnectionInput( + enabled=enabled, + settings=settings, + metadata=metadata, + configuration=utils.get_pydantic_model( + configuration, Optional[List[models.ConnectionConfiguration]] + ), + custom_mappings=utils.get_pydantic_model( + custom_mappings, Optional[List[models.CustomMappingInput]] + ), + ), ) req = self.build_request_async( @@ -632,6 +705,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,6 +787,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[models.UnexpectedErrorResponse]: r"""Deletes a connection @@ -723,6 +798,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -748,6 +824,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -826,6 +903,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> Optional[models.UnexpectedErrorResponse]: r"""Deletes a connection @@ -836,6 +914,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -861,6 +940,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -936,12 +1016,20 @@ def imports( *, service_id: str, unified_api: str, - connection_import_data: Union[ - models.ConnectionImportData, models.ConnectionImportDataTypedDict - ], + credentials: Optional[ + Union[models.Credentials, models.CredentialsTypedDict] + ] = None, + settings: OptionalNullable[ + Union[ + models.ConnectionImportDataSettings, + models.ConnectionImportDataSettingsTypedDict, + ] + ] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsImportResponse: r"""Import connection @@ -950,10 +1038,13 @@ def imports( :param service_id: Service ID of the resource to return :param unified_api: Unified API - :param connection_import_data: Fields that need to be persisted on the resource + :param credentials: + :param settings: Connection settings. Values will persist to `form_fields` with corresponding id + :param metadata: Attach your own consumer specific metadata :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -966,8 +1057,14 @@ def imports( request = models.VaultConnectionsImportRequest( service_id=service_id, unified_api=unified_api, - connection_import_data=utils.get_pydantic_model( - connection_import_data, models.ConnectionImportData + connection_import_data=models.ConnectionImportData( + credentials=utils.get_pydantic_model( + credentials, Optional[models.Credentials] + ), + settings=utils.get_pydantic_model( + settings, OptionalNullable[models.ConnectionImportDataSettings] + ), + metadata=metadata, ), ) @@ -982,6 +1079,7 @@ def imports( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsImportGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1064,12 +1162,20 @@ async def imports_async( *, service_id: str, unified_api: str, - connection_import_data: Union[ - models.ConnectionImportData, models.ConnectionImportDataTypedDict - ], + credentials: Optional[ + Union[models.Credentials, models.CredentialsTypedDict] + ] = None, + settings: OptionalNullable[ + Union[ + models.ConnectionImportDataSettings, + models.ConnectionImportDataSettingsTypedDict, + ] + ] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsImportResponse: r"""Import connection @@ -1078,10 +1184,13 @@ async def imports_async( :param service_id: Service ID of the resource to return :param unified_api: Unified API - :param connection_import_data: Fields that need to be persisted on the resource + :param credentials: + :param settings: Connection settings. Values will persist to `form_fields` with corresponding id + :param metadata: Attach your own consumer specific metadata :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1094,8 +1203,14 @@ async def imports_async( request = models.VaultConnectionsImportRequest( service_id=service_id, unified_api=unified_api, - connection_import_data=utils.get_pydantic_model( - connection_import_data, models.ConnectionImportData + connection_import_data=models.ConnectionImportData( + credentials=utils.get_pydantic_model( + credentials, Optional[models.Credentials] + ), + settings=utils.get_pydantic_model( + settings, OptionalNullable[models.ConnectionImportDataSettings] + ), + metadata=metadata, ), ) @@ -1110,6 +1225,7 @@ async def imports_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsImportGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1201,6 +1317,7 @@ def token( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsTokenResponse: r"""Authorize Access Token @@ -1218,6 +1335,7 @@ def token( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1246,6 +1364,7 @@ def token( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsTokenGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1337,6 +1456,7 @@ async def token_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionsTokenResponse: r"""Authorize Access Token @@ -1354,6 +1474,7 @@ async def token_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1382,6 +1503,7 @@ async def token_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionsTokenGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/connectionsettings.py b/src/apideck_unify/connectionsettings.py index 70ee84b6..da924e93 100644 --- a/src/apideck_unify/connectionsettings.py +++ b/src/apideck_unify/connectionsettings.py @@ -5,7 +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 typing import Any, Optional, Union +from typing import Any, Dict, List, Mapping, Optional, Union class ConnectionSettings(BaseSDK): @@ -18,6 +18,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionSettingsAllResponse: r"""Get resource settings @@ -30,6 +31,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -56,6 +58,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionSettingsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -135,6 +138,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionSettingsAllResponse: r"""Get resource settings @@ -147,6 +151,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -173,6 +178,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionSettingsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -249,10 +255,25 @@ def update( service_id: str, unified_api: str, resource: str, - connection: Union[models.ConnectionInput, models.ConnectionInputTypedDict], + enabled: Optional[bool] = None, + settings: OptionalNullable[Dict[str, Any]] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + configuration: Optional[ + Union[ + List[models.ConnectionConfiguration], + List[models.ConnectionConfigurationTypedDict], + ] + ] = None, + custom_mappings: Optional[ + Union[ + List[models.CustomMappingInput], + List[models.CustomMappingInputTypedDict], + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionSettingsUpdateResponse: r"""Update settings @@ -261,10 +282,15 @@ def update( :param service_id: Service ID of the resource to return :param unified_api: Unified API :param resource: Name of the resource (plural) - :param connection: Fields that need to be updated on the resource + :param enabled: Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. + :param settings: Connection settings. Values will persist to `form_fields` with corresponding id + :param metadata: Attach your own consumer specific metadata + :param configuration: + :param custom_mappings: List of custom mappings configured for this connection :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -278,7 +304,17 @@ def update( service_id=service_id, unified_api=unified_api, resource=resource, - connection=utils.get_pydantic_model(connection, models.ConnectionInput), + connection=models.ConnectionInput( + enabled=enabled, + settings=settings, + metadata=metadata, + configuration=utils.get_pydantic_model( + configuration, Optional[List[models.ConnectionConfiguration]] + ), + custom_mappings=utils.get_pydantic_model( + custom_mappings, Optional[List[models.CustomMappingInput]] + ), + ), ) req = self.build_request( @@ -292,6 +328,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionSettingsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -371,10 +408,25 @@ async def update_async( service_id: str, unified_api: str, resource: str, - connection: Union[models.ConnectionInput, models.ConnectionInputTypedDict], + enabled: Optional[bool] = None, + settings: OptionalNullable[Dict[str, Any]] = UNSET, + metadata: OptionalNullable[Dict[str, Any]] = UNSET, + configuration: Optional[ + Union[ + List[models.ConnectionConfiguration], + List[models.ConnectionConfigurationTypedDict], + ] + ] = None, + custom_mappings: Optional[ + Union[ + List[models.CustomMappingInput], + List[models.CustomMappingInputTypedDict], + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConnectionSettingsUpdateResponse: r"""Update settings @@ -383,10 +435,15 @@ async def update_async( :param service_id: Service ID of the resource to return :param unified_api: Unified API :param resource: Name of the resource (plural) - :param connection: Fields that need to be updated on the resource + :param enabled: Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. + :param settings: Connection settings. Values will persist to `form_fields` with corresponding id + :param metadata: Attach your own consumer specific metadata + :param configuration: + :param custom_mappings: List of custom mappings configured for this connection :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -400,7 +457,17 @@ async def update_async( service_id=service_id, unified_api=unified_api, resource=resource, - connection=utils.get_pydantic_model(connection, models.ConnectionInput), + connection=models.ConnectionInput( + enabled=enabled, + settings=settings, + metadata=metadata, + configuration=utils.get_pydantic_model( + configuration, Optional[List[models.ConnectionConfiguration]] + ), + custom_mappings=utils.get_pydantic_model( + custom_mappings, Optional[List[models.CustomMappingInput]] + ), + ), ) req = self.build_request_async( @@ -414,6 +481,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConnectionSettingsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/connectordocs.py b/src/apideck_unify/connectordocs.py index 6d52a47d..26758ddc 100644 --- a/src/apideck_unify/connectordocs.py +++ b/src/apideck_unify/connectordocs.py @@ -6,7 +6,7 @@ from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env from enum import Enum -from typing import Any, Optional +from typing import Any, Mapping, Optional class GetAcceptEnum(str, Enum): @@ -24,6 +24,7 @@ def get( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, accept_header_override: Optional[GetAcceptEnum] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorConnectorDocsOneResponse: r"""Get Connector Doc content @@ -35,6 +36,7 @@ def get( :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -62,6 +64,7 @@ def get( accept_header_value=accept_header_override.value if accept_header_override is not None else "application/json;q=1, text/markdown;q=0", + http_headers=http_headers, _globals=models.ConnectorConnectorDocsOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -134,6 +137,7 @@ async def get_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, accept_header_override: Optional[GetAcceptEnum] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorConnectorDocsOneResponse: r"""Get Connector Doc content @@ -145,6 +149,7 @@ async def get_async( :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -172,6 +177,7 @@ async def get_async( accept_header_value=accept_header_override.value if accept_header_override is not None else "application/json;q=1, text/markdown;q=0", + http_headers=http_headers, _globals=models.ConnectorConnectorDocsOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), diff --git a/src/apideck_unify/connectorresources.py b/src/apideck_unify/connectorresources.py index 7e1c9126..4db76999 100644 --- a/src/apideck_unify/connectorresources.py +++ b/src/apideck_unify/connectorresources.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class ConnectorResources(BaseSDK): @@ -18,6 +18,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorConnectorResourcesOneResponse: r"""Get Connector Resource @@ -29,6 +30,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -55,6 +57,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorConnectorResourcesOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -129,6 +132,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorConnectorResourcesOneResponse: r"""Get Connector Resource @@ -140,6 +144,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -166,6 +171,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorConnectorResourcesOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), diff --git a/src/apideck_unify/connectors.py b/src/apideck_unify/connectors.py index 9e6f06bb..530360da 100644 --- a/src/apideck_unify/connectors.py +++ b/src/apideck_unify/connectors.py @@ -5,7 +5,8 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional, Union class Connectors(BaseSDK): @@ -20,7 +21,8 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ConnectorConnectorsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ConnectorConnectorsAllResponse]: r"""List Connectors List Connectors @@ -31,6 +33,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -59,6 +62,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorConnectorsAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -91,9 +95,29 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.ConnectorConnectorsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetConnectorsResponse) + return models.ConnectorConnectorsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetConnectorsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +135,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.ConnectorConnectorsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -133,7 +162,8 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.ConnectorConnectorsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.ConnectorConnectorsAllResponse]: r"""List Connectors List Connectors @@ -144,6 +174,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -172,6 +203,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorConnectorsAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -204,9 +236,29 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.ConnectorConnectorsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetConnectorsResponse) + return models.ConnectorConnectorsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetConnectorsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +276,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.ConnectorConnectorsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -242,6 +299,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorConnectorsOneResponse: r"""Get Connector @@ -251,6 +309,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -275,6 +334,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorConnectorsOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -345,6 +405,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.ConnectorConnectorsOneResponse: r"""Get Connector @@ -354,6 +415,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -378,6 +440,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.ConnectorConnectorsOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), diff --git a/src/apideck_unify/consumerrequestcounts.py b/src/apideck_unify/consumerrequestcounts.py index 647dfddc..31cd51ff 100644 --- a/src/apideck_unify/consumerrequestcounts.py +++ b/src/apideck_unify/consumerrequestcounts.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class ConsumerRequestCounts(BaseSDK): @@ -18,6 +18,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumerRequestCountsAllResponse: r"""Consumer request counts @@ -30,6 +31,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -56,6 +58,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumerRequestCountsAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -136,6 +139,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumerRequestCountsAllResponse: r"""Consumer request counts @@ -148,6 +152,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -174,6 +179,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumerRequestCountsAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), diff --git a/src/apideck_unify/consumers.py b/src/apideck_unify/consumers.py index 07fa32d5..e04f81be 100644 --- a/src/apideck_unify/consumers.py +++ b/src/apideck_unify/consumers.py @@ -5,26 +5,33 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional, Union class Consumers(BaseSDK): def create( self, *, - request: Union[models.ConsumerInput, models.ConsumerInputTypedDict], + consumer_id: str, + metadata: Optional[ + Union[models.ConsumerMetadata, models.ConsumerMetadataTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumersAddResponse: r"""Create consumer Create a consumer - :param request: The request object to send. + :param consumer_id: 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. + :param metadata: The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -35,7 +42,10 @@ def create( base_url = server_url request = models.ConsumerInput( - request=utils.get_pydantic_model(request, models.ConsumerInput), + consumer_id=consumer_id, + metadata=utils.get_pydantic_model( + metadata, Optional[models.ConsumerMetadata] + ), ) req = self.build_request( @@ -49,6 +59,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersAddGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -124,19 +135,25 @@ def create( async def create_async( self, *, - request: Union[models.ConsumerInput, models.ConsumerInputTypedDict], + consumer_id: str, + metadata: Optional[ + Union[models.ConsumerMetadata, models.ConsumerMetadataTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumersAddResponse: r"""Create consumer Create a consumer - :param request: The request object to send. + :param consumer_id: 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. + :param metadata: The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -147,7 +164,10 @@ async def create_async( base_url = server_url request = models.ConsumerInput( - request=utils.get_pydantic_model(request, models.ConsumerInput), + consumer_id=consumer_id, + metadata=utils.get_pydantic_model( + metadata, Optional[models.ConsumerMetadata] + ), ) req = self.build_request_async( @@ -161,6 +181,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersAddGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -241,7 +262,8 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.VaultConsumersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.VaultConsumersAllResponse]: r"""Get all consumers This endpoint includes all application consumers, along with an aggregated count of requests made. @@ -252,6 +274,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -277,6 +300,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -309,9 +333,26 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.VaultConsumersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetConsumersResponse) + return models.VaultConsumersAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetConsumersResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -335,7 +376,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.VaultConsumersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -354,7 +400,8 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.VaultConsumersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.VaultConsumersAllResponse]: r"""Get all consumers This endpoint includes all application consumers, along with an aggregated count of requests made. @@ -365,6 +412,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -390,6 +438,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -422,9 +471,26 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.VaultConsumersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetConsumersResponse) + return models.VaultConsumersAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetConsumersResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -448,7 +514,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.VaultConsumersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -466,6 +537,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumersOneResponse: r"""Get consumer @@ -476,6 +548,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -500,6 +573,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -576,6 +650,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumersOneResponse: r"""Get consumer @@ -586,6 +661,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -610,6 +686,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -683,22 +760,24 @@ def update( self, *, consumer_id: str, - update_consumer_request: Union[ - models.UpdateConsumerRequest, models.UpdateConsumerRequestTypedDict - ], + metadata: Optional[ + Union[models.ConsumerMetadata, models.ConsumerMetadataTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumersUpdateResponse: r"""Update consumer Update consumer metadata such as name and email. :param consumer_id: ID of the consumer to return - :param update_consumer_request: + :param metadata: The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -710,8 +789,10 @@ def update( request = models.VaultConsumersUpdateRequest( consumer_id=consumer_id, - update_consumer_request=utils.get_pydantic_model( - update_consumer_request, models.UpdateConsumerRequest + update_consumer_request=models.UpdateConsumerRequest( + metadata=utils.get_pydantic_model( + metadata, Optional[models.ConsumerMetadata] + ), ), ) @@ -726,6 +807,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersUpdateGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -806,22 +888,24 @@ async def update_async( self, *, consumer_id: str, - update_consumer_request: Union[ - models.UpdateConsumerRequest, models.UpdateConsumerRequestTypedDict - ], + metadata: Optional[ + Union[models.ConsumerMetadata, models.ConsumerMetadataTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumersUpdateResponse: r"""Update consumer Update consumer metadata such as name and email. :param consumer_id: ID of the consumer to return - :param update_consumer_request: + :param metadata: The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -833,8 +917,10 @@ async def update_async( request = models.VaultConsumersUpdateRequest( consumer_id=consumer_id, - update_consumer_request=utils.get_pydantic_model( - update_consumer_request, models.UpdateConsumerRequest + update_consumer_request=models.UpdateConsumerRequest( + metadata=utils.get_pydantic_model( + metadata, Optional[models.ConsumerMetadata] + ), ), ) @@ -849,6 +935,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersUpdateGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -932,6 +1019,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumersDeleteResponse: r"""Delete consumer @@ -941,6 +1029,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -965,6 +1054,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersDeleteGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -1041,6 +1131,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultConsumersDeleteResponse: r"""Delete consumer @@ -1050,6 +1141,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1074,6 +1166,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultConsumersDeleteGlobals( app_id=self.sdk_configuration.globals.app_id, ), diff --git a/src/apideck_unify/contacts.py b/src/apideck_unify/contacts.py index 7be8469c..e94a17c1 100644 --- a/src/apideck_unify/contacts.py +++ b/src/apideck_unify/contacts.py @@ -3,30 +3,47 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Contacts(BaseSDK): def list( self, *, - request: Union[ - models.CrmContactsAllRequest, models.CrmContactsAllRequestTypedDict - ] = models.CrmContactsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.ContactsFilter, models.ContactsFilterTypedDict] + ] = None, + sort: Optional[Union[models.ContactsSort, models.ContactsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmContactsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmContactsAllResponse]: r"""List contacts List contacts - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +53,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmContactsAllRequest) - request = cast(models.CrmContactsAllRequest, request) + request = models.CrmContactsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.ContactsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.ContactsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +75,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +109,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmContactsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetContactsResponse) + return models.CrmContactsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetContactsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +158,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmContactsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +177,37 @@ def list( async def list_async( self, *, - request: Union[ - models.CrmContactsAllRequest, models.CrmContactsAllRequestTypedDict - ] = models.CrmContactsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.ContactsFilter, models.ContactsFilterTypedDict] + ] = None, + sort: Optional[Union[models.ContactsSort, models.ContactsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmContactsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmContactsAllResponse]: r"""List contacts List contacts - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +217,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmContactsAllRequest) - request = cast(models.CrmContactsAllRequest, request) + request = models.CrmContactsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.ContactsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.ContactsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +239,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +273,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmContactsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetContactsResponse) + return models.CrmContactsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetContactsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +322,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmContactsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +341,103 @@ async def list_async( def create( self, *, - contact: Union[models.ContactInput, models.ContactInputTypedDict], + name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + owner_id: OptionalNullable[str] = UNSET, + type_: OptionalNullable[models.ContactType] = UNSET, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + prefix: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + gender: OptionalNullable[models.ContactGender] = UNSET, + birthday: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + photo_url: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + fax: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + current_balance: OptionalNullable[float] = UNSET, + status: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + email_domain: OptionalNullable[str] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + opportunity_ids: Optional[List[str]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmContactsAddResponse: r"""Create contact Create contact - :param contact: + :param name: Full name of the contact. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param owner_id: The owner of the contact. + :param type: The type of the contact. + :param company_id: The company the contact is associated with. + :param company_name: The name of the company the contact is associated with. + :param lead_id: The lead the contact is associated with. + :param first_name: The first name of the contact. + :param middle_name: The middle name of the contact. + :param last_name: The last name of the contact. + :param prefix: The prefix of the contact. + :param suffix: The suffix of the contact. + :param title: The job title of the contact. + :param department: The department of the contact. + :param language: language code according to ISO 639-1. For the United States - EN + :param gender: The gender of the contact. + :param birthday: The birthday of the contact. + :param image: + :param photo_url: The URL of the photo of a person. + :param lead_source: The lead source of the contact. + :param fax: The fax number of the contact. + :param description: The description of the contact. + :param current_balance: The current balance of the contact. + :param status: The status of the contact. + :param active: The active status of the contact. + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param email_domain: + :param custom_fields: + :param tags: + :param opportunity_ids: The opportunity ids of the contact. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +450,54 @@ def create( request = models.CrmContactsAddRequest( raw=raw, service_id=service_id, - contact=utils.get_pydantic_model(contact, models.ContactInput), + contact=models.ContactInput( + name=name, + owner_id=owner_id, + type=type_, + company_id=company_id, + company_name=company_name, + lead_id=lead_id, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + prefix=prefix, + suffix=suffix, + title=title, + department=department, + language=language, + gender=gender, + birthday=birthday, + image=image, + photo_url=photo_url, + lead_source=lead_source, + fax=fax, + description=description, + current_balance=current_balance, + status=status, + active=active, + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + email_domain=email_domain, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + opportunity_ids=opportunity_ids, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +511,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +588,103 @@ def create( async def create_async( self, *, - contact: Union[models.ContactInput, models.ContactInputTypedDict], + name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + owner_id: OptionalNullable[str] = UNSET, + type_: OptionalNullable[models.ContactType] = UNSET, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + prefix: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + gender: OptionalNullable[models.ContactGender] = UNSET, + birthday: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + photo_url: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + fax: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + current_balance: OptionalNullable[float] = UNSET, + status: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + email_domain: OptionalNullable[str] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + opportunity_ids: Optional[List[str]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmContactsAddResponse: r"""Create contact Create contact - :param contact: + :param name: Full name of the contact. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param owner_id: The owner of the contact. + :param type: The type of the contact. + :param company_id: The company the contact is associated with. + :param company_name: The name of the company the contact is associated with. + :param lead_id: The lead the contact is associated with. + :param first_name: The first name of the contact. + :param middle_name: The middle name of the contact. + :param last_name: The last name of the contact. + :param prefix: The prefix of the contact. + :param suffix: The suffix of the contact. + :param title: The job title of the contact. + :param department: The department of the contact. + :param language: language code according to ISO 639-1. For the United States - EN + :param gender: The gender of the contact. + :param birthday: The birthday of the contact. + :param image: + :param photo_url: The URL of the photo of a person. + :param lead_source: The lead source of the contact. + :param fax: The fax number of the contact. + :param description: The description of the contact. + :param current_balance: The current balance of the contact. + :param status: The status of the contact. + :param active: The active status of the contact. + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param email_domain: + :param custom_fields: + :param tags: + :param opportunity_ids: The opportunity ids of the contact. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +697,54 @@ async def create_async( request = models.CrmContactsAddRequest( raw=raw, service_id=service_id, - contact=utils.get_pydantic_model(contact, models.ContactInput), + contact=models.ContactInput( + name=name, + owner_id=owner_id, + type=type_, + company_id=company_id, + company_name=company_name, + lead_id=lead_id, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + prefix=prefix, + suffix=suffix, + title=title, + department=department, + language=language, + gender=gender, + birthday=birthday, + image=image, + photo_url=photo_url, + lead_source=lead_source, + fax=fax, + description=description, + current_balance=current_balance, + status=status, + active=active, + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + email_domain=email_domain, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + opportunity_ids=opportunity_ids, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +758,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -474,21 +835,31 @@ async def create_async( def get( self, *, - request: Union[ - models.CrmContactsOneRequest, models.CrmContactsOneRequestTypedDict - ], + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[models.ContactsFilter, models.ContactsFilterTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmContactsOneResponse: r"""Get contact Get contact - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. + :param filter_: Apply filters :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -498,9 +869,13 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmContactsOneRequest) - request = cast(models.CrmContactsOneRequest, request) + request = models.CrmContactsOneRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + filter_=utils.get_pydantic_model(filter_, Optional[models.ContactsFilter]), + ) req = self.build_request( method="GET", @@ -513,6 +888,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -586,21 +962,31 @@ def get( async def get_async( self, *, - request: Union[ - models.CrmContactsOneRequest, models.CrmContactsOneRequestTypedDict - ], + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[models.ContactsFilter, models.ContactsFilterTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmContactsOneResponse: r"""Get contact Get contact - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. + :param filter_: Apply filters :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -610,9 +996,13 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmContactsOneRequest) - request = cast(models.CrmContactsOneRequest, request) + request = models.CrmContactsOneRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + filter_=utils.get_pydantic_model(filter_, Optional[models.ContactsFilter]), + ) req = self.build_request_async( method="GET", @@ -625,6 +1015,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -699,24 +1090,104 @@ def update( self, *, id: str, - contact: Union[models.ContactInput, models.ContactInputTypedDict], + name: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + owner_id: OptionalNullable[str] = UNSET, + type_: OptionalNullable[models.ContactType] = UNSET, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + prefix: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + gender: OptionalNullable[models.ContactGender] = UNSET, + birthday: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + photo_url: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + fax: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + current_balance: OptionalNullable[float] = UNSET, + status: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + email_domain: OptionalNullable[str] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + opportunity_ids: Optional[List[str]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmContactsUpdateResponse: r"""Update contact Update contact :param id: ID of the record you are acting upon. - :param contact: + :param name: Full name of the contact. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param owner_id: The owner of the contact. + :param type: The type of the contact. + :param company_id: The company the contact is associated with. + :param company_name: The name of the company the contact is associated with. + :param lead_id: The lead the contact is associated with. + :param first_name: The first name of the contact. + :param middle_name: The middle name of the contact. + :param last_name: The last name of the contact. + :param prefix: The prefix of the contact. + :param suffix: The suffix of the contact. + :param title: The job title of the contact. + :param department: The department of the contact. + :param language: language code according to ISO 639-1. For the United States - EN + :param gender: The gender of the contact. + :param birthday: The birthday of the contact. + :param image: + :param photo_url: The URL of the photo of a person. + :param lead_source: The lead source of the contact. + :param fax: The fax number of the contact. + :param description: The description of the contact. + :param current_balance: The current balance of the contact. + :param status: The status of the contact. + :param active: The active status of the contact. + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param email_domain: + :param custom_fields: + :param tags: + :param opportunity_ids: The opportunity ids of the contact. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -730,7 +1201,54 @@ def update( id=id, service_id=service_id, raw=raw, - contact=utils.get_pydantic_model(contact, models.ContactInput), + contact=models.ContactInput( + name=name, + owner_id=owner_id, + type=type_, + company_id=company_id, + company_name=company_name, + lead_id=lead_id, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + prefix=prefix, + suffix=suffix, + title=title, + department=department, + language=language, + gender=gender, + birthday=birthday, + image=image, + photo_url=photo_url, + lead_source=lead_source, + fax=fax, + description=description, + current_balance=current_balance, + status=status, + active=active, + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + email_domain=email_domain, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + opportunity_ids=opportunity_ids, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -744,6 +1262,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -821,24 +1340,104 @@ async def update_async( self, *, id: str, - contact: Union[models.ContactInput, models.ContactInputTypedDict], + name: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + owner_id: OptionalNullable[str] = UNSET, + type_: OptionalNullable[models.ContactType] = UNSET, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + prefix: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + gender: OptionalNullable[models.ContactGender] = UNSET, + birthday: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + photo_url: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + fax: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + current_balance: OptionalNullable[float] = UNSET, + status: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + email_domain: OptionalNullable[str] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + opportunity_ids: Optional[List[str]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmContactsUpdateResponse: r"""Update contact Update contact :param id: ID of the record you are acting upon. - :param contact: + :param name: Full name of the contact. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param owner_id: The owner of the contact. + :param type: The type of the contact. + :param company_id: The company the contact is associated with. + :param company_name: The name of the company the contact is associated with. + :param lead_id: The lead the contact is associated with. + :param first_name: The first name of the contact. + :param middle_name: The middle name of the contact. + :param last_name: The last name of the contact. + :param prefix: The prefix of the contact. + :param suffix: The suffix of the contact. + :param title: The job title of the contact. + :param department: The department of the contact. + :param language: language code according to ISO 639-1. For the United States - EN + :param gender: The gender of the contact. + :param birthday: The birthday of the contact. + :param image: + :param photo_url: The URL of the photo of a person. + :param lead_source: The lead source of the contact. + :param fax: The fax number of the contact. + :param description: The description of the contact. + :param current_balance: The current balance of the contact. + :param status: The status of the contact. + :param active: The active status of the contact. + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param email_domain: + :param custom_fields: + :param tags: + :param opportunity_ids: The opportunity ids of the contact. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -852,7 +1451,54 @@ async def update_async( id=id, service_id=service_id, raw=raw, - contact=utils.get_pydantic_model(contact, models.ContactInput), + contact=models.ContactInput( + name=name, + owner_id=owner_id, + type=type_, + company_id=company_id, + company_name=company_name, + lead_id=lead_id, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + prefix=prefix, + suffix=suffix, + title=title, + department=department, + language=language, + gender=gender, + birthday=birthday, + image=image, + photo_url=photo_url, + lead_source=lead_source, + fax=fax, + description=description, + current_balance=current_balance, + status=status, + active=active, + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + email_domain=email_domain, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + opportunity_ids=opportunity_ids, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -866,6 +1512,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -948,6 +1595,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmContactsDeleteResponse: r"""Delete contact @@ -959,6 +1607,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -985,6 +1634,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1064,6 +1714,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmContactsDeleteResponse: r"""Delete contact @@ -1075,6 +1726,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1101,6 +1753,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmContactsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/createcallback.py b/src/apideck_unify/createcallback.py index 5f5f2840..2f5e7a30 100644 --- a/src/apideck_unify/createcallback.py +++ b/src/apideck_unify/createcallback.py @@ -5,7 +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 typing import Any, Optional, Union +from typing import Any, Mapping, Optional class CreateCallback(BaseSDK): @@ -14,12 +14,11 @@ def state( *, service_id: str, unified_api: str, - create_callback_state: Union[ - models.CreateCallbackState, models.CreateCallbackStateTypedDict - ], + redirect_uri: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultCreateCallbackStateResponse: r"""Create Callback State @@ -28,10 +27,11 @@ def state( :param service_id: Service ID of the resource to return :param unified_api: Unified API - :param create_callback_state: Callback state data + :param redirect_uri: The redirect URI to be used after the connection is created. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -44,8 +44,8 @@ def state( request = models.VaultCreateCallbackStateRequest( service_id=service_id, unified_api=unified_api, - create_callback_state=utils.get_pydantic_model( - create_callback_state, models.CreateCallbackState + create_callback_state=models.CreateCallbackState( + redirect_uri=redirect_uri, ), ) @@ -60,6 +60,7 @@ def state( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultCreateCallbackStateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -144,12 +145,11 @@ async def state_async( *, service_id: str, unified_api: str, - create_callback_state: Union[ - models.CreateCallbackState, models.CreateCallbackStateTypedDict - ], + redirect_uri: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultCreateCallbackStateResponse: r"""Create Callback State @@ -158,10 +158,11 @@ async def state_async( :param service_id: Service ID of the resource to return :param unified_api: Unified API - :param create_callback_state: Callback state data + :param redirect_uri: The redirect URI to be used after the connection is created. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -174,8 +175,8 @@ async def state_async( request = models.VaultCreateCallbackStateRequest( service_id=service_id, unified_api=unified_api, - create_callback_state=utils.get_pydantic_model( - create_callback_state, models.CreateCallbackState + create_callback_state=models.CreateCallbackState( + redirect_uri=redirect_uri, ), ) @@ -190,6 +191,7 @@ async def state_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultCreateCallbackStateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/creditnotes.py b/src/apideck_unify/creditnotes.py index 5bd23ce1..b143dd9b 100644 --- a/src/apideck_unify/creditnotes.py +++ b/src/apideck_unify/creditnotes.py @@ -3,31 +3,50 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class CreditNotes(BaseSDK): def list( self, *, - request: Union[ - models.AccountingCreditNotesAllRequest, - models.AccountingCreditNotesAllRequestTypedDict, - ] = models.AccountingCreditNotesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.CreditNotesFilter, models.CreditNotesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.CreditNotesSort, models.CreditNotesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingCreditNotesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingCreditNotesAllResponse]: r"""List Credit Notes List Credit Notes - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +56,18 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingCreditNotesAllRequest) - request = cast(models.AccountingCreditNotesAllRequest, request) + request = models.AccountingCreditNotesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.CreditNotesFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.CreditNotesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +80,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +114,34 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingCreditNotesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCreditNotesResponse) + return models.AccountingCreditNotesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetCreditNotesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +165,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingCreditNotesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +184,39 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingCreditNotesAllRequest, - models.AccountingCreditNotesAllRequestTypedDict, - ] = models.AccountingCreditNotesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.CreditNotesFilter, models.CreditNotesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.CreditNotesSort, models.CreditNotesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingCreditNotesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingCreditNotesAllResponse]: r"""List Credit Notes List Credit Notes - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +226,18 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingCreditNotesAllRequest) - request = cast(models.AccountingCreditNotesAllRequest, request) + request = models.AccountingCreditNotesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.CreditNotesFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.CreditNotesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +250,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +284,34 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingCreditNotesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCreditNotesResponse) + return models.AccountingCreditNotesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetCreditNotesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +335,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingCreditNotesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +354,106 @@ async def list_async( def create( self, *, - credit_note: Union[models.CreditNoteInput, models.CreditNoteInputTypedDict], + total_amount: float, raw: Optional[bool] = False, service_id: Optional[str] = None, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + balance: OptionalNullable[float] = UNSET, + remaining_credit: OptionalNullable[float] = UNSET, + status: Optional[models.CreditNoteStatus] = None, + reference: OptionalNullable[str] = UNSET, + date_issued: Optional[datetime] = None, + date_paid: OptionalNullable[datetime] = UNSET, + type_: Optional[models.CreditNoteType] = None, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + allocations: Optional[ + Union[List[models.AllocationInput], List[models.AllocationInputTypedDict]] + ] = None, + note: OptionalNullable[str] = UNSET, + terms: OptionalNullable[str] = UNSET, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCreditNotesAddResponse: r"""Create Credit Note Create Credit Note - :param credit_note: + :param total_amount: Amount of transaction :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param number: Credit note number. + :param customer: The customer this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param balance: The balance reflecting any payments made against the transaction. + :param remaining_credit: Indicates the total credit amount still available to apply towards the payment. + :param status: Status of credit notes + :param reference: Optional reference message ie: Debit remittance detail. + :param date_issued: Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD + :param date_paid: Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD + :param type: Type of payment + :param account: + :param line_items: + :param allocations: + :param note: Optional note to be associated with the credit note. + :param terms: Optional terms to be associated with the credit note. + :param billing_address: + :param shipping_address: + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +466,55 @@ def create( request = models.AccountingCreditNotesAddRequest( raw=raw, service_id=service_id, - credit_note=utils.get_pydantic_model(credit_note, models.CreditNoteInput), + credit_note=models.CreditNoteInput( + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + company_id=company_id, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_amount=total_amount, + total_tax=total_tax, + tax_code=tax_code, + balance=balance, + remaining_credit=remaining_credit, + status=status, + reference=reference, + date_issued=date_issued, + date_paid=date_paid, + type=type_, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.AllocationInput]] + ), + note=note, + terms=terms, + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +528,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +605,106 @@ def create( async def create_async( self, *, - credit_note: Union[models.CreditNoteInput, models.CreditNoteInputTypedDict], + total_amount: float, raw: Optional[bool] = False, service_id: Optional[str] = None, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + balance: OptionalNullable[float] = UNSET, + remaining_credit: OptionalNullable[float] = UNSET, + status: Optional[models.CreditNoteStatus] = None, + reference: OptionalNullable[str] = UNSET, + date_issued: Optional[datetime] = None, + date_paid: OptionalNullable[datetime] = UNSET, + type_: Optional[models.CreditNoteType] = None, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + allocations: Optional[ + Union[List[models.AllocationInput], List[models.AllocationInputTypedDict]] + ] = None, + note: OptionalNullable[str] = UNSET, + terms: OptionalNullable[str] = UNSET, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCreditNotesAddResponse: r"""Create Credit Note Create Credit Note - :param credit_note: + :param total_amount: Amount of transaction :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param number: Credit note number. + :param customer: The customer this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param balance: The balance reflecting any payments made against the transaction. + :param remaining_credit: Indicates the total credit amount still available to apply towards the payment. + :param status: Status of credit notes + :param reference: Optional reference message ie: Debit remittance detail. + :param date_issued: Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD + :param date_paid: Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD + :param type: Type of payment + :param account: + :param line_items: + :param allocations: + :param note: Optional note to be associated with the credit note. + :param terms: Optional terms to be associated with the credit note. + :param billing_address: + :param shipping_address: + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +717,55 @@ async def create_async( request = models.AccountingCreditNotesAddRequest( raw=raw, service_id=service_id, - credit_note=utils.get_pydantic_model(credit_note, models.CreditNoteInput), + credit_note=models.CreditNoteInput( + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + company_id=company_id, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_amount=total_amount, + total_tax=total_tax, + tax_code=tax_code, + balance=balance, + remaining_credit=remaining_credit, + status=status, + reference=reference, + date_issued=date_issued, + date_paid=date_paid, + type=type_, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.AllocationInput]] + ), + note=note, + terms=terms, + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +779,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +863,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCreditNotesOneResponse: r"""Get Credit Note @@ -495,6 +876,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +904,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +985,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCreditNotesOneResponse: r"""Get Credit Note @@ -614,6 +998,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +1026,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +1101,107 @@ def update( self, *, id: str, - credit_note: Union[models.CreditNoteInput, models.CreditNoteInputTypedDict], + total_amount: float, service_id: Optional[str] = None, raw: Optional[bool] = False, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + balance: OptionalNullable[float] = UNSET, + remaining_credit: OptionalNullable[float] = UNSET, + status: Optional[models.CreditNoteStatus] = None, + reference: OptionalNullable[str] = UNSET, + date_issued: Optional[datetime] = None, + date_paid: OptionalNullable[datetime] = UNSET, + type_: Optional[models.CreditNoteType] = None, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + allocations: Optional[ + Union[List[models.AllocationInput], List[models.AllocationInputTypedDict]] + ] = None, + note: OptionalNullable[str] = UNSET, + terms: OptionalNullable[str] = UNSET, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCreditNotesUpdateResponse: r"""Update Credit Note Update Credit Note :param id: ID of the record you are acting upon. - :param credit_note: + :param total_amount: Amount of transaction :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param number: Credit note number. + :param customer: The customer this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param balance: The balance reflecting any payments made against the transaction. + :param remaining_credit: Indicates the total credit amount still available to apply towards the payment. + :param status: Status of credit notes + :param reference: Optional reference message ie: Debit remittance detail. + :param date_issued: Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD + :param date_paid: Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD + :param type: Type of payment + :param account: + :param line_items: + :param allocations: + :param note: Optional note to be associated with the credit note. + :param terms: Optional terms to be associated with the credit note. + :param billing_address: + :param shipping_address: + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +1215,55 @@ def update( id=id, service_id=service_id, raw=raw, - credit_note=utils.get_pydantic_model(credit_note, models.CreditNoteInput), + credit_note=models.CreditNoteInput( + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + company_id=company_id, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_amount=total_amount, + total_tax=total_tax, + tax_code=tax_code, + balance=balance, + remaining_credit=remaining_credit, + status=status, + reference=reference, + date_issued=date_issued, + date_paid=date_paid, + type=type_, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.AllocationInput]] + ), + note=note, + terms=terms, + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +1277,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +1355,107 @@ async def update_async( self, *, id: str, - credit_note: Union[models.CreditNoteInput, models.CreditNoteInputTypedDict], + total_amount: float, service_id: Optional[str] = None, raw: Optional[bool] = False, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + balance: OptionalNullable[float] = UNSET, + remaining_credit: OptionalNullable[float] = UNSET, + status: Optional[models.CreditNoteStatus] = None, + reference: OptionalNullable[str] = UNSET, + date_issued: Optional[datetime] = None, + date_paid: OptionalNullable[datetime] = UNSET, + type_: Optional[models.CreditNoteType] = None, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + allocations: Optional[ + Union[List[models.AllocationInput], List[models.AllocationInputTypedDict]] + ] = None, + note: OptionalNullable[str] = UNSET, + terms: OptionalNullable[str] = UNSET, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCreditNotesUpdateResponse: r"""Update Credit Note Update Credit Note :param id: ID of the record you are acting upon. - :param credit_note: + :param total_amount: Amount of transaction :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param number: Credit note number. + :param customer: The customer this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param balance: The balance reflecting any payments made against the transaction. + :param remaining_credit: Indicates the total credit amount still available to apply towards the payment. + :param status: Status of credit notes + :param reference: Optional reference message ie: Debit remittance detail. + :param date_issued: Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD + :param date_paid: Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD + :param type: Type of payment + :param account: + :param line_items: + :param allocations: + :param note: Optional note to be associated with the credit note. + :param terms: Optional terms to be associated with the credit note. + :param billing_address: + :param shipping_address: + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1469,55 @@ async def update_async( id=id, service_id=service_id, raw=raw, - credit_note=utils.get_pydantic_model(credit_note, models.CreditNoteInput), + credit_note=models.CreditNoteInput( + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + company_id=company_id, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_amount=total_amount, + total_tax=total_tax, + tax_code=tax_code, + balance=balance, + remaining_credit=remaining_credit, + status=status, + reference=reference, + date_issued=date_issued, + date_paid=date_paid, + type=type_, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.AllocationInput]] + ), + note=note, + terms=terms, + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1531,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1614,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCreditNotesDeleteResponse: r"""Delete Credit Note @@ -975,6 +1626,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1653,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1733,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCreditNotesDeleteResponse: r"""Delete Credit Note @@ -1091,6 +1745,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1772,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCreditNotesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/customers.py b/src/apideck_unify/customers.py index a99ecd2c..19b5c1ff 100644 --- a/src/apideck_unify/customers.py +++ b/src/apideck_unify/customers.py @@ -3,31 +3,49 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Customers(BaseSDK): def list( self, *, - request: Union[ - models.AccountingCustomersAllRequest, - models.AccountingCustomersAllRequestTypedDict, - ] = models.AccountingCustomersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.CustomersFilter, models.CustomersFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.CustomersSort, models.CustomersSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingCustomersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingCustomersAllResponse]: r"""List Customers List Customers - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +55,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingCustomersAllRequest) - request = cast(models.AccountingCustomersAllRequest, request) + request = models.AccountingCustomersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.CustomersFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.CustomersSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +77,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +111,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingCustomersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCustomersResponse) + return models.AccountingCustomersAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetCustomersResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +160,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingCustomersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +179,39 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingCustomersAllRequest, - models.AccountingCustomersAllRequestTypedDict, - ] = models.AccountingCustomersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.CustomersFilter, models.CustomersFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.CustomersSort, models.CustomersSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingCustomersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingCustomersAllResponse]: r"""List Customers List Customers - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +221,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingCustomersAllRequest) - request = cast(models.AccountingCustomersAllRequest, request) + request = models.AccountingCustomersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.CustomersFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.CustomersSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +243,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +277,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingCustomersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetCustomersResponse) + return models.AccountingCustomersAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetCustomersResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +326,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingCustomersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +345,96 @@ async def list_async( def create( self, *, - customer: Union[models.CustomerInput, models.CustomerInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + display_id: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + individual: OptionalNullable[bool] = UNSET, + project: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + notes: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + tax_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + parent: OptionalNullable[ + Union[models.LinkedParentCustomer, models.LinkedParentCustomerTypedDict] + ] = UNSET, + status: OptionalNullable[models.CustomerStatusStatus] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCustomersAddResponse: r"""Create Customer Create Customer - :param customer: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_id: Display ID + :param display_name: Display name + :param company_name: The name of the company. + :param company_id: The company or subsidiary id the transaction belongs to + :param title: The job title of the person. + :param first_name: The first name of the person. + :param middle_name: Middle name of the person. + :param last_name: The last name of the person. + :param suffix: + :param individual: Is this an individual or business customer + :param project: If true, indicates this is a Project. + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param bank_accounts: + :param notes: Some notes about this customer + :param tax_rate: + :param tax_number: + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param account: + :param parent: The parent customer this entity is linked to. + :param status: Customer status + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +447,51 @@ def create( request = models.AccountingCustomersAddRequest( raw=raw, service_id=service_id, - customer=utils.get_pydantic_model(customer, models.CustomerInput), + customer=models.CustomerInput( + display_id=display_id, + display_name=display_name, + company_name=company_name, + company_id=company_id, + title=title, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + suffix=suffix, + individual=individual, + project=project, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + notes=notes, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + tax_number=tax_number, + currency=currency, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + parent=utils.get_pydantic_model( + parent, OptionalNullable[models.LinkedParentCustomer] + ), + status=status, + payment_method=payment_method, + channel=channel, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +505,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +582,96 @@ def create( async def create_async( self, *, - customer: Union[models.CustomerInput, models.CustomerInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + display_id: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + individual: OptionalNullable[bool] = UNSET, + project: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + notes: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + tax_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + parent: OptionalNullable[ + Union[models.LinkedParentCustomer, models.LinkedParentCustomerTypedDict] + ] = UNSET, + status: OptionalNullable[models.CustomerStatusStatus] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCustomersAddResponse: r"""Create Customer Create Customer - :param customer: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_id: Display ID + :param display_name: Display name + :param company_name: The name of the company. + :param company_id: The company or subsidiary id the transaction belongs to + :param title: The job title of the person. + :param first_name: The first name of the person. + :param middle_name: Middle name of the person. + :param last_name: The last name of the person. + :param suffix: + :param individual: Is this an individual or business customer + :param project: If true, indicates this is a Project. + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param bank_accounts: + :param notes: Some notes about this customer + :param tax_rate: + :param tax_number: + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param account: + :param parent: The parent customer this entity is linked to. + :param status: Customer status + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +684,51 @@ async def create_async( request = models.AccountingCustomersAddRequest( raw=raw, service_id=service_id, - customer=utils.get_pydantic_model(customer, models.CustomerInput), + customer=models.CustomerInput( + display_id=display_id, + display_name=display_name, + company_name=company_name, + company_id=company_id, + title=title, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + suffix=suffix, + individual=individual, + project=project, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + notes=notes, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + tax_number=tax_number, + currency=currency, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + parent=utils.get_pydantic_model( + parent, OptionalNullable[models.LinkedParentCustomer] + ), + status=status, + payment_method=payment_method, + channel=channel, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +742,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +826,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCustomersOneResponse: r"""Get Customer @@ -495,6 +839,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +867,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +948,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCustomersOneResponse: r"""Get Customer @@ -614,6 +961,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +989,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +1064,97 @@ def update( self, *, id: str, - customer: Union[models.CustomerInput, models.CustomerInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + display_id: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + individual: OptionalNullable[bool] = UNSET, + project: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + notes: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + tax_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + parent: OptionalNullable[ + Union[models.LinkedParentCustomer, models.LinkedParentCustomerTypedDict] + ] = UNSET, + status: OptionalNullable[models.CustomerStatusStatus] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCustomersUpdateResponse: r"""Update Customer Update Customer :param id: ID of the record you are acting upon. - :param customer: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_id: Display ID + :param display_name: Display name + :param company_name: The name of the company. + :param company_id: The company or subsidiary id the transaction belongs to + :param title: The job title of the person. + :param first_name: The first name of the person. + :param middle_name: Middle name of the person. + :param last_name: The last name of the person. + :param suffix: + :param individual: Is this an individual or business customer + :param project: If true, indicates this is a Project. + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param bank_accounts: + :param notes: Some notes about this customer + :param tax_rate: + :param tax_number: + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param account: + :param parent: The parent customer this entity is linked to. + :param status: Customer status + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +1168,51 @@ def update( id=id, service_id=service_id, raw=raw, - customer=utils.get_pydantic_model(customer, models.CustomerInput), + customer=models.CustomerInput( + display_id=display_id, + display_name=display_name, + company_name=company_name, + company_id=company_id, + title=title, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + suffix=suffix, + individual=individual, + project=project, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + notes=notes, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + tax_number=tax_number, + currency=currency, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + parent=utils.get_pydantic_model( + parent, OptionalNullable[models.LinkedParentCustomer] + ), + status=status, + payment_method=payment_method, + channel=channel, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +1226,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +1304,97 @@ async def update_async( self, *, id: str, - customer: Union[models.CustomerInput, models.CustomerInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + display_id: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + individual: OptionalNullable[bool] = UNSET, + project: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + notes: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + tax_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + parent: OptionalNullable[ + Union[models.LinkedParentCustomer, models.LinkedParentCustomerTypedDict] + ] = UNSET, + status: OptionalNullable[models.CustomerStatusStatus] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCustomersUpdateResponse: r"""Update Customer Update Customer :param id: ID of the record you are acting upon. - :param customer: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_id: Display ID + :param display_name: Display name + :param company_name: The name of the company. + :param company_id: The company or subsidiary id the transaction belongs to + :param title: The job title of the person. + :param first_name: The first name of the person. + :param middle_name: Middle name of the person. + :param last_name: The last name of the person. + :param suffix: + :param individual: Is this an individual or business customer + :param project: If true, indicates this is a Project. + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param bank_accounts: + :param notes: Some notes about this customer + :param tax_rate: + :param tax_number: + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param account: + :param parent: The parent customer this entity is linked to. + :param status: Customer status + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1408,51 @@ async def update_async( id=id, service_id=service_id, raw=raw, - customer=utils.get_pydantic_model(customer, models.CustomerInput), + customer=models.CustomerInput( + display_id=display_id, + display_name=display_name, + company_name=company_name, + company_id=company_id, + title=title, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + suffix=suffix, + individual=individual, + project=project, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + notes=notes, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + tax_number=tax_number, + currency=currency, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + parent=utils.get_pydantic_model( + parent, OptionalNullable[models.LinkedParentCustomer] + ), + status=status, + payment_method=payment_method, + channel=channel, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1466,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1549,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCustomersDeleteResponse: r"""Delete Customer @@ -975,6 +1561,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1588,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1668,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingCustomersDeleteResponse: r"""Delete Customer @@ -1091,6 +1680,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1707,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingCustomersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/customfields.py b/src/apideck_unify/customfields.py index 77a3100a..4a80d494 100644 --- a/src/apideck_unify/customfields.py +++ b/src/apideck_unify/customfields.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class CustomFields(BaseSDK): @@ -19,6 +19,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultCustomFieldsAllResponse: r"""Get resource custom fields @@ -32,6 +33,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -59,6 +61,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultCustomFieldsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -139,6 +142,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultCustomFieldsAllResponse: r"""Get resource custom fields @@ -152,6 +156,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -179,6 +184,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultCustomFieldsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/custommappings_sdk.py b/src/apideck_unify/custommappings_sdk.py index 3f05a13a..997a3393 100644 --- a/src/apideck_unify/custommappings_sdk.py +++ b/src/apideck_unify/custommappings_sdk.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class CustomMappingsSDK(BaseSDK): @@ -17,6 +17,7 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultCustomMappingsAllResponse: r"""List custom mappings @@ -27,6 +28,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -52,6 +54,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultCustomMappingsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -130,6 +133,7 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultCustomMappingsAllResponse: r"""List custom mappings @@ -140,6 +144,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -165,6 +170,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultCustomMappingsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/departments.py b/src/apideck_unify/departments.py index e1d2fd05..7656aca4 100644 --- a/src/apideck_unify/departments.py +++ b/src/apideck_unify/departments.py @@ -3,31 +3,46 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Departments(BaseSDK): def list( self, *, - request: Union[ - models.AccountingDepartmentsAllRequest, - models.AccountingDepartmentsAllRequestTypedDict, - ] = models.AccountingDepartmentsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[ + models.AccountingDepartmentsFilter, + models.AccountingDepartmentsFilterTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingDepartmentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingDepartmentsAllResponse]: r"""List Departments List Departments - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. + :param filter_: Apply filters :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +52,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingDepartmentsAllRequest) - request = cast(models.AccountingDepartmentsAllRequest, request) + request = models.AccountingDepartmentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + filter_=utils.get_pydantic_model( + filter_, Optional[models.AccountingDepartmentsFilter] + ), + ) req = self.build_request( method="GET", @@ -52,6 +74,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,10 +108,31 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingDepartmentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetAccountingDepartmentsResponse + return models.AccountingDepartmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetAccountingDepartmentsResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -113,7 +157,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingDepartmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +176,36 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingDepartmentsAllRequest, - models.AccountingDepartmentsAllRequestTypedDict, - ] = models.AccountingDepartmentsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[ + models.AccountingDepartmentsFilter, + models.AccountingDepartmentsFilterTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingDepartmentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingDepartmentsAllResponse]: r"""List Departments List Departments - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. + :param filter_: Apply filters :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,9 +215,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingDepartmentsAllRequest) - request = cast(models.AccountingDepartmentsAllRequest, request) + request = models.AccountingDepartmentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + filter_=utils.get_pydantic_model( + filter_, Optional[models.AccountingDepartmentsFilter] + ), + ) req = self.build_request_async( method="GET", @@ -167,6 +237,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -200,10 +271,31 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingDepartmentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetAccountingDepartmentsResponse + return models.AccountingDepartmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetAccountingDepartmentsResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -228,7 +320,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingDepartmentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -242,25 +339,42 @@ async def list_async( def create( self, *, - accounting_department: Union[ - models.AccountingDepartmentInput, models.AccountingDepartmentInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + status: Optional[models.DepartmentStatus] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiaryReferenceInput], + List[models.SubsidiaryReferenceInputTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingDepartmentsAddResponse: r"""Create Department Create Department - :param accounting_department: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: A unique identifier for an object. + :param name: The name of the department. + :param status: Based on the status some functionality is enabled or disabled. + :param subsidiaries: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -273,8 +387,17 @@ def create( request = models.AccountingDepartmentsAddRequest( raw=raw, service_id=service_id, - accounting_department=utils.get_pydantic_model( - accounting_department, models.AccountingDepartmentInput + accounting_department=models.AccountingDepartmentInput( + parent_id=parent_id, + name=name, + status=status, + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiaryReferenceInput]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -289,6 +412,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -371,25 +495,42 @@ def create( async def create_async( self, *, - accounting_department: Union[ - models.AccountingDepartmentInput, models.AccountingDepartmentInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + status: Optional[models.DepartmentStatus] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiaryReferenceInput], + List[models.SubsidiaryReferenceInputTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingDepartmentsAddResponse: r"""Create Department Create Department - :param accounting_department: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: A unique identifier for an object. + :param name: The name of the department. + :param status: Based on the status some functionality is enabled or disabled. + :param subsidiaries: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -402,8 +543,17 @@ async def create_async( request = models.AccountingDepartmentsAddRequest( raw=raw, service_id=service_id, - accounting_department=utils.get_pydantic_model( - accounting_department, models.AccountingDepartmentInput + accounting_department=models.AccountingDepartmentInput( + parent_id=parent_id, + name=name, + status=status, + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiaryReferenceInput]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -418,6 +568,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -507,6 +658,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingDepartmentsOneResponse: r"""Get Department @@ -519,6 +671,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -546,6 +699,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -628,6 +782,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingDepartmentsOneResponse: r"""Get Department @@ -640,6 +795,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -667,6 +823,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -743,26 +900,43 @@ def update( self, *, id: str, - accounting_department: Union[ - models.AccountingDepartmentInput, models.AccountingDepartmentInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + status: Optional[models.DepartmentStatus] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiaryReferenceInput], + List[models.SubsidiaryReferenceInputTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingDepartmentsUpdateResponse: r"""Update Department Update Department :param id: ID of the record you are acting upon. - :param accounting_department: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: A unique identifier for an object. + :param name: The name of the department. + :param status: Based on the status some functionality is enabled or disabled. + :param subsidiaries: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -776,8 +950,17 @@ def update( id=id, service_id=service_id, raw=raw, - accounting_department=utils.get_pydantic_model( - accounting_department, models.AccountingDepartmentInput + accounting_department=models.AccountingDepartmentInput( + parent_id=parent_id, + name=name, + status=status, + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiaryReferenceInput]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -792,6 +975,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -875,26 +1059,43 @@ async def update_async( self, *, id: str, - accounting_department: Union[ - models.AccountingDepartmentInput, models.AccountingDepartmentInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + status: Optional[models.DepartmentStatus] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiaryReferenceInput], + List[models.SubsidiaryReferenceInputTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingDepartmentsUpdateResponse: r"""Update Department Update Department :param id: ID of the record you are acting upon. - :param accounting_department: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: A unique identifier for an object. + :param name: The name of the department. + :param status: Based on the status some functionality is enabled or disabled. + :param subsidiaries: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -908,8 +1109,17 @@ async def update_async( id=id, service_id=service_id, raw=raw, - accounting_department=utils.get_pydantic_model( - accounting_department, models.AccountingDepartmentInput + accounting_department=models.AccountingDepartmentInput( + parent_id=parent_id, + name=name, + status=status, + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiaryReferenceInput]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -924,6 +1134,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1012,6 +1223,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingDepartmentsDeleteResponse: r"""Delete Department @@ -1023,6 +1235,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1049,6 +1262,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1130,6 +1344,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingDepartmentsDeleteResponse: r"""Delete Department @@ -1141,6 +1356,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1167,6 +1383,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingDepartmentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/drivegroups.py b/src/apideck_unify/drivegroups.py index 7958542a..c06c651a 100644 --- a/src/apideck_unify/drivegroups.py +++ b/src/apideck_unify/drivegroups.py @@ -3,31 +3,45 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class DriveGroups(BaseSDK): def list( self, *, - request: Union[ - models.FileStorageDriveGroupsAllRequest, - models.FileStorageDriveGroupsAllRequestTypedDict, - ] = models.FileStorageDriveGroupsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.DriveGroupsFilter, models.DriveGroupsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.FileStorageDriveGroupsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.FileStorageDriveGroupsAllResponse]: r"""List DriveGroups List DriveGroups - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +51,17 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageDriveGroupsAllRequest) - request = cast(models.FileStorageDriveGroupsAllRequest, request) + request = models.FileStorageDriveGroupsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.DriveGroupsFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +74,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +108,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.FileStorageDriveGroupsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetDriveGroupsResponse) + return models.FileStorageDriveGroupsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetDriveGroupsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +158,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.FileStorageDriveGroupsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +177,35 @@ def list( async def list_async( self, *, - request: Union[ - models.FileStorageDriveGroupsAllRequest, - models.FileStorageDriveGroupsAllRequestTypedDict, - ] = models.FileStorageDriveGroupsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.DriveGroupsFilter, models.DriveGroupsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.FileStorageDriveGroupsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.FileStorageDriveGroupsAllResponse]: r"""List DriveGroups List DriveGroups - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +215,17 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageDriveGroupsAllRequest) - request = cast(models.FileStorageDriveGroupsAllRequest, request) + request = models.FileStorageDriveGroupsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.DriveGroupsFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +238,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +272,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.FileStorageDriveGroupsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetDriveGroupsResponse) + return models.FileStorageDriveGroupsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetDriveGroupsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +322,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.FileStorageDriveGroupsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +341,33 @@ async def list_async( def create( self, *, - drive_group: Union[models.DriveGroupInput, models.DriveGroupInputTypedDict], + name: str, raw: Optional[bool] = False, service_id: Optional[str] = None, + display_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDriveGroupsAddResponse: r"""Create DriveGroup Create DriveGroup - :param drive_group: + :param name: The name of the drive group :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_name: The display name of the drive group + :param description: A description of the object. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +380,14 @@ def create( request = models.FileStorageDriveGroupsAddRequest( raw=raw, service_id=service_id, - drive_group=utils.get_pydantic_model(drive_group, models.DriveGroupInput), + drive_group=models.DriveGroupInput( + name=name, + display_name=display_name, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +401,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +478,33 @@ def create( async def create_async( self, *, - drive_group: Union[models.DriveGroupInput, models.DriveGroupInputTypedDict], + name: str, raw: Optional[bool] = False, service_id: Optional[str] = None, + display_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDriveGroupsAddResponse: r"""Create DriveGroup Create DriveGroup - :param drive_group: + :param name: The name of the drive group :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_name: The display name of the drive group + :param description: A description of the object. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +517,14 @@ async def create_async( request = models.FileStorageDriveGroupsAddRequest( raw=raw, service_id=service_id, - drive_group=utils.get_pydantic_model(drive_group, models.DriveGroupInput), + drive_group=models.DriveGroupInput( + name=name, + display_name=display_name, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +538,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +622,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDriveGroupsOneResponse: r"""Get DriveGroup @@ -495,6 +635,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +663,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +744,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDriveGroupsOneResponse: r"""Get DriveGroup @@ -614,6 +757,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +785,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +860,34 @@ def update( self, *, id: str, - drive_group: Union[models.DriveGroupInput, models.DriveGroupInputTypedDict], + name: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + display_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDriveGroupsUpdateResponse: r"""Update DriveGroup Update DriveGroup :param id: ID of the record you are acting upon. - :param drive_group: + :param name: The name of the drive group :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_name: The display name of the drive group + :param description: A description of the object. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +901,14 @@ def update( id=id, service_id=service_id, raw=raw, - drive_group=utils.get_pydantic_model(drive_group, models.DriveGroupInput), + drive_group=models.DriveGroupInput( + name=name, + display_name=display_name, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +922,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +1000,34 @@ async def update_async( self, *, id: str, - drive_group: Union[models.DriveGroupInput, models.DriveGroupInputTypedDict], + name: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + display_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDriveGroupsUpdateResponse: r"""Update DriveGroup Update DriveGroup :param id: ID of the record you are acting upon. - :param drive_group: + :param name: The name of the drive group :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_name: The display name of the drive group + :param description: A description of the object. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1041,14 @@ async def update_async( id=id, service_id=service_id, raw=raw, - drive_group=utils.get_pydantic_model(drive_group, models.DriveGroupInput), + drive_group=models.DriveGroupInput( + name=name, + display_name=display_name, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1062,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1145,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDriveGroupsDeleteResponse: r"""Delete DriveGroup @@ -975,6 +1157,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1184,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1264,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDriveGroupsDeleteResponse: r"""Delete DriveGroup @@ -1091,6 +1276,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1303,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDriveGroupsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/drives.py b/src/apideck_unify/drives.py index c8e33261..aee74ab9 100644 --- a/src/apideck_unify/drives.py +++ b/src/apideck_unify/drives.py @@ -3,31 +3,43 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Drives(BaseSDK): def list( self, *, - request: Union[ - models.FileStorageDrivesAllRequest, - models.FileStorageDrivesAllRequestTypedDict, - ] = models.FileStorageDrivesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.DrivesFilter, models.DrivesFilterTypedDict] + ] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.FileStorageDrivesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.FileStorageDrivesAllResponse]: r"""List Drives List Drives - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +49,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageDrivesAllRequest) - request = cast(models.FileStorageDrivesAllRequest, request) + request = models.FileStorageDrivesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.DrivesFilter]), + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +69,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +103,30 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.FileStorageDrivesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetDrivesResponse) + return models.FileStorageDrivesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetDrivesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +150,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.FileStorageDrivesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +169,33 @@ def list( async def list_async( self, *, - request: Union[ - models.FileStorageDrivesAllRequest, - models.FileStorageDrivesAllRequestTypedDict, - ] = models.FileStorageDrivesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.DrivesFilter, models.DrivesFilterTypedDict] + ] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.FileStorageDrivesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.FileStorageDrivesAllResponse]: r"""List Drives List Drives - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +205,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageDrivesAllRequest) - request = cast(models.FileStorageDrivesAllRequest, request) + request = models.FileStorageDrivesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.DrivesFilter]), + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +225,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +259,30 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.FileStorageDrivesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetDrivesResponse) + return models.FileStorageDrivesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetDrivesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +306,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.FileStorageDrivesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +325,31 @@ async def list_async( def create( self, *, - drive: Union[models.DriveInput, models.DriveInputTypedDict], + name: str, raw: Optional[bool] = False, service_id: Optional[str] = None, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDrivesAddResponse: r"""Create Drive Create Drive - :param drive: + :param name: The name of the drive :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param description: A description of the object. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +362,13 @@ def create( request = models.FileStorageDrivesAddRequest( raw=raw, service_id=service_id, - drive=utils.get_pydantic_model(drive, models.DriveInput), + drive=models.DriveInput( + name=name, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +382,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +459,31 @@ def create( async def create_async( self, *, - drive: Union[models.DriveInput, models.DriveInputTypedDict], + name: str, raw: Optional[bool] = False, service_id: Optional[str] = None, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDrivesAddResponse: r"""Create Drive Create Drive - :param drive: + :param name: The name of the drive :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param description: A description of the object. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +496,13 @@ async def create_async( request = models.FileStorageDrivesAddRequest( raw=raw, service_id=service_id, - drive=utils.get_pydantic_model(drive, models.DriveInput), + drive=models.DriveInput( + name=name, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +516,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +600,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDrivesOneResponse: r"""Get Drive @@ -495,6 +613,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +641,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +722,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDrivesOneResponse: r"""Get Drive @@ -614,6 +735,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +763,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +838,32 @@ def update( self, *, id: str, - drive: Union[models.DriveInput, models.DriveInputTypedDict], + name: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDrivesUpdateResponse: r"""Update Drive Update Drive :param id: ID of the record you are acting upon. - :param drive: + :param name: The name of the drive :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param description: A description of the object. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +877,13 @@ def update( id=id, service_id=service_id, raw=raw, - drive=utils.get_pydantic_model(drive, models.DriveInput), + drive=models.DriveInput( + name=name, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +897,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +975,32 @@ async def update_async( self, *, id: str, - drive: Union[models.DriveInput, models.DriveInputTypedDict], + name: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + description: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDrivesUpdateResponse: r"""Update Drive Update Drive :param id: ID of the record you are acting upon. - :param drive: + :param name: The name of the drive :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param description: A description of the object. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1014,13 @@ async def update_async( id=id, service_id=service_id, raw=raw, - drive=utils.get_pydantic_model(drive, models.DriveInput), + drive=models.DriveInput( + name=name, + description=description, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1034,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1117,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDrivesDeleteResponse: r"""Delete Drive @@ -975,6 +1129,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1156,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1236,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageDrivesDeleteResponse: r"""Delete Drive @@ -1091,6 +1248,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1275,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageDrivesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/employeepayrolls.py b/src/apideck_unify/employeepayrolls.py index 13082ea7..d8c93e05 100644 --- a/src/apideck_unify/employeepayrolls.py +++ b/src/apideck_unify/employeepayrolls.py @@ -3,31 +3,42 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from typing import Any, Dict, Mapping, Optional, Union class EmployeePayrolls(BaseSDK): def list( self, *, - request: Union[ - models.HrisEmployeePayrollsAllRequest, - models.HrisEmployeePayrollsAllRequestTypedDict, - ], + employee_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.PayrollsFilter, models.PayrollsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeePayrollsAllResponse: r"""List Employee Payrolls List payrolls for employee - :param request: The request object to send. + :param employee_id: ID of the employee you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +48,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeePayrollsAllRequest) - request = cast(models.HrisEmployeePayrollsAllRequest, request) + request = models.HrisEmployeePayrollsAllRequest( + employee_id=employee_id, + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model(filter_, Optional[models.PayrollsFilter]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +68,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeePayrollsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -127,22 +144,33 @@ def list( async def list_async( self, *, - request: Union[ - models.HrisEmployeePayrollsAllRequest, - models.HrisEmployeePayrollsAllRequestTypedDict, - ], + employee_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.PayrollsFilter, models.PayrollsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeePayrollsAllResponse: r"""List Employee Payrolls List payrolls for employee - :param request: The request object to send. + :param employee_id: ID of the employee you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,9 +180,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeePayrollsAllRequest) - request = cast(models.HrisEmployeePayrollsAllRequest, request) + request = models.HrisEmployeePayrollsAllRequest( + employee_id=employee_id, + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model(filter_, Optional[models.PayrollsFilter]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -167,6 +200,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeePayrollsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -242,22 +276,29 @@ async def list_async( def get( self, *, - request: Union[ - models.HrisEmployeePayrollsOneRequest, - models.HrisEmployeePayrollsOneRequestTypedDict, - ], + payroll_id: str, + employee_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeePayrollsOneResponse: r"""Get Employee Payroll Get payroll for employee - :param request: The request object to send. + :param payroll_id: ID of the payroll you are acting upon. + :param employee_id: ID of the employee you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,9 +308,13 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeePayrollsOneRequest) - request = cast(models.HrisEmployeePayrollsOneRequest, request) + request = models.HrisEmployeePayrollsOneRequest( + payroll_id=payroll_id, + employee_id=employee_id, + raw=raw, + service_id=service_id, + fields=fields, + ) req = self.build_request( method="GET", @@ -282,6 +327,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeePayrollsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,22 +403,29 @@ def get( async def get_async( self, *, - request: Union[ - models.HrisEmployeePayrollsOneRequest, - models.HrisEmployeePayrollsOneRequestTypedDict, - ], + payroll_id: str, + employee_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeePayrollsOneResponse: r"""Get Employee Payroll Get payroll for employee - :param request: The request object to send. + :param payroll_id: ID of the payroll you are acting upon. + :param employee_id: ID of the employee you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -382,9 +435,13 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeePayrollsOneRequest) - request = cast(models.HrisEmployeePayrollsOneRequest, request) + request = models.HrisEmployeePayrollsOneRequest( + payroll_id=payroll_id, + employee_id=employee_id, + raw=raw, + service_id=service_id, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -397,6 +454,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeePayrollsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/employees.py b/src/apideck_unify/employees.py index b019a804..8d1b8621 100644 --- a/src/apideck_unify/employees.py +++ b/src/apideck_unify/employees.py @@ -3,30 +3,50 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Employees(BaseSDK): def list( self, *, - request: Union[ - models.HrisEmployeesAllRequest, models.HrisEmployeesAllRequestTypedDict - ] = models.HrisEmployeesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.EmployeesFilter, models.EmployeesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.EmployeesSort, models.EmployeesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.HrisEmployeesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.HrisEmployeesAllResponse]: r"""List Employees Apideck operates as a stateless Unified API, which means that the list endpoint only provides a portion of the employee model. This is due to the fact that most HRIS systems do not readily provide all data in every call. However, you can access the complete employee model through an employee detail call. - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +56,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeesAllRequest) - request = cast(models.HrisEmployeesAllRequest, request) + request = models.HrisEmployeesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.EmployeesFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.EmployeesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +78,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +112,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.HrisEmployeesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetEmployeesResponse) + return models.HrisEmployeesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetEmployeesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +161,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.HrisEmployeesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +180,39 @@ def list( async def list_async( self, *, - request: Union[ - models.HrisEmployeesAllRequest, models.HrisEmployeesAllRequestTypedDict - ] = models.HrisEmployeesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.EmployeesFilter, models.EmployeesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.EmployeesSort, models.EmployeesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.HrisEmployeesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.HrisEmployeesAllResponse]: r"""List Employees Apideck operates as a stateless Unified API, which means that the list endpoint only provides a portion of the employee model. This is due to the fact that most HRIS systems do not readily provide all data in every call. However, you can access the complete employee model through an employee detail call. - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +222,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeesAllRequest) - request = cast(models.HrisEmployeesAllRequest, request) + request = models.HrisEmployeesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.EmployeesFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.EmployeesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +244,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +278,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.HrisEmployeesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetEmployeesResponse) + return models.HrisEmployeesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetEmployeesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +327,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.HrisEmployeesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +346,170 @@ async def list_async( def create( self, *, - employee: Union[models.EmployeeInput, models.EmployeeInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + id: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + preferred_name: OptionalNullable[str] = UNSET, + initials: OptionalNullable[str] = UNSET, + salutation: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + marital_status: OptionalNullable[str] = UNSET, + partner: Optional[ + Union[models.PersonInput, models.PersonInputTypedDict] + ] = None, + division: OptionalNullable[str] = UNSET, + division_id: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + department_id: OptionalNullable[str] = UNSET, + department_name: OptionalNullable[str] = UNSET, + team: OptionalNullable[Union[models.Team, models.TeamTypedDict]] = UNSET, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + employment_start_date: OptionalNullable[str] = UNSET, + employment_end_date: OptionalNullable[str] = UNSET, + leaving_reason: OptionalNullable[models.LeavingReason] = UNSET, + employee_number: OptionalNullable[str] = UNSET, + employment_status: OptionalNullable[models.EmploymentStatus] = UNSET, + employment_role: Optional[ + Union[models.EmploymentRole, models.EmploymentRoleTypedDict] + ] = None, + ethnicity: OptionalNullable[str] = UNSET, + manager: Optional[Union[models.Manager, models.ManagerTypedDict]] = None, + direct_reports: OptionalNullable[List[str]] = UNSET, + social_security_number: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + deceased_on: OptionalNullable[date] = UNSET, + country_of_birth: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + gender: OptionalNullable[models.Gender] = UNSET, + pronouns: OptionalNullable[str] = UNSET, + preferred_language: OptionalNullable[str] = UNSET, + languages: Optional[List[str]] = None, + nationalities: Optional[List[str]] = None, + photo_url: OptionalNullable[str] = UNSET, + timezone: OptionalNullable[str] = UNSET, + source: OptionalNullable[str] = UNSET, + source_id: OptionalNullable[str] = UNSET, + record_url: OptionalNullable[str] = UNSET, + jobs: OptionalNullable[ + Union[List[models.EmployeeJobInput], List[models.EmployeeJobInputTypedDict]] + ] = UNSET, + compensations: OptionalNullable[ + Union[ + List[models.EmployeeCompensationInput], + List[models.EmployeeCompensationInputTypedDict], + ] + ] = UNSET, + works_remote: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + tax_code: OptionalNullable[str] = UNSET, + tax_id: OptionalNullable[str] = UNSET, + dietary_preference: OptionalNullable[str] = UNSET, + food_allergies: OptionalNullable[List[str]] = UNSET, + probation_period: Optional[ + Union[models.ProbationPeriod, models.ProbationPeriodTypedDict] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + row_version: OptionalNullable[str] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeesAddResponse: r"""Create Employee Create Employee - :param employee: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param id: A unique identifier for an object. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param middle_name: Middle name of the person. + :param display_name: The name used to display the employee, often a combination of their first and last names. + :param preferred_name: The name the employee prefers to be addressed by, which may be different from their legal name. + :param initials: The initials of the person, usually derived from their first, middle, and last names. + :param salutation: A formal salutation for the person. For example, 'Mr', 'Mrs' + :param title: The job title of the person. + :param marital_status: The marital status of the employee. + :param partner: + :param division: The division the person is currently in. Usually a collection of departments or teams or regions. + :param division_id: Unique identifier of the division this employee belongs to. + :param department: The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. + :param department_id: Unique identifier of the department ID this employee belongs to. + :param department_name: Name of the department this employee belongs to. + :param team: The team the person is currently in. + :param company_id: The unique identifier of the company. + :param company_name: The name of the company. + :param employment_start_date: A Start Date is the date that the employee started working at the company + :param employment_end_date: An End Date is the date that the employee ended working at the company + :param leaving_reason: The reason because the employment ended. + :param employee_number: An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. + :param employment_status: The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. + :param employment_role: + :param ethnicity: The ethnicity of the employee + :param manager: + :param direct_reports: Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. + :param social_security_number: A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. + :param birthday: The date of birth of the person. + :param deceased_on: The date the person deceased. + :param country_of_birth: Country code according to ISO 3166-1 alpha-2. + :param description: A description of the object. + :param gender: The gender represents the gender identity of a person. + :param pronouns: The preferred pronouns of the person. + :param preferred_language: language code according to ISO 639-1. For the United States - EN + :param languages: + :param nationalities: + :param photo_url: The URL of the photo of a person. + :param timezone: The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. + :param source: 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. + :param source_id: Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). + :param record_url: + :param jobs: + :param compensations: + :param works_remote: Indicates if the employee works from a remote location. + :param addresses: + :param phone_numbers: + :param emails: + :param custom_fields: + :param social_links: + :param bank_accounts: + :param tax_code: + :param tax_id: + :param dietary_preference: Indicate the employee's dietary preference. + :param food_allergies: Indicate the employee's food allergies. + :param probation_period: + :param tags: + :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. + :param deleted: Flag to indicate if the object is deleted. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +522,90 @@ def create( request = models.HrisEmployeesAddRequest( raw=raw, service_id=service_id, - employee=utils.get_pydantic_model(employee, models.EmployeeInput), + employee=models.EmployeeInput( + id=id, + first_name=first_name, + last_name=last_name, + middle_name=middle_name, + display_name=display_name, + preferred_name=preferred_name, + initials=initials, + salutation=salutation, + title=title, + marital_status=marital_status, + partner=utils.get_pydantic_model(partner, Optional[models.PersonInput]), + division=division, + division_id=division_id, + department=department, + department_id=department_id, + department_name=department_name, + team=utils.get_pydantic_model(team, OptionalNullable[models.Team]), + company_id=company_id, + company_name=company_name, + employment_start_date=employment_start_date, + employment_end_date=employment_end_date, + leaving_reason=leaving_reason, + employee_number=employee_number, + employment_status=employment_status, + employment_role=utils.get_pydantic_model( + employment_role, Optional[models.EmploymentRole] + ), + ethnicity=ethnicity, + manager=utils.get_pydantic_model(manager, Optional[models.Manager]), + direct_reports=direct_reports, + social_security_number=social_security_number, + birthday=birthday, + deceased_on=deceased_on, + country_of_birth=country_of_birth, + description=description, + gender=gender, + pronouns=pronouns, + preferred_language=preferred_language, + languages=languages, + nationalities=nationalities, + photo_url=photo_url, + timezone=timezone, + source=source, + source_id=source_id, + record_url=record_url, + jobs=utils.get_pydantic_model( + jobs, OptionalNullable[List[models.EmployeeJobInput]] + ), + compensations=utils.get_pydantic_model( + compensations, + OptionalNullable[List[models.EmployeeCompensationInput]], + ), + works_remote=works_remote, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + tax_code=tax_code, + tax_id=tax_id, + dietary_preference=dietary_preference, + food_allergies=food_allergies, + probation_period=utils.get_pydantic_model( + probation_period, Optional[models.ProbationPeriod] + ), + tags=tags, + row_version=row_version, + deleted=deleted, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +619,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +696,170 @@ def create( async def create_async( self, *, - employee: Union[models.EmployeeInput, models.EmployeeInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + id: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + preferred_name: OptionalNullable[str] = UNSET, + initials: OptionalNullable[str] = UNSET, + salutation: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + marital_status: OptionalNullable[str] = UNSET, + partner: Optional[ + Union[models.PersonInput, models.PersonInputTypedDict] + ] = None, + division: OptionalNullable[str] = UNSET, + division_id: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + department_id: OptionalNullable[str] = UNSET, + department_name: OptionalNullable[str] = UNSET, + team: OptionalNullable[Union[models.Team, models.TeamTypedDict]] = UNSET, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + employment_start_date: OptionalNullable[str] = UNSET, + employment_end_date: OptionalNullable[str] = UNSET, + leaving_reason: OptionalNullable[models.LeavingReason] = UNSET, + employee_number: OptionalNullable[str] = UNSET, + employment_status: OptionalNullable[models.EmploymentStatus] = UNSET, + employment_role: Optional[ + Union[models.EmploymentRole, models.EmploymentRoleTypedDict] + ] = None, + ethnicity: OptionalNullable[str] = UNSET, + manager: Optional[Union[models.Manager, models.ManagerTypedDict]] = None, + direct_reports: OptionalNullable[List[str]] = UNSET, + social_security_number: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + deceased_on: OptionalNullable[date] = UNSET, + country_of_birth: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + gender: OptionalNullable[models.Gender] = UNSET, + pronouns: OptionalNullable[str] = UNSET, + preferred_language: OptionalNullable[str] = UNSET, + languages: Optional[List[str]] = None, + nationalities: Optional[List[str]] = None, + photo_url: OptionalNullable[str] = UNSET, + timezone: OptionalNullable[str] = UNSET, + source: OptionalNullable[str] = UNSET, + source_id: OptionalNullable[str] = UNSET, + record_url: OptionalNullable[str] = UNSET, + jobs: OptionalNullable[ + Union[List[models.EmployeeJobInput], List[models.EmployeeJobInputTypedDict]] + ] = UNSET, + compensations: OptionalNullable[ + Union[ + List[models.EmployeeCompensationInput], + List[models.EmployeeCompensationInputTypedDict], + ] + ] = UNSET, + works_remote: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + tax_code: OptionalNullable[str] = UNSET, + tax_id: OptionalNullable[str] = UNSET, + dietary_preference: OptionalNullable[str] = UNSET, + food_allergies: OptionalNullable[List[str]] = UNSET, + probation_period: Optional[ + Union[models.ProbationPeriod, models.ProbationPeriodTypedDict] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + row_version: OptionalNullable[str] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeesAddResponse: r"""Create Employee Create Employee - :param employee: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param id: A unique identifier for an object. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param middle_name: Middle name of the person. + :param display_name: The name used to display the employee, often a combination of their first and last names. + :param preferred_name: The name the employee prefers to be addressed by, which may be different from their legal name. + :param initials: The initials of the person, usually derived from their first, middle, and last names. + :param salutation: A formal salutation for the person. For example, 'Mr', 'Mrs' + :param title: The job title of the person. + :param marital_status: The marital status of the employee. + :param partner: + :param division: The division the person is currently in. Usually a collection of departments or teams or regions. + :param division_id: Unique identifier of the division this employee belongs to. + :param department: The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. + :param department_id: Unique identifier of the department ID this employee belongs to. + :param department_name: Name of the department this employee belongs to. + :param team: The team the person is currently in. + :param company_id: The unique identifier of the company. + :param company_name: The name of the company. + :param employment_start_date: A Start Date is the date that the employee started working at the company + :param employment_end_date: An End Date is the date that the employee ended working at the company + :param leaving_reason: The reason because the employment ended. + :param employee_number: An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. + :param employment_status: The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. + :param employment_role: + :param ethnicity: The ethnicity of the employee + :param manager: + :param direct_reports: Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. + :param social_security_number: A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. + :param birthday: The date of birth of the person. + :param deceased_on: The date the person deceased. + :param country_of_birth: Country code according to ISO 3166-1 alpha-2. + :param description: A description of the object. + :param gender: The gender represents the gender identity of a person. + :param pronouns: The preferred pronouns of the person. + :param preferred_language: language code according to ISO 639-1. For the United States - EN + :param languages: + :param nationalities: + :param photo_url: The URL of the photo of a person. + :param timezone: The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. + :param source: 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. + :param source_id: Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). + :param record_url: + :param jobs: + :param compensations: + :param works_remote: Indicates if the employee works from a remote location. + :param addresses: + :param phone_numbers: + :param emails: + :param custom_fields: + :param social_links: + :param bank_accounts: + :param tax_code: + :param tax_id: + :param dietary_preference: Indicate the employee's dietary preference. + :param food_allergies: Indicate the employee's food allergies. + :param probation_period: + :param tags: + :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. + :param deleted: Flag to indicate if the object is deleted. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +872,90 @@ async def create_async( request = models.HrisEmployeesAddRequest( raw=raw, service_id=service_id, - employee=utils.get_pydantic_model(employee, models.EmployeeInput), + employee=models.EmployeeInput( + id=id, + first_name=first_name, + last_name=last_name, + middle_name=middle_name, + display_name=display_name, + preferred_name=preferred_name, + initials=initials, + salutation=salutation, + title=title, + marital_status=marital_status, + partner=utils.get_pydantic_model(partner, Optional[models.PersonInput]), + division=division, + division_id=division_id, + department=department, + department_id=department_id, + department_name=department_name, + team=utils.get_pydantic_model(team, OptionalNullable[models.Team]), + company_id=company_id, + company_name=company_name, + employment_start_date=employment_start_date, + employment_end_date=employment_end_date, + leaving_reason=leaving_reason, + employee_number=employee_number, + employment_status=employment_status, + employment_role=utils.get_pydantic_model( + employment_role, Optional[models.EmploymentRole] + ), + ethnicity=ethnicity, + manager=utils.get_pydantic_model(manager, Optional[models.Manager]), + direct_reports=direct_reports, + social_security_number=social_security_number, + birthday=birthday, + deceased_on=deceased_on, + country_of_birth=country_of_birth, + description=description, + gender=gender, + pronouns=pronouns, + preferred_language=preferred_language, + languages=languages, + nationalities=nationalities, + photo_url=photo_url, + timezone=timezone, + source=source, + source_id=source_id, + record_url=record_url, + jobs=utils.get_pydantic_model( + jobs, OptionalNullable[List[models.EmployeeJobInput]] + ), + compensations=utils.get_pydantic_model( + compensations, + OptionalNullable[List[models.EmployeeCompensationInput]], + ), + works_remote=works_remote, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + tax_code=tax_code, + tax_id=tax_id, + dietary_preference=dietary_preference, + food_allergies=food_allergies, + probation_period=utils.get_pydantic_model( + probation_period, Optional[models.ProbationPeriod] + ), + tags=tags, + row_version=row_version, + deleted=deleted, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +969,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -474,21 +1046,33 @@ async def create_async( def get( self, *, - request: Union[ - models.HrisEmployeesOneRequest, models.HrisEmployeesOneRequestTypedDict - ], + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[models.EmployeesOneFilter, models.EmployeesOneFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeesOneResponse: r"""Get Employee Get Employee - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -498,9 +1082,16 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeesOneRequest) - request = cast(models.HrisEmployeesOneRequest, request) + request = models.HrisEmployeesOneRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + filter_=utils.get_pydantic_model( + filter_, Optional[models.EmployeesOneFilter] + ), + pass_through=pass_through, + ) req = self.build_request( method="GET", @@ -513,6 +1104,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -586,21 +1178,33 @@ def get( async def get_async( self, *, - request: Union[ - models.HrisEmployeesOneRequest, models.HrisEmployeesOneRequestTypedDict - ], + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[models.EmployeesOneFilter, models.EmployeesOneFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeesOneResponse: r"""Get Employee Get Employee - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -610,9 +1214,16 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeesOneRequest) - request = cast(models.HrisEmployeesOneRequest, request) + request = models.HrisEmployeesOneRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + filter_=utils.get_pydantic_model( + filter_, Optional[models.EmployeesOneFilter] + ), + pass_through=pass_through, + ) req = self.build_request_async( method="GET", @@ -625,6 +1236,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -698,25 +1310,172 @@ async def get_async( def update( self, *, - id: str, - employee: Union[models.EmployeeInput, models.EmployeeInputTypedDict], + id_param: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + id: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + preferred_name: OptionalNullable[str] = UNSET, + initials: OptionalNullable[str] = UNSET, + salutation: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + marital_status: OptionalNullable[str] = UNSET, + partner: Optional[ + Union[models.PersonInput, models.PersonInputTypedDict] + ] = None, + division: OptionalNullable[str] = UNSET, + division_id: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + department_id: OptionalNullable[str] = UNSET, + department_name: OptionalNullable[str] = UNSET, + team: OptionalNullable[Union[models.Team, models.TeamTypedDict]] = UNSET, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + employment_start_date: OptionalNullable[str] = UNSET, + employment_end_date: OptionalNullable[str] = UNSET, + leaving_reason: OptionalNullable[models.LeavingReason] = UNSET, + employee_number: OptionalNullable[str] = UNSET, + employment_status: OptionalNullable[models.EmploymentStatus] = UNSET, + employment_role: Optional[ + Union[models.EmploymentRole, models.EmploymentRoleTypedDict] + ] = None, + ethnicity: OptionalNullable[str] = UNSET, + manager: Optional[Union[models.Manager, models.ManagerTypedDict]] = None, + direct_reports: OptionalNullable[List[str]] = UNSET, + social_security_number: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + deceased_on: OptionalNullable[date] = UNSET, + country_of_birth: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + gender: OptionalNullable[models.Gender] = UNSET, + pronouns: OptionalNullable[str] = UNSET, + preferred_language: OptionalNullable[str] = UNSET, + languages: Optional[List[str]] = None, + nationalities: Optional[List[str]] = None, + photo_url: OptionalNullable[str] = UNSET, + timezone: OptionalNullable[str] = UNSET, + source: OptionalNullable[str] = UNSET, + source_id: OptionalNullable[str] = UNSET, + record_url: OptionalNullable[str] = UNSET, + jobs: OptionalNullable[ + Union[List[models.EmployeeJobInput], List[models.EmployeeJobInputTypedDict]] + ] = UNSET, + compensations: OptionalNullable[ + Union[ + List[models.EmployeeCompensationInput], + List[models.EmployeeCompensationInputTypedDict], + ] + ] = UNSET, + works_remote: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + tax_code: OptionalNullable[str] = UNSET, + tax_id: OptionalNullable[str] = UNSET, + dietary_preference: OptionalNullable[str] = UNSET, + food_allergies: OptionalNullable[List[str]] = UNSET, + probation_period: Optional[ + Union[models.ProbationPeriod, models.ProbationPeriodTypedDict] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + row_version: OptionalNullable[str] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeesUpdateResponse: r"""Update Employee Update Employee - :param id: ID of the record you are acting upon. - :param employee: + :param id_param: ID of the record you are acting upon. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param id: A unique identifier for an object. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param middle_name: Middle name of the person. + :param display_name: The name used to display the employee, often a combination of their first and last names. + :param preferred_name: The name the employee prefers to be addressed by, which may be different from their legal name. + :param initials: The initials of the person, usually derived from their first, middle, and last names. + :param salutation: A formal salutation for the person. For example, 'Mr', 'Mrs' + :param title: The job title of the person. + :param marital_status: The marital status of the employee. + :param partner: + :param division: The division the person is currently in. Usually a collection of departments or teams or regions. + :param division_id: Unique identifier of the division this employee belongs to. + :param department: The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. + :param department_id: Unique identifier of the department ID this employee belongs to. + :param department_name: Name of the department this employee belongs to. + :param team: The team the person is currently in. + :param company_id: The unique identifier of the company. + :param company_name: The name of the company. + :param employment_start_date: A Start Date is the date that the employee started working at the company + :param employment_end_date: An End Date is the date that the employee ended working at the company + :param leaving_reason: The reason because the employment ended. + :param employee_number: An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. + :param employment_status: The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. + :param employment_role: + :param ethnicity: The ethnicity of the employee + :param manager: + :param direct_reports: Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. + :param social_security_number: A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. + :param birthday: The date of birth of the person. + :param deceased_on: The date the person deceased. + :param country_of_birth: Country code according to ISO 3166-1 alpha-2. + :param description: A description of the object. + :param gender: The gender represents the gender identity of a person. + :param pronouns: The preferred pronouns of the person. + :param preferred_language: language code according to ISO 639-1. For the United States - EN + :param languages: + :param nationalities: + :param photo_url: The URL of the photo of a person. + :param timezone: The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. + :param source: 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. + :param source_id: Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). + :param record_url: + :param jobs: + :param compensations: + :param works_remote: Indicates if the employee works from a remote location. + :param addresses: + :param phone_numbers: + :param emails: + :param custom_fields: + :param social_links: + :param bank_accounts: + :param tax_code: + :param tax_id: + :param dietary_preference: Indicate the employee's dietary preference. + :param food_allergies: Indicate the employee's food allergies. + :param probation_period: + :param tags: + :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. + :param deleted: Flag to indicate if the object is deleted. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -727,10 +1486,93 @@ def update( base_url = server_url request = models.HrisEmployeesUpdateRequest( - id=id, + id_param=id_param, service_id=service_id, raw=raw, - employee=utils.get_pydantic_model(employee, models.EmployeeInput), + employee=models.EmployeeInput( + id=id, + first_name=first_name, + last_name=last_name, + middle_name=middle_name, + display_name=display_name, + preferred_name=preferred_name, + initials=initials, + salutation=salutation, + title=title, + marital_status=marital_status, + partner=utils.get_pydantic_model(partner, Optional[models.PersonInput]), + division=division, + division_id=division_id, + department=department, + department_id=department_id, + department_name=department_name, + team=utils.get_pydantic_model(team, OptionalNullable[models.Team]), + company_id=company_id, + company_name=company_name, + employment_start_date=employment_start_date, + employment_end_date=employment_end_date, + leaving_reason=leaving_reason, + employee_number=employee_number, + employment_status=employment_status, + employment_role=utils.get_pydantic_model( + employment_role, Optional[models.EmploymentRole] + ), + ethnicity=ethnicity, + manager=utils.get_pydantic_model(manager, Optional[models.Manager]), + direct_reports=direct_reports, + social_security_number=social_security_number, + birthday=birthday, + deceased_on=deceased_on, + country_of_birth=country_of_birth, + description=description, + gender=gender, + pronouns=pronouns, + preferred_language=preferred_language, + languages=languages, + nationalities=nationalities, + photo_url=photo_url, + timezone=timezone, + source=source, + source_id=source_id, + record_url=record_url, + jobs=utils.get_pydantic_model( + jobs, OptionalNullable[List[models.EmployeeJobInput]] + ), + compensations=utils.get_pydantic_model( + compensations, + OptionalNullable[List[models.EmployeeCompensationInput]], + ), + works_remote=works_remote, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + tax_code=tax_code, + tax_id=tax_id, + dietary_preference=dietary_preference, + food_allergies=food_allergies, + probation_period=utils.get_pydantic_model( + probation_period, Optional[models.ProbationPeriod] + ), + tags=tags, + row_version=row_version, + deleted=deleted, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -744,6 +1586,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -820,25 +1663,172 @@ def update( async def update_async( self, *, - id: str, - employee: Union[models.EmployeeInput, models.EmployeeInputTypedDict], + id_param: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + id: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + preferred_name: OptionalNullable[str] = UNSET, + initials: OptionalNullable[str] = UNSET, + salutation: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + marital_status: OptionalNullable[str] = UNSET, + partner: Optional[ + Union[models.PersonInput, models.PersonInputTypedDict] + ] = None, + division: OptionalNullable[str] = UNSET, + division_id: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + department_id: OptionalNullable[str] = UNSET, + department_name: OptionalNullable[str] = UNSET, + team: OptionalNullable[Union[models.Team, models.TeamTypedDict]] = UNSET, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + employment_start_date: OptionalNullable[str] = UNSET, + employment_end_date: OptionalNullable[str] = UNSET, + leaving_reason: OptionalNullable[models.LeavingReason] = UNSET, + employee_number: OptionalNullable[str] = UNSET, + employment_status: OptionalNullable[models.EmploymentStatus] = UNSET, + employment_role: Optional[ + Union[models.EmploymentRole, models.EmploymentRoleTypedDict] + ] = None, + ethnicity: OptionalNullable[str] = UNSET, + manager: Optional[Union[models.Manager, models.ManagerTypedDict]] = None, + direct_reports: OptionalNullable[List[str]] = UNSET, + social_security_number: OptionalNullable[str] = UNSET, + birthday: OptionalNullable[date] = UNSET, + deceased_on: OptionalNullable[date] = UNSET, + country_of_birth: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + gender: OptionalNullable[models.Gender] = UNSET, + pronouns: OptionalNullable[str] = UNSET, + preferred_language: OptionalNullable[str] = UNSET, + languages: Optional[List[str]] = None, + nationalities: Optional[List[str]] = None, + photo_url: OptionalNullable[str] = UNSET, + timezone: OptionalNullable[str] = UNSET, + source: OptionalNullable[str] = UNSET, + source_id: OptionalNullable[str] = UNSET, + record_url: OptionalNullable[str] = UNSET, + jobs: OptionalNullable[ + Union[List[models.EmployeeJobInput], List[models.EmployeeJobInputTypedDict]] + ] = UNSET, + compensations: OptionalNullable[ + Union[ + List[models.EmployeeCompensationInput], + List[models.EmployeeCompensationInputTypedDict], + ] + ] = UNSET, + works_remote: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + tax_code: OptionalNullable[str] = UNSET, + tax_id: OptionalNullable[str] = UNSET, + dietary_preference: OptionalNullable[str] = UNSET, + food_allergies: OptionalNullable[List[str]] = UNSET, + probation_period: Optional[ + Union[models.ProbationPeriod, models.ProbationPeriodTypedDict] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + row_version: OptionalNullable[str] = UNSET, + deleted: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeesUpdateResponse: r"""Update Employee Update Employee - :param id: ID of the record you are acting upon. - :param employee: + :param id_param: ID of the record you are acting upon. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param id: A unique identifier for an object. + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param middle_name: Middle name of the person. + :param display_name: The name used to display the employee, often a combination of their first and last names. + :param preferred_name: The name the employee prefers to be addressed by, which may be different from their legal name. + :param initials: The initials of the person, usually derived from their first, middle, and last names. + :param salutation: A formal salutation for the person. For example, 'Mr', 'Mrs' + :param title: The job title of the person. + :param marital_status: The marital status of the employee. + :param partner: + :param division: The division the person is currently in. Usually a collection of departments or teams or regions. + :param division_id: Unique identifier of the division this employee belongs to. + :param department: The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. + :param department_id: Unique identifier of the department ID this employee belongs to. + :param department_name: Name of the department this employee belongs to. + :param team: The team the person is currently in. + :param company_id: The unique identifier of the company. + :param company_name: The name of the company. + :param employment_start_date: A Start Date is the date that the employee started working at the company + :param employment_end_date: An End Date is the date that the employee ended working at the company + :param leaving_reason: The reason because the employment ended. + :param employee_number: An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. + :param employment_status: The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. + :param employment_role: + :param ethnicity: The ethnicity of the employee + :param manager: + :param direct_reports: Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. + :param social_security_number: A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. + :param birthday: The date of birth of the person. + :param deceased_on: The date the person deceased. + :param country_of_birth: Country code according to ISO 3166-1 alpha-2. + :param description: A description of the object. + :param gender: The gender represents the gender identity of a person. + :param pronouns: The preferred pronouns of the person. + :param preferred_language: language code according to ISO 639-1. For the United States - EN + :param languages: + :param nationalities: + :param photo_url: The URL of the photo of a person. + :param timezone: The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. + :param source: 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. + :param source_id: Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). + :param record_url: + :param jobs: + :param compensations: + :param works_remote: Indicates if the employee works from a remote location. + :param addresses: + :param phone_numbers: + :param emails: + :param custom_fields: + :param social_links: + :param bank_accounts: + :param tax_code: + :param tax_id: + :param dietary_preference: Indicate the employee's dietary preference. + :param food_allergies: Indicate the employee's food allergies. + :param probation_period: + :param tags: + :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. + :param deleted: Flag to indicate if the object is deleted. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -849,10 +1839,93 @@ async def update_async( base_url = server_url request = models.HrisEmployeesUpdateRequest( - id=id, + id_param=id_param, service_id=service_id, raw=raw, - employee=utils.get_pydantic_model(employee, models.EmployeeInput), + employee=models.EmployeeInput( + id=id, + first_name=first_name, + last_name=last_name, + middle_name=middle_name, + display_name=display_name, + preferred_name=preferred_name, + initials=initials, + salutation=salutation, + title=title, + marital_status=marital_status, + partner=utils.get_pydantic_model(partner, Optional[models.PersonInput]), + division=division, + division_id=division_id, + department=department, + department_id=department_id, + department_name=department_name, + team=utils.get_pydantic_model(team, OptionalNullable[models.Team]), + company_id=company_id, + company_name=company_name, + employment_start_date=employment_start_date, + employment_end_date=employment_end_date, + leaving_reason=leaving_reason, + employee_number=employee_number, + employment_status=employment_status, + employment_role=utils.get_pydantic_model( + employment_role, Optional[models.EmploymentRole] + ), + ethnicity=ethnicity, + manager=utils.get_pydantic_model(manager, Optional[models.Manager]), + direct_reports=direct_reports, + social_security_number=social_security_number, + birthday=birthday, + deceased_on=deceased_on, + country_of_birth=country_of_birth, + description=description, + gender=gender, + pronouns=pronouns, + preferred_language=preferred_language, + languages=languages, + nationalities=nationalities, + photo_url=photo_url, + timezone=timezone, + source=source, + source_id=source_id, + record_url=record_url, + jobs=utils.get_pydantic_model( + jobs, OptionalNullable[List[models.EmployeeJobInput]] + ), + compensations=utils.get_pydantic_model( + compensations, + OptionalNullable[List[models.EmployeeCompensationInput]], + ), + works_remote=works_remote, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + tax_code=tax_code, + tax_id=tax_id, + dietary_preference=dietary_preference, + food_allergies=food_allergies, + probation_period=utils.get_pydantic_model( + probation_period, Optional[models.ProbationPeriod] + ), + tags=tags, + row_version=row_version, + deleted=deleted, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -866,6 +1939,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -948,6 +2022,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeesDeleteResponse: r"""Delete Employee @@ -959,6 +2034,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -985,6 +2061,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1064,6 +2141,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeesDeleteResponse: r"""Delete Employee @@ -1075,6 +2153,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1101,6 +2180,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/employeeschedules_sdk.py b/src/apideck_unify/employeeschedules_sdk.py index 6c0ae591..ee62ee06 100644 --- a/src/apideck_unify/employeeschedules_sdk.py +++ b/src/apideck_unify/employeeschedules_sdk.py @@ -3,31 +3,38 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from typing import Any, Dict, Mapping, Optional class EmployeeSchedulesSDK(BaseSDK): def list( self, *, - request: Union[ - models.HrisEmployeeSchedulesAllRequest, - models.HrisEmployeeSchedulesAllRequestTypedDict, - ], + employee_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeeSchedulesAllResponse: r"""List Employee Schedules List schedules for employee, a schedule is a work pattern, not the actual worked hours, for an employee. - :param request: The request object to send. + :param employee_id: ID of the employee you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +44,13 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeeSchedulesAllRequest) - request = cast(models.HrisEmployeeSchedulesAllRequest, request) + request = models.HrisEmployeeSchedulesAllRequest( + employee_id=employee_id, + raw=raw, + service_id=service_id, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +63,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeeSchedulesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -127,22 +139,29 @@ def list( async def list_async( self, *, - request: Union[ - models.HrisEmployeeSchedulesAllRequest, - models.HrisEmployeeSchedulesAllRequestTypedDict, - ], + employee_id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisEmployeeSchedulesAllResponse: r"""List Employee Schedules List schedules for employee, a schedule is a work pattern, not the actual worked hours, for an employee. - :param request: The request object to send. + :param employee_id: ID of the employee you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,9 +171,13 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisEmployeeSchedulesAllRequest) - request = cast(models.HrisEmployeeSchedulesAllRequest, request) + request = models.HrisEmployeeSchedulesAllRequest( + employee_id=employee_id, + raw=raw, + service_id=service_id, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -167,6 +190,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisEmployeeSchedulesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/eventlogs.py b/src/apideck_unify/eventlogs.py index 7dde9ba7..810a8d8b 100644 --- a/src/apideck_unify/eventlogs.py +++ b/src/apideck_unify/eventlogs.py @@ -5,7 +5,8 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional, Union class EventLogs(BaseSDK): @@ -20,7 +21,8 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.WebhookEventLogsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.WebhookEventLogsAllResponse]: r"""List event logs List event logs @@ -31,6 +33,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -59,6 +62,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookEventLogsAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -91,10 +95,28 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.WebhookEventLogsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetWebhookEventLogsResponse + return models.WebhookEventLogsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetWebhookEventLogsResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -119,7 +141,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.WebhookEventLogsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -141,7 +168,8 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.WebhookEventLogsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.WebhookEventLogsAllResponse]: r"""List event logs List event logs @@ -152,6 +180,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -180,6 +209,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookEventLogsAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -212,10 +242,28 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.WebhookEventLogsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetWebhookEventLogsResponse + return models.WebhookEventLogsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetWebhookEventLogsResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -240,7 +288,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.WebhookEventLogsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) diff --git a/src/apideck_unify/expenses.py b/src/apideck_unify/expenses.py index 8b4cd579..0ed99eda 100644 --- a/src/apideck_unify/expenses.py +++ b/src/apideck_unify/expenses.py @@ -3,9 +3,11 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union +from datetime import datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Expenses(BaseSDK): @@ -19,7 +21,8 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingExpensesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingExpensesAllResponse]: r"""List Expenses List Expenses @@ -31,6 +34,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -58,6 +62,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -91,9 +96,28 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingExpensesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetExpensesResponse) + return models.AccountingExpensesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetExpensesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -117,7 +141,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingExpensesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -138,7 +167,8 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingExpensesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingExpensesAllResponse]: r"""List Expenses List Expenses @@ -150,6 +180,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -177,6 +208,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -210,9 +242,28 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingExpensesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetExpensesResponse) + return models.AccountingExpensesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetExpensesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -236,7 +287,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingExpensesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -250,23 +306,68 @@ async def list_async( def create( self, *, - expense: Union[models.ExpenseInput, models.ExpenseInputTypedDict], + transaction_date: Nullable[datetime], + account_id: str, + line_items: Union[ + List[models.ExpenseLineItemInput], + List[models.ExpenseLineItemInputTypedDict], + ], raw: Optional[bool] = False, service_id: Optional[str] = None, + number: OptionalNullable[str] = UNSET, + customer_id: Optional[str] = None, + supplier_id: Optional[str] = None, + company_id: OptionalNullable[str] = UNSET, + department_id: Optional[str] = None, + payment_type: OptionalNullable[models.ExpensePaymentType] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + type_: OptionalNullable[models.ExpenseType] = UNSET, + memo: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + total_amount: OptionalNullable[float] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingExpensesAddResponse: r"""Create Expense Create Expense - :param expense: + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + :param account_id: The unique identifier for the ledger account that this expense should be credited to. + :param line_items: Expense line items linked to this expense. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param number: Number. + :param customer_id: The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. + :param supplier_id: The ID of the supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param department_id: The ID of the department this expense is linked to. + :param payment_type: The type of payment for the expense. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param type: The type of expense. + :param memo: The memo of the expense. + :param tax_rate: + :param total_amount: The total amount of the expense line item. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -279,7 +380,34 @@ def create( request = models.AccountingExpensesAddRequest( raw=raw, service_id=service_id, - expense=utils.get_pydantic_model(expense, models.ExpenseInput), + expense=models.ExpenseInput( + number=number, + transaction_date=transaction_date, + account_id=account_id, + customer_id=customer_id, + supplier_id=supplier_id, + company_id=company_id, + department_id=department_id, + payment_type=payment_type, + currency=currency, + currency_rate=currency_rate, + type=type_, + memo=memo, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + total_amount=total_amount, + line_items=utils.get_pydantic_model( + line_items, List[models.ExpenseLineItemInput] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -293,6 +421,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -369,23 +498,68 @@ def create( async def create_async( self, *, - expense: Union[models.ExpenseInput, models.ExpenseInputTypedDict], + transaction_date: Nullable[datetime], + account_id: str, + line_items: Union[ + List[models.ExpenseLineItemInput], + List[models.ExpenseLineItemInputTypedDict], + ], raw: Optional[bool] = False, service_id: Optional[str] = None, + number: OptionalNullable[str] = UNSET, + customer_id: Optional[str] = None, + supplier_id: Optional[str] = None, + company_id: OptionalNullable[str] = UNSET, + department_id: Optional[str] = None, + payment_type: OptionalNullable[models.ExpensePaymentType] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + type_: OptionalNullable[models.ExpenseType] = UNSET, + memo: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + total_amount: OptionalNullable[float] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingExpensesAddResponse: r"""Create Expense Create Expense - :param expense: + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + :param account_id: The unique identifier for the ledger account that this expense should be credited to. + :param line_items: Expense line items linked to this expense. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param number: Number. + :param customer_id: The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. + :param supplier_id: The ID of the supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param department_id: The ID of the department this expense is linked to. + :param payment_type: The type of payment for the expense. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param type: The type of expense. + :param memo: The memo of the expense. + :param tax_rate: + :param total_amount: The total amount of the expense line item. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -398,7 +572,34 @@ async def create_async( request = models.AccountingExpensesAddRequest( raw=raw, service_id=service_id, - expense=utils.get_pydantic_model(expense, models.ExpenseInput), + expense=models.ExpenseInput( + number=number, + transaction_date=transaction_date, + account_id=account_id, + customer_id=customer_id, + supplier_id=supplier_id, + company_id=company_id, + department_id=department_id, + payment_type=payment_type, + currency=currency, + currency_rate=currency_rate, + type=type_, + memo=memo, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + total_amount=total_amount, + line_items=utils.get_pydantic_model( + line_items, List[models.ExpenseLineItemInput] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -412,6 +613,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -494,6 +696,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingExpensesOneResponse: r"""Get Expense @@ -505,6 +708,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -531,6 +735,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -610,6 +815,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingExpensesOneResponse: r"""Get Expense @@ -621,6 +827,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -647,6 +854,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -721,24 +929,69 @@ def update( self, *, id: str, - expense: Union[models.ExpenseInput, models.ExpenseInputTypedDict], + transaction_date: Nullable[datetime], + account_id: str, + line_items: Union[ + List[models.ExpenseLineItemInput], + List[models.ExpenseLineItemInputTypedDict], + ], service_id: Optional[str] = None, raw: Optional[bool] = False, + number: OptionalNullable[str] = UNSET, + customer_id: Optional[str] = None, + supplier_id: Optional[str] = None, + company_id: OptionalNullable[str] = UNSET, + department_id: Optional[str] = None, + payment_type: OptionalNullable[models.ExpensePaymentType] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + type_: OptionalNullable[models.ExpenseType] = UNSET, + memo: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + total_amount: OptionalNullable[float] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingExpensesUpdateResponse: r"""Update Expense Update Expense :param id: ID of the record you are acting upon. - :param expense: + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + :param account_id: The unique identifier for the ledger account that this expense should be credited to. + :param line_items: Expense line items linked to this expense. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param number: Number. + :param customer_id: The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. + :param supplier_id: The ID of the supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param department_id: The ID of the department this expense is linked to. + :param payment_type: The type of payment for the expense. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param type: The type of expense. + :param memo: The memo of the expense. + :param tax_rate: + :param total_amount: The total amount of the expense line item. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -752,7 +1005,34 @@ def update( id=id, service_id=service_id, raw=raw, - expense=utils.get_pydantic_model(expense, models.ExpenseInput), + expense=models.ExpenseInput( + number=number, + transaction_date=transaction_date, + account_id=account_id, + customer_id=customer_id, + supplier_id=supplier_id, + company_id=company_id, + department_id=department_id, + payment_type=payment_type, + currency=currency, + currency_rate=currency_rate, + type=type_, + memo=memo, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + total_amount=total_amount, + line_items=utils.get_pydantic_model( + line_items, List[models.ExpenseLineItemInput] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -766,6 +1046,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -843,24 +1124,69 @@ async def update_async( self, *, id: str, - expense: Union[models.ExpenseInput, models.ExpenseInputTypedDict], + transaction_date: Nullable[datetime], + account_id: str, + line_items: Union[ + List[models.ExpenseLineItemInput], + List[models.ExpenseLineItemInputTypedDict], + ], service_id: Optional[str] = None, raw: Optional[bool] = False, + number: OptionalNullable[str] = UNSET, + customer_id: Optional[str] = None, + supplier_id: Optional[str] = None, + company_id: OptionalNullable[str] = UNSET, + department_id: Optional[str] = None, + payment_type: OptionalNullable[models.ExpensePaymentType] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + type_: OptionalNullable[models.ExpenseType] = UNSET, + memo: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + total_amount: OptionalNullable[float] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingExpensesUpdateResponse: r"""Update Expense Update Expense :param id: ID of the record you are acting upon. - :param expense: + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + :param account_id: The unique identifier for the ledger account that this expense should be credited to. + :param line_items: Expense line items linked to this expense. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param number: Number. + :param customer_id: The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. + :param supplier_id: The ID of the supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param department_id: The ID of the department this expense is linked to. + :param payment_type: The type of payment for the expense. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param type: The type of expense. + :param memo: The memo of the expense. + :param tax_rate: + :param total_amount: The total amount of the expense line item. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -874,7 +1200,34 @@ async def update_async( id=id, service_id=service_id, raw=raw, - expense=utils.get_pydantic_model(expense, models.ExpenseInput), + expense=models.ExpenseInput( + number=number, + transaction_date=transaction_date, + account_id=account_id, + customer_id=customer_id, + supplier_id=supplier_id, + company_id=company_id, + department_id=department_id, + payment_type=payment_type, + currency=currency, + currency_rate=currency_rate, + type=type_, + memo=memo, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + total_amount=total_amount, + line_items=utils.get_pydantic_model( + line_items, List[models.ExpenseLineItemInput] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -888,6 +1241,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -970,6 +1324,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingExpensesDeleteResponse: r"""Delete Expense @@ -981,6 +1336,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1007,6 +1363,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1086,6 +1443,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingExpensesDeleteResponse: r"""Delete Expense @@ -1097,6 +1455,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1123,6 +1482,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingExpensesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/files.py b/src/apideck_unify/files.py index 1ce3fe28..5d6ac419 100644 --- a/src/apideck_unify/files.py +++ b/src/apideck_unify/files.py @@ -3,10 +3,11 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env from enum import Enum -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class DownloadAcceptEnum(str, Enum): @@ -23,22 +24,37 @@ class Files(BaseSDK): def list( self, *, - request: Union[ - models.FileStorageFilesAllRequest, - models.FileStorageFilesAllRequestTypedDict, - ] = models.FileStorageFilesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.FilesFilter, models.FilesFilterTypedDict] + ] = None, + sort: Optional[Union[models.FilesSort, models.FilesSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.FileStorageFilesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.FileStorageFilesAllResponse]: r"""List Files List Files - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -48,9 +64,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageFilesAllRequest) - request = cast(models.FileStorageFilesAllRequest, request) + request = models.FileStorageFilesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.FilesFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.FilesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -63,6 +86,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -96,9 +120,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.FileStorageFilesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetFilesResponse) + return models.FileStorageFilesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetFilesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -122,7 +169,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.FileStorageFilesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -136,22 +188,37 @@ def list( async def list_async( self, *, - request: Union[ - models.FileStorageFilesAllRequest, - models.FileStorageFilesAllRequestTypedDict, - ] = models.FileStorageFilesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.FilesFilter, models.FilesFilterTypedDict] + ] = None, + sort: Optional[Union[models.FilesSort, models.FilesSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.FileStorageFilesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.FileStorageFilesAllResponse]: r"""List Files List Files - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -161,9 +228,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageFilesAllRequest) - request = cast(models.FileStorageFilesAllRequest, request) + request = models.FileStorageFilesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.FilesFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.FilesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -176,6 +250,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -209,9 +284,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.FileStorageFilesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetFilesResponse) + return models.FileStorageFilesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetFilesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -235,7 +333,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.FileStorageFilesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -249,22 +352,41 @@ async def list_async( def search( self, *, - request: Union[ - models.FileStorageFilesSearchRequest, - models.FileStorageFilesSearchRequestTypedDict, - ], + query: str, + service_id: Optional[str] = None, + pass_through_param: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.FilesFilter, models.FilesFilterTypedDict] + ] = None, + drive_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesSearchResponse: r"""Search Files Search Files - :param request: The request object to send. + :param query: The query to search for. May match across multiple fields. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param pass_through_param: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param drive_id: ID of the drive to filter on + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -274,9 +396,21 @@ def search( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageFilesSearchRequest) - request = cast(models.FileStorageFilesSearchRequest, request) + request = models.FileStorageFilesSearchRequest( + service_id=service_id, + pass_through_param=pass_through_param, + fields=fields, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.FilesFilter]), + files_search=models.FilesSearch( + query=query, + drive_id=drive_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), + ) req = self.build_request( method="POST", @@ -289,6 +423,7 @@ def search( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesSearchGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -365,22 +500,41 @@ def search( async def search_async( self, *, - request: Union[ - models.FileStorageFilesSearchRequest, - models.FileStorageFilesSearchRequestTypedDict, - ], + query: str, + service_id: Optional[str] = None, + pass_through_param: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.FilesFilter, models.FilesFilterTypedDict] + ] = None, + drive_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesSearchResponse: r"""Search Files Search Files - :param request: The request object to send. + :param query: The query to search for. May match across multiple fields. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param pass_through_param: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param drive_id: ID of the drive to filter on + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -390,9 +544,21 @@ async def search_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageFilesSearchRequest) - request = cast(models.FileStorageFilesSearchRequest, request) + request = models.FileStorageFilesSearchRequest( + service_id=service_id, + pass_through_param=pass_through_param, + fields=fields, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.FilesFilter]), + files_search=models.FilesSearch( + query=query, + drive_id=drive_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), + ) req = self.build_request_async( method="POST", @@ -405,6 +571,7 @@ async def search_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesSearchGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -488,6 +655,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesOneResponse: r"""Get File @@ -500,6 +668,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -527,6 +696,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -607,6 +777,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesOneResponse: r"""Get File @@ -619,6 +790,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -646,6 +818,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -720,26 +893,34 @@ def update( self, *, id: str, - update_file_request: Union[ - models.UpdateFileRequest, models.UpdateFileRequestTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: Optional[str] = None, + description: Optional[str] = None, + parent_folder_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesUpdateResponse: r"""Rename or move File Rename or move File :param id: ID of the record you are acting upon. - :param update_file_request: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: The name of the file. + :param description: Optional description of the file. + :param parent_folder_id: 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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -753,8 +934,13 @@ def update( id=id, service_id=service_id, raw=raw, - update_file_request=utils.get_pydantic_model( - update_file_request, models.UpdateFileRequest + update_file_request=models.UpdateFileRequest( + name=name, + description=description, + parent_folder_id=parent_folder_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -769,6 +955,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -850,26 +1037,34 @@ async def update_async( self, *, id: str, - update_file_request: Union[ - models.UpdateFileRequest, models.UpdateFileRequestTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: Optional[str] = None, + description: Optional[str] = None, + parent_folder_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesUpdateResponse: r"""Rename or move File Rename or move File :param id: ID of the record you are acting upon. - :param update_file_request: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: The name of the file. + :param description: Optional description of the file. + :param parent_folder_id: 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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -883,8 +1078,13 @@ async def update_async( id=id, service_id=service_id, raw=raw, - update_file_request=utils.get_pydantic_model( - update_file_request, models.UpdateFileRequest + update_file_request=models.UpdateFileRequest( + name=name, + description=description, + parent_folder_id=parent_folder_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -899,6 +1099,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -985,6 +1186,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesDeleteResponse: r"""Delete File @@ -996,6 +1198,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1022,6 +1225,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1101,6 +1305,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesDeleteResponse: r"""Delete File @@ -1112,6 +1317,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1138,6 +1344,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFilesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1218,6 +1425,7 @@ def download( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, accept_header_override: Optional[DownloadAcceptEnum] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesDownloadResponse: r"""Download File @@ -1230,6 +1438,7 @@ def download( :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1258,6 +1467,7 @@ def download( accept_header_value=accept_header_override.value if accept_header_override is not None else "application/json;q=1, */*;q=0", + http_headers=http_headers, _globals=models.FileStorageFilesDownloadGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1347,6 +1557,7 @@ async def download_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, accept_header_override: Optional[DownloadAcceptEnum] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesDownloadResponse: r"""Download File @@ -1359,6 +1570,7 @@ async def download_async( :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1387,6 +1599,7 @@ async def download_async( accept_header_value=accept_header_override.value if accept_header_override is not None else "application/json;q=1, */*;q=0", + http_headers=http_headers, _globals=models.FileStorageFilesDownloadGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1477,6 +1690,7 @@ def export( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, accept_header_override: Optional[ExportAcceptEnum] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesExportResponse: r"""Export File @@ -1490,6 +1704,7 @@ def export( :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1519,6 +1734,7 @@ def export( accept_header_value=accept_header_override.value if accept_header_override is not None else "application/json;q=1, */*;q=0", + http_headers=http_headers, _globals=models.FileStorageFilesExportGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1609,6 +1825,7 @@ async def export_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, accept_header_override: Optional[ExportAcceptEnum] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFilesExportResponse: r"""Export File @@ -1622,6 +1839,7 @@ async def export_async( :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param accept_header_override: Override the default accept header for this method + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1651,6 +1869,7 @@ async def export_async( accept_header_value=accept_header_override.value if accept_header_override is not None else "application/json;q=1, */*;q=0", + http_headers=http_headers, _globals=models.FileStorageFilesExportGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/folders.py b/src/apideck_unify/folders.py index 81fec1a8..71ad18fa 100644 --- a/src/apideck_unify/folders.py +++ b/src/apideck_unify/folders.py @@ -3,36 +3,46 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from typing import Any, List, Mapping, Optional, Union class Folders(BaseSDK): def create( self, *, - create_folder_request: Union[ - models.CreateFolderRequest, models.CreateFolderRequestTypedDict - ], + name: str, + parent_folder_id: str, raw: Optional[bool] = False, service_id: Optional[str] = None, fields: OptionalNullable[str] = UNSET, + description: Optional[str] = None, + drive_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersAddResponse: r"""Create Folder Create Folder - :param create_folder_request: + :param name: The name of the folder. + :param parent_folder_id: 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. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param fields: 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. + :param description: Optional description of the folder. + :param drive_id: ID of the drive to create the folder in. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -46,8 +56,14 @@ def create( raw=raw, service_id=service_id, fields=fields, - create_folder_request=utils.get_pydantic_model( - create_folder_request, models.CreateFolderRequest + create_folder_request=models.CreateFolderRequest( + name=name, + description=description, + parent_folder_id=parent_folder_id, + drive_id=drive_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -62,6 +78,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -142,27 +159,37 @@ def create( async def create_async( self, *, - create_folder_request: Union[ - models.CreateFolderRequest, models.CreateFolderRequestTypedDict - ], + name: str, + parent_folder_id: str, raw: Optional[bool] = False, service_id: Optional[str] = None, fields: OptionalNullable[str] = UNSET, + description: Optional[str] = None, + drive_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersAddResponse: r"""Create Folder Create Folder - :param create_folder_request: + :param name: The name of the folder. + :param parent_folder_id: 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. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param fields: 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. + :param description: Optional description of the folder. + :param drive_id: ID of the drive to create the folder in. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -176,8 +203,14 @@ async def create_async( raw=raw, service_id=service_id, fields=fields, - create_folder_request=utils.get_pydantic_model( - create_folder_request, models.CreateFolderRequest + create_folder_request=models.CreateFolderRequest( + name=name, + description=description, + parent_folder_id=parent_folder_id, + drive_id=drive_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -192,6 +225,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -279,6 +313,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersOneResponse: r"""Get Folder @@ -291,6 +326,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -318,6 +354,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -398,6 +435,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersOneResponse: r"""Get Folder @@ -410,6 +448,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -437,6 +476,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -511,26 +551,34 @@ def update( self, *, id: str, - update_folder_request: Union[ - models.UpdateFolderRequest, models.UpdateFolderRequestTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: Optional[str] = None, + description: Optional[str] = None, + parent_folder_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersUpdateResponse: r"""Rename or move Folder Rename or move Folder :param id: ID of the record you are acting upon. - :param update_folder_request: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: The name of the folder. + :param description: Optional description of the folder. + :param parent_folder_id: 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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -544,8 +592,13 @@ def update( id=id, service_id=service_id, raw=raw, - update_folder_request=utils.get_pydantic_model( - update_folder_request, models.UpdateFolderRequest + update_folder_request=models.UpdateFolderRequest( + name=name, + description=description, + parent_folder_id=parent_folder_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -560,6 +613,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -641,26 +695,34 @@ async def update_async( self, *, id: str, - update_folder_request: Union[ - models.UpdateFolderRequest, models.UpdateFolderRequestTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: Optional[str] = None, + description: Optional[str] = None, + parent_folder_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersUpdateResponse: r"""Rename or move Folder Rename or move Folder :param id: ID of the record you are acting upon. - :param update_folder_request: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: The name of the folder. + :param description: Optional description of the folder. + :param parent_folder_id: 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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -674,8 +736,13 @@ async def update_async( id=id, service_id=service_id, raw=raw, - update_folder_request=utils.get_pydantic_model( - update_folder_request, models.UpdateFolderRequest + update_folder_request=models.UpdateFolderRequest( + name=name, + description=description, + parent_folder_id=parent_folder_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -690,6 +757,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -776,6 +844,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersDeleteResponse: r"""Delete Folder @@ -787,6 +856,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -813,6 +883,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -892,6 +963,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersDeleteResponse: r"""Delete Folder @@ -903,6 +975,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -929,6 +1002,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1002,22 +1076,35 @@ async def delete_async( def copy( self, *, - request: Union[ - models.FileStorageFoldersCopyRequest, - models.FileStorageFoldersCopyRequestTypedDict, - ], + id: str, + parent_folder_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersCopyResponse: r"""Copy Folder Copy Folder - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param parent_folder_id: 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. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. + :param name: The name of the folder. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1027,9 +1114,19 @@ def copy( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageFoldersCopyRequest) - request = cast(models.FileStorageFoldersCopyRequest, request) + request = models.FileStorageFoldersCopyRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + copy_folder_request=models.CopyFolderRequest( + name=name, + parent_folder_id=parent_folder_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), + ) req = self.build_request( method="POST", @@ -1042,6 +1139,7 @@ def copy( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersCopyGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1122,22 +1220,35 @@ def copy( async def copy_async( self, *, - request: Union[ - models.FileStorageFoldersCopyRequest, - models.FileStorageFoldersCopyRequestTypedDict, - ], + id: str, + parent_folder_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageFoldersCopyResponse: r"""Copy Folder Copy Folder - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param parent_folder_id: 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. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. + :param name: The name of the folder. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1147,9 +1258,19 @@ async def copy_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageFoldersCopyRequest) - request = cast(models.FileStorageFoldersCopyRequest, request) + request = models.FileStorageFoldersCopyRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + copy_folder_request=models.CopyFolderRequest( + name=name, + parent_folder_id=parent_folder_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), + ) req = self.build_request_async( method="POST", @@ -1162,6 +1283,7 @@ async def copy_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageFoldersCopyGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/invoiceitems.py b/src/apideck_unify/invoiceitems.py index edfb583a..6e887519 100644 --- a/src/apideck_unify/invoiceitems.py +++ b/src/apideck_unify/invoiceitems.py @@ -3,31 +3,46 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class InvoiceItems(BaseSDK): def list( self, *, - request: Union[ - models.AccountingInvoiceItemsAllRequest, - models.AccountingInvoiceItemsAllRequestTypedDict, - ] = models.AccountingInvoiceItemsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.InvoiceItemsFilter, models.InvoiceItemsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingInvoiceItemsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingInvoiceItemsAllResponse]: r"""List Invoice Items List Invoice Items - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +52,17 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingInvoiceItemsAllRequest) - request = cast(models.AccountingInvoiceItemsAllRequest, request) + request = models.AccountingInvoiceItemsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.InvoiceItemsFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +75,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +109,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingInvoiceItemsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetInvoiceItemsResponse) + return models.AccountingInvoiceItemsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetInvoiceItemsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +159,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingInvoiceItemsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +178,35 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingInvoiceItemsAllRequest, - models.AccountingInvoiceItemsAllRequestTypedDict, - ] = models.AccountingInvoiceItemsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.InvoiceItemsFilter, models.InvoiceItemsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingInvoiceItemsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingInvoiceItemsAllResponse]: r"""List Invoice Items List Invoice Items - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +216,17 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingInvoiceItemsAllRequest) - request = cast(models.AccountingInvoiceItemsAllRequest, request) + request = models.AccountingInvoiceItemsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.InvoiceItemsFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +239,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +273,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingInvoiceItemsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetInvoiceItemsResponse) + return models.AccountingInvoiceItemsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetInvoiceItemsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +323,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingInvoiceItemsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +342,101 @@ async def list_async( def create( self, *, - invoice_item: Union[models.InvoiceItemInput, models.InvoiceItemInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + sold: OptionalNullable[bool] = UNSET, + purchased: OptionalNullable[bool] = UNSET, + tracked: OptionalNullable[bool] = UNSET, + taxable: OptionalNullable[bool] = UNSET, + inventory_date: OptionalNullable[date] = UNSET, + type_: OptionalNullable[models.InvoiceItemTypeType] = UNSET, + sales_details: Optional[ + Union[ + models.InvoiceItemSalesDetails, models.InvoiceItemSalesDetailsTypedDict + ] + ] = None, + purchase_details: Optional[ + Union[ + models.InvoiceItemPurchaseDetails, + models.InvoiceItemPurchaseDetailsTypedDict, + ] + ] = None, + quantity: OptionalNullable[float] = UNSET, + unit_price: OptionalNullable[float] = UNSET, + asset_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + income_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + expense_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + tracking_category: OptionalNullable[ + Union[ + models.DeprecatedLinkedTrackingCategory, + models.DeprecatedLinkedTrackingCategoryTypedDict, + ] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + active: OptionalNullable[bool] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoiceItemsAddResponse: r"""Create Invoice Item Create Invoice Item - :param invoice_item: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param name: Item name + :param description: A short description of the item + :param code: User defined item code + :param sold: Item will be available on sales transactions + :param purchased: Item is available for purchase transactions + :param tracked: Item is inventoried + :param taxable: If true, transactions for this item are taxable + :param inventory_date: The date of opening balance if inventory item is tracked - YYYY-MM-DD. + :param type: Item type + :param sales_details: + :param purchase_details: + :param quantity: + :param unit_price: + :param asset_account: + :param income_account: + :param expense_account: + :param tracking_category: + :param tracking_categories: A list of linked tracking categories. + :param active: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,8 +449,46 @@ def create( request = models.AccountingInvoiceItemsAddRequest( raw=raw, service_id=service_id, - invoice_item=utils.get_pydantic_model( - invoice_item, models.InvoiceItemInput + invoice_item=models.InvoiceItemInput( + name=name, + description=description, + code=code, + sold=sold, + purchased=purchased, + tracked=tracked, + taxable=taxable, + inventory_date=inventory_date, + type=type_, + sales_details=utils.get_pydantic_model( + sales_details, Optional[models.InvoiceItemSalesDetails] + ), + purchase_details=utils.get_pydantic_model( + purchase_details, Optional[models.InvoiceItemPurchaseDetails] + ), + quantity=quantity, + unit_price=unit_price, + asset_account=utils.get_pydantic_model( + asset_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + income_account=utils.get_pydantic_model( + income_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + expense_account=utils.get_pydantic_model( + expense_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + tracking_category=utils.get_pydantic_model( + tracking_category, + OptionalNullable[models.DeprecatedLinkedTrackingCategory], + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + active=active, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -283,6 +503,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -359,23 +580,101 @@ def create( async def create_async( self, *, - invoice_item: Union[models.InvoiceItemInput, models.InvoiceItemInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + sold: OptionalNullable[bool] = UNSET, + purchased: OptionalNullable[bool] = UNSET, + tracked: OptionalNullable[bool] = UNSET, + taxable: OptionalNullable[bool] = UNSET, + inventory_date: OptionalNullable[date] = UNSET, + type_: OptionalNullable[models.InvoiceItemTypeType] = UNSET, + sales_details: Optional[ + Union[ + models.InvoiceItemSalesDetails, models.InvoiceItemSalesDetailsTypedDict + ] + ] = None, + purchase_details: Optional[ + Union[ + models.InvoiceItemPurchaseDetails, + models.InvoiceItemPurchaseDetailsTypedDict, + ] + ] = None, + quantity: OptionalNullable[float] = UNSET, + unit_price: OptionalNullable[float] = UNSET, + asset_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + income_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + expense_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + tracking_category: OptionalNullable[ + Union[ + models.DeprecatedLinkedTrackingCategory, + models.DeprecatedLinkedTrackingCategoryTypedDict, + ] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + active: OptionalNullable[bool] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoiceItemsAddResponse: r"""Create Invoice Item Create Invoice Item - :param invoice_item: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param name: Item name + :param description: A short description of the item + :param code: User defined item code + :param sold: Item will be available on sales transactions + :param purchased: Item is available for purchase transactions + :param tracked: Item is inventoried + :param taxable: If true, transactions for this item are taxable + :param inventory_date: The date of opening balance if inventory item is tracked - YYYY-MM-DD. + :param type: Item type + :param sales_details: + :param purchase_details: + :param quantity: + :param unit_price: + :param asset_account: + :param income_account: + :param expense_account: + :param tracking_category: + :param tracking_categories: A list of linked tracking categories. + :param active: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -388,8 +687,46 @@ async def create_async( request = models.AccountingInvoiceItemsAddRequest( raw=raw, service_id=service_id, - invoice_item=utils.get_pydantic_model( - invoice_item, models.InvoiceItemInput + invoice_item=models.InvoiceItemInput( + name=name, + description=description, + code=code, + sold=sold, + purchased=purchased, + tracked=tracked, + taxable=taxable, + inventory_date=inventory_date, + type=type_, + sales_details=utils.get_pydantic_model( + sales_details, Optional[models.InvoiceItemSalesDetails] + ), + purchase_details=utils.get_pydantic_model( + purchase_details, Optional[models.InvoiceItemPurchaseDetails] + ), + quantity=quantity, + unit_price=unit_price, + asset_account=utils.get_pydantic_model( + asset_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + income_account=utils.get_pydantic_model( + income_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + expense_account=utils.get_pydantic_model( + expense_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + tracking_category=utils.get_pydantic_model( + tracking_category, + OptionalNullable[models.DeprecatedLinkedTrackingCategory], + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + active=active, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -404,6 +741,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -480,22 +818,31 @@ async def create_async( def get( self, *, - request: Union[ - models.AccountingInvoiceItemsOneRequest, - models.AccountingInvoiceItemsOneRequestTypedDict, - ], + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[models.InvoiceItemFilter, models.InvoiceItemFilterTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoiceItemsOneResponse: r"""Get Invoice Item Get Invoice Item - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. + :param filter_: Apply filters :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -505,9 +852,15 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingInvoiceItemsOneRequest) - request = cast(models.AccountingInvoiceItemsOneRequest, request) + request = models.AccountingInvoiceItemsOneRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + filter_=utils.get_pydantic_model( + filter_, Optional[models.InvoiceItemFilter] + ), + ) req = self.build_request( method="GET", @@ -520,6 +873,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -593,22 +947,31 @@ def get( async def get_async( self, *, - request: Union[ - models.AccountingInvoiceItemsOneRequest, - models.AccountingInvoiceItemsOneRequestTypedDict, - ], + id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[models.InvoiceItemFilter, models.InvoiceItemFilterTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoiceItemsOneResponse: r"""Get Invoice Item Get Invoice Item - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. + :param filter_: Apply filters :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -618,9 +981,15 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingInvoiceItemsOneRequest) - request = cast(models.AccountingInvoiceItemsOneRequest, request) + request = models.AccountingInvoiceItemsOneRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + filter_=utils.get_pydantic_model( + filter_, Optional[models.InvoiceItemFilter] + ), + ) req = self.build_request_async( method="GET", @@ -633,6 +1002,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -707,24 +1077,102 @@ def update( self, *, id: str, - invoice_item: Union[models.InvoiceItemInput, models.InvoiceItemInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + sold: OptionalNullable[bool] = UNSET, + purchased: OptionalNullable[bool] = UNSET, + tracked: OptionalNullable[bool] = UNSET, + taxable: OptionalNullable[bool] = UNSET, + inventory_date: OptionalNullable[date] = UNSET, + type_: OptionalNullable[models.InvoiceItemTypeType] = UNSET, + sales_details: Optional[ + Union[ + models.InvoiceItemSalesDetails, models.InvoiceItemSalesDetailsTypedDict + ] + ] = None, + purchase_details: Optional[ + Union[ + models.InvoiceItemPurchaseDetails, + models.InvoiceItemPurchaseDetailsTypedDict, + ] + ] = None, + quantity: OptionalNullable[float] = UNSET, + unit_price: OptionalNullable[float] = UNSET, + asset_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + income_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + expense_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + tracking_category: OptionalNullable[ + Union[ + models.DeprecatedLinkedTrackingCategory, + models.DeprecatedLinkedTrackingCategoryTypedDict, + ] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + active: OptionalNullable[bool] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoiceItemsUpdateResponse: r"""Update Invoice Item Update Invoice Item :param id: ID of the record you are acting upon. - :param invoice_item: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: Item name + :param description: A short description of the item + :param code: User defined item code + :param sold: Item will be available on sales transactions + :param purchased: Item is available for purchase transactions + :param tracked: Item is inventoried + :param taxable: If true, transactions for this item are taxable + :param inventory_date: The date of opening balance if inventory item is tracked - YYYY-MM-DD. + :param type: Item type + :param sales_details: + :param purchase_details: + :param quantity: + :param unit_price: + :param asset_account: + :param income_account: + :param expense_account: + :param tracking_category: + :param tracking_categories: A list of linked tracking categories. + :param active: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -738,8 +1186,46 @@ def update( id=id, service_id=service_id, raw=raw, - invoice_item=utils.get_pydantic_model( - invoice_item, models.InvoiceItemInput + invoice_item=models.InvoiceItemInput( + name=name, + description=description, + code=code, + sold=sold, + purchased=purchased, + tracked=tracked, + taxable=taxable, + inventory_date=inventory_date, + type=type_, + sales_details=utils.get_pydantic_model( + sales_details, Optional[models.InvoiceItemSalesDetails] + ), + purchase_details=utils.get_pydantic_model( + purchase_details, Optional[models.InvoiceItemPurchaseDetails] + ), + quantity=quantity, + unit_price=unit_price, + asset_account=utils.get_pydantic_model( + asset_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + income_account=utils.get_pydantic_model( + income_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + expense_account=utils.get_pydantic_model( + expense_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + tracking_category=utils.get_pydantic_model( + tracking_category, + OptionalNullable[models.DeprecatedLinkedTrackingCategory], + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + active=active, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -754,6 +1240,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -833,24 +1320,102 @@ async def update_async( self, *, id: str, - invoice_item: Union[models.InvoiceItemInput, models.InvoiceItemInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + sold: OptionalNullable[bool] = UNSET, + purchased: OptionalNullable[bool] = UNSET, + tracked: OptionalNullable[bool] = UNSET, + taxable: OptionalNullable[bool] = UNSET, + inventory_date: OptionalNullable[date] = UNSET, + type_: OptionalNullable[models.InvoiceItemTypeType] = UNSET, + sales_details: Optional[ + Union[ + models.InvoiceItemSalesDetails, models.InvoiceItemSalesDetailsTypedDict + ] + ] = None, + purchase_details: Optional[ + Union[ + models.InvoiceItemPurchaseDetails, + models.InvoiceItemPurchaseDetailsTypedDict, + ] + ] = None, + quantity: OptionalNullable[float] = UNSET, + unit_price: OptionalNullable[float] = UNSET, + asset_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + income_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + expense_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + tracking_category: OptionalNullable[ + Union[ + models.DeprecatedLinkedTrackingCategory, + models.DeprecatedLinkedTrackingCategoryTypedDict, + ] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + active: OptionalNullable[bool] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoiceItemsUpdateResponse: r"""Update Invoice Item Update Invoice Item :param id: ID of the record you are acting upon. - :param invoice_item: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param name: Item name + :param description: A short description of the item + :param code: User defined item code + :param sold: Item will be available on sales transactions + :param purchased: Item is available for purchase transactions + :param tracked: Item is inventoried + :param taxable: If true, transactions for this item are taxable + :param inventory_date: The date of opening balance if inventory item is tracked - YYYY-MM-DD. + :param type: Item type + :param sales_details: + :param purchase_details: + :param quantity: + :param unit_price: + :param asset_account: + :param income_account: + :param expense_account: + :param tracking_category: + :param tracking_categories: A list of linked tracking categories. + :param active: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -864,8 +1429,46 @@ async def update_async( id=id, service_id=service_id, raw=raw, - invoice_item=utils.get_pydantic_model( - invoice_item, models.InvoiceItemInput + invoice_item=models.InvoiceItemInput( + name=name, + description=description, + code=code, + sold=sold, + purchased=purchased, + tracked=tracked, + taxable=taxable, + inventory_date=inventory_date, + type=type_, + sales_details=utils.get_pydantic_model( + sales_details, Optional[models.InvoiceItemSalesDetails] + ), + purchase_details=utils.get_pydantic_model( + purchase_details, Optional[models.InvoiceItemPurchaseDetails] + ), + quantity=quantity, + unit_price=unit_price, + asset_account=utils.get_pydantic_model( + asset_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + income_account=utils.get_pydantic_model( + income_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + expense_account=utils.get_pydantic_model( + expense_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + tracking_category=utils.get_pydantic_model( + tracking_category, + OptionalNullable[models.DeprecatedLinkedTrackingCategory], + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + active=active, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -880,6 +1483,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1568,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoiceItemsDeleteResponse: r"""Delete Invoice Item @@ -975,6 +1580,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1607,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1687,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoiceItemsDeleteResponse: r"""Delete Invoice Item @@ -1091,6 +1699,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1726,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoiceItemsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/invoices.py b/src/apideck_unify/invoices.py index 0607dd62..4421280f 100644 --- a/src/apideck_unify/invoices.py +++ b/src/apideck_unify/invoices.py @@ -3,31 +3,48 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Invoices(BaseSDK): def list( self, *, - request: Union[ - models.AccountingInvoicesAllRequest, - models.AccountingInvoicesAllRequestTypedDict, - ] = models.AccountingInvoicesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.InvoicesFilter, models.InvoicesFilterTypedDict] + ] = None, + sort: Optional[Union[models.InvoicesSort, models.InvoicesSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingInvoicesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingInvoicesAllResponse]: r"""List Invoices List Invoices - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +54,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingInvoicesAllRequest) - request = cast(models.AccountingInvoicesAllRequest, request) + request = models.AccountingInvoicesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.InvoicesFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.InvoicesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +76,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +110,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingInvoicesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetInvoicesResponse) + return models.AccountingInvoicesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetInvoicesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +159,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingInvoicesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +178,37 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingInvoicesAllRequest, - models.AccountingInvoicesAllRequestTypedDict, - ] = models.AccountingInvoicesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.InvoicesFilter, models.InvoicesFilterTypedDict] + ] = None, + sort: Optional[Union[models.InvoicesSort, models.InvoicesSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingInvoicesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingInvoicesAllResponse]: r"""List Invoices List Invoices - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +218,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingInvoicesAllRequest) - request = cast(models.AccountingInvoicesAllRequest, request) + request = models.AccountingInvoicesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.InvoicesFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.InvoicesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +240,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +274,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingInvoicesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetInvoicesResponse) + return models.AccountingInvoicesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetInvoicesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +323,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingInvoicesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +342,133 @@ async def list_async( def create( self, *, - invoice: Union[models.InvoiceInput, models.InvoiceInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + type_: OptionalNullable[models.InvoiceType] = UNSET, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + invoice_date: OptionalNullable[date] = UNSET, + due_date: OptionalNullable[date] = UNSET, + terms: OptionalNullable[str] = UNSET, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.InvoiceStatus] = UNSET, + invoice_sent: Optional[bool] = None, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + discount_amount: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + balance: OptionalNullable[float] = UNSET, + deposit: OptionalNullable[float] = UNSET, + customer_memo: OptionalNullable[str] = UNSET, + tracking_category: OptionalNullable[ + Union[ + models.DeprecatedLinkedTrackingCategory, + models.DeprecatedLinkedTrackingCategoryTypedDict, + ] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + template_id: OptionalNullable[str] = UNSET, + source_document_url: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + accounting_by_row: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoicesAddResponse: r"""Create Invoice Create Invoice - :param invoice: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param type: Invoice type + :param number: Invoice number. + :param customer: The customer this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param invoice_date: Date invoice was issued - YYYY-MM-DD. + :param due_date: The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. + :param terms: Terms of payment. + :param po_number: 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. + :param reference: Optional invoice reference. + :param status: Invoice status + :param invoice_sent: Invoice sent to contact/customer. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param discount_percentage: Discount percentage applied to this invoice. + :param discount_amount: Discount amount applied to this invoice. + :param total: Total amount of invoice, including tax. + :param balance: Balance of invoice due. + :param deposit: Amount of deposit made to this invoice. + :param customer_memo: Customer memo + :param tracking_category: + :param tracking_categories: A list of linked tracking categories. + :param line_items: + :param billing_address: + :param shipping_address: + :param template_id: Optional invoice template + :param source_document_url: URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :param language: language code according to ISO 639-1. For the United States - EN + :param accounting_by_row: 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. + :param bank_account: + :param ledger_account: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +481,69 @@ def create( request = models.AccountingInvoicesAddRequest( raw=raw, service_id=service_id, - invoice=utils.get_pydantic_model(invoice, models.InvoiceInput), + invoice=models.InvoiceInput( + type=type_, + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + company_id=company_id, + invoice_date=invoice_date, + due_date=due_date, + terms=terms, + po_number=po_number, + reference=reference, + status=status, + invoice_sent=invoice_sent, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_tax=total_tax, + tax_code=tax_code, + discount_percentage=discount_percentage, + discount_amount=discount_amount, + total=total, + balance=balance, + deposit=deposit, + customer_memo=customer_memo, + tracking_category=utils.get_pydantic_model( + tracking_category, + OptionalNullable[models.DeprecatedLinkedTrackingCategory], + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + template_id=template_id, + source_document_url=source_document_url, + payment_method=payment_method, + channel=channel, + language=language, + accounting_by_row=accounting_by_row, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +557,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +634,133 @@ def create( async def create_async( self, *, - invoice: Union[models.InvoiceInput, models.InvoiceInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + type_: OptionalNullable[models.InvoiceType] = UNSET, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + invoice_date: OptionalNullable[date] = UNSET, + due_date: OptionalNullable[date] = UNSET, + terms: OptionalNullable[str] = UNSET, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.InvoiceStatus] = UNSET, + invoice_sent: Optional[bool] = None, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + discount_amount: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + balance: OptionalNullable[float] = UNSET, + deposit: OptionalNullable[float] = UNSET, + customer_memo: OptionalNullable[str] = UNSET, + tracking_category: OptionalNullable[ + Union[ + models.DeprecatedLinkedTrackingCategory, + models.DeprecatedLinkedTrackingCategoryTypedDict, + ] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + template_id: OptionalNullable[str] = UNSET, + source_document_url: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + accounting_by_row: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoicesAddResponse: r"""Create Invoice Create Invoice - :param invoice: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param type: Invoice type + :param number: Invoice number. + :param customer: The customer this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param invoice_date: Date invoice was issued - YYYY-MM-DD. + :param due_date: The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. + :param terms: Terms of payment. + :param po_number: 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. + :param reference: Optional invoice reference. + :param status: Invoice status + :param invoice_sent: Invoice sent to contact/customer. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param discount_percentage: Discount percentage applied to this invoice. + :param discount_amount: Discount amount applied to this invoice. + :param total: Total amount of invoice, including tax. + :param balance: Balance of invoice due. + :param deposit: Amount of deposit made to this invoice. + :param customer_memo: Customer memo + :param tracking_category: + :param tracking_categories: A list of linked tracking categories. + :param line_items: + :param billing_address: + :param shipping_address: + :param template_id: Optional invoice template + :param source_document_url: URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :param language: language code according to ISO 639-1. For the United States - EN + :param accounting_by_row: 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. + :param bank_account: + :param ledger_account: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +773,69 @@ async def create_async( request = models.AccountingInvoicesAddRequest( raw=raw, service_id=service_id, - invoice=utils.get_pydantic_model(invoice, models.InvoiceInput), + invoice=models.InvoiceInput( + type=type_, + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + company_id=company_id, + invoice_date=invoice_date, + due_date=due_date, + terms=terms, + po_number=po_number, + reference=reference, + status=status, + invoice_sent=invoice_sent, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_tax=total_tax, + tax_code=tax_code, + discount_percentage=discount_percentage, + discount_amount=discount_amount, + total=total, + balance=balance, + deposit=deposit, + customer_memo=customer_memo, + tracking_category=utils.get_pydantic_model( + tracking_category, + OptionalNullable[models.DeprecatedLinkedTrackingCategory], + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + template_id=template_id, + source_document_url=source_document_url, + payment_method=payment_method, + channel=channel, + language=language, + accounting_by_row=accounting_by_row, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +849,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +933,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoicesOneResponse: r"""Get Invoice @@ -495,6 +946,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +974,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +1055,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoicesOneResponse: r"""Get Invoice @@ -614,6 +1068,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +1096,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +1171,134 @@ def update( self, *, id: str, - invoice: Union[models.InvoiceInput, models.InvoiceInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + type_: OptionalNullable[models.InvoiceType] = UNSET, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + invoice_date: OptionalNullable[date] = UNSET, + due_date: OptionalNullable[date] = UNSET, + terms: OptionalNullable[str] = UNSET, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.InvoiceStatus] = UNSET, + invoice_sent: Optional[bool] = None, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + discount_amount: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + balance: OptionalNullable[float] = UNSET, + deposit: OptionalNullable[float] = UNSET, + customer_memo: OptionalNullable[str] = UNSET, + tracking_category: OptionalNullable[ + Union[ + models.DeprecatedLinkedTrackingCategory, + models.DeprecatedLinkedTrackingCategoryTypedDict, + ] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + template_id: OptionalNullable[str] = UNSET, + source_document_url: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + accounting_by_row: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoicesUpdateResponse: r"""Update Invoice Update Invoice :param id: ID of the record you are acting upon. - :param invoice: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param type: Invoice type + :param number: Invoice number. + :param customer: The customer this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param invoice_date: Date invoice was issued - YYYY-MM-DD. + :param due_date: The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. + :param terms: Terms of payment. + :param po_number: 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. + :param reference: Optional invoice reference. + :param status: Invoice status + :param invoice_sent: Invoice sent to contact/customer. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param discount_percentage: Discount percentage applied to this invoice. + :param discount_amount: Discount amount applied to this invoice. + :param total: Total amount of invoice, including tax. + :param balance: Balance of invoice due. + :param deposit: Amount of deposit made to this invoice. + :param customer_memo: Customer memo + :param tracking_category: + :param tracking_categories: A list of linked tracking categories. + :param line_items: + :param billing_address: + :param shipping_address: + :param template_id: Optional invoice template + :param source_document_url: URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :param language: language code according to ISO 639-1. For the United States - EN + :param accounting_by_row: 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. + :param bank_account: + :param ledger_account: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +1312,69 @@ def update( id=id, service_id=service_id, raw=raw, - invoice=utils.get_pydantic_model(invoice, models.InvoiceInput), + invoice=models.InvoiceInput( + type=type_, + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + company_id=company_id, + invoice_date=invoice_date, + due_date=due_date, + terms=terms, + po_number=po_number, + reference=reference, + status=status, + invoice_sent=invoice_sent, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_tax=total_tax, + tax_code=tax_code, + discount_percentage=discount_percentage, + discount_amount=discount_amount, + total=total, + balance=balance, + deposit=deposit, + customer_memo=customer_memo, + tracking_category=utils.get_pydantic_model( + tracking_category, + OptionalNullable[models.DeprecatedLinkedTrackingCategory], + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + template_id=template_id, + source_document_url=source_document_url, + payment_method=payment_method, + channel=channel, + language=language, + accounting_by_row=accounting_by_row, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +1388,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +1466,134 @@ async def update_async( self, *, id: str, - invoice: Union[models.InvoiceInput, models.InvoiceInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + type_: OptionalNullable[models.InvoiceType] = UNSET, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + invoice_date: OptionalNullable[date] = UNSET, + due_date: OptionalNullable[date] = UNSET, + terms: OptionalNullable[str] = UNSET, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.InvoiceStatus] = UNSET, + invoice_sent: Optional[bool] = None, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + discount_amount: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + balance: OptionalNullable[float] = UNSET, + deposit: OptionalNullable[float] = UNSET, + customer_memo: OptionalNullable[str] = UNSET, + tracking_category: OptionalNullable[ + Union[ + models.DeprecatedLinkedTrackingCategory, + models.DeprecatedLinkedTrackingCategoryTypedDict, + ] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + template_id: OptionalNullable[str] = UNSET, + source_document_url: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + accounting_by_row: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoicesUpdateResponse: r"""Update Invoice Update Invoice :param id: ID of the record you are acting upon. - :param invoice: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param type: Invoice type + :param number: Invoice number. + :param customer: The customer this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param invoice_date: Date invoice was issued - YYYY-MM-DD. + :param due_date: The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. + :param terms: Terms of payment. + :param po_number: 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. + :param reference: Optional invoice reference. + :param status: Invoice status + :param invoice_sent: Invoice sent to contact/customer. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param tax_inclusive: Amounts are including tax + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param discount_percentage: Discount percentage applied to this invoice. + :param discount_amount: Discount amount applied to this invoice. + :param total: Total amount of invoice, including tax. + :param balance: Balance of invoice due. + :param deposit: Amount of deposit made to this invoice. + :param customer_memo: Customer memo + :param tracking_category: + :param tracking_categories: A list of linked tracking categories. + :param line_items: + :param billing_address: + :param shipping_address: + :param template_id: Optional invoice template + :param source_document_url: URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param channel: The channel through which the transaction is processed. + :param language: language code according to ISO 639-1. For the United States - EN + :param accounting_by_row: 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. + :param bank_account: + :param ledger_account: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1607,69 @@ async def update_async( id=id, service_id=service_id, raw=raw, - invoice=utils.get_pydantic_model(invoice, models.InvoiceInput), + invoice=models.InvoiceInput( + type=type_, + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + company_id=company_id, + invoice_date=invoice_date, + due_date=due_date, + terms=terms, + po_number=po_number, + reference=reference, + status=status, + invoice_sent=invoice_sent, + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_tax=total_tax, + tax_code=tax_code, + discount_percentage=discount_percentage, + discount_amount=discount_amount, + total=total, + balance=balance, + deposit=deposit, + customer_memo=customer_memo, + tracking_category=utils.get_pydantic_model( + tracking_category, + OptionalNullable[models.DeprecatedLinkedTrackingCategory], + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + template_id=template_id, + source_document_url=source_document_url, + payment_method=payment_method, + channel=channel, + language=language, + accounting_by_row=accounting_by_row, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1683,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1766,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoicesDeleteResponse: r"""Delete Invoice @@ -975,6 +1778,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1805,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1885,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingInvoicesDeleteResponse: r"""Delete Invoice @@ -1091,6 +1897,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1924,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingInvoicesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/jobs.py b/src/apideck_unify/jobs.py index 733f1d4f..7c99862a 100644 --- a/src/apideck_unify/jobs.py +++ b/src/apideck_unify/jobs.py @@ -3,30 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional class Jobs(BaseSDK): def list( self, *, - request: Union[ - models.AtsJobsAllRequest, models.AtsJobsAllRequestTypedDict - ] = models.AtsJobsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AtsJobsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AtsJobsAllResponse]: r"""List Jobs List Jobs - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AtsJobsAllRequest) - request = cast(models.AtsJobsAllRequest, request) + request = models.AtsJobsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsJobsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +101,30 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AtsJobsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetJobsResponse) + return models.AtsJobsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetJobsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +148,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AtsJobsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +167,31 @@ def list( async def list_async( self, *, - request: Union[ - models.AtsJobsAllRequest, models.AtsJobsAllRequestTypedDict - ] = models.AtsJobsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AtsJobsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AtsJobsAllResponse]: r"""List Jobs List Jobs - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +201,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AtsJobsAllRequest) - request = cast(models.AtsJobsAllRequest, request) + request = models.AtsJobsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +221,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsJobsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +255,30 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AtsJobsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetJobsResponse) + return models.AtsJobsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetJobsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +302,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AtsJobsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -243,6 +328,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsJobsOneResponse: r"""Get Job @@ -255,6 +341,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -282,6 +369,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsJobsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -362,6 +450,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AtsJobsOneResponse: r"""Get Job @@ -374,6 +463,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -401,6 +491,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AtsJobsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/journalentries.py b/src/apideck_unify/journalentries.py index a2e4f19a..eee5737e 100644 --- a/src/apideck_unify/journalentries.py +++ b/src/apideck_unify/journalentries.py @@ -3,31 +3,50 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class JournalEntries(BaseSDK): def list( self, *, - request: Union[ - models.AccountingJournalEntriesAllRequest, - models.AccountingJournalEntriesAllRequestTypedDict, - ] = models.AccountingJournalEntriesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.JournalEntriesFilter, models.JournalEntriesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.JournalEntriesSort, models.JournalEntriesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingJournalEntriesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingJournalEntriesAllResponse]: r"""List Journal Entries List Journal Entries - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +56,18 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingJournalEntriesAllRequest - ) - request = cast(models.AccountingJournalEntriesAllRequest, request) + request = models.AccountingJournalEntriesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.JournalEntriesFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.JournalEntriesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -54,6 +80,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,9 +114,34 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingJournalEntriesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetJournalEntriesResponse) + return models.AccountingJournalEntriesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetJournalEntriesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -113,7 +165,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingJournalEntriesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +184,39 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingJournalEntriesAllRequest, - models.AccountingJournalEntriesAllRequestTypedDict, - ] = models.AccountingJournalEntriesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.JournalEntriesFilter, models.JournalEntriesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.JournalEntriesSort, models.JournalEntriesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingJournalEntriesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingJournalEntriesAllResponse]: r"""List Journal Entries List Journal Entries - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,11 +226,18 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingJournalEntriesAllRequest - ) - request = cast(models.AccountingJournalEntriesAllRequest, request) + request = models.AccountingJournalEntriesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.JournalEntriesFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.JournalEntriesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -169,6 +250,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -202,9 +284,34 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingJournalEntriesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetJournalEntriesResponse) + return models.AccountingJournalEntriesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetJournalEntriesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -228,7 +335,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingJournalEntriesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -242,25 +354,65 @@ async def list_async( def create( self, *, - journal_entry: Union[ - models.JournalEntryInput, models.JournalEntryInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + title: OptionalNullable[str] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + company_id: OptionalNullable[str] = UNSET, + line_items: Optional[ + Union[ + List[models.JournalEntryLineItemInput], + List[models.JournalEntryLineItemInputTypedDict], + ] + ] = None, + memo: OptionalNullable[str] = UNSET, + posted_at: Optional[datetime] = None, + journal_symbol: OptionalNullable[str] = UNSET, + tax_type: OptionalNullable[str] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + accounting_period: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingJournalEntriesAddResponse: r"""Create Journal Entry Create Journal Entry - :param journal_entry: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param title: Journal entry title + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param company_id: The company or subsidiary id the transaction belongs to + :param line_items: Requires a minimum of 2 line items that sum to 0 + :param memo: Reference for the journal entry. + :param posted_at: This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. + :param journal_symbol: Journal symbol of the entry. For example IND for indirect costs + :param tax_type: The specific category of tax associated with a transaction like sales or purchase + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param number: Journal entry number. + :param tracking_categories: A list of linked tracking categories. + :param accounting_period: Accounting period + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -273,8 +425,29 @@ def create( request = models.AccountingJournalEntriesAddRequest( raw=raw, service_id=service_id, - journal_entry=utils.get_pydantic_model( - journal_entry, models.JournalEntryInput + journal_entry=models.JournalEntryInput( + title=title, + currency_rate=currency_rate, + currency=currency, + company_id=company_id, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.JournalEntryLineItemInput]] + ), + memo=memo, + posted_at=posted_at, + journal_symbol=journal_symbol, + tax_type=tax_type, + tax_code=tax_code, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + accounting_period=accounting_period, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -289,6 +462,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -367,25 +541,65 @@ def create( async def create_async( self, *, - journal_entry: Union[ - models.JournalEntryInput, models.JournalEntryInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + title: OptionalNullable[str] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + company_id: OptionalNullable[str] = UNSET, + line_items: Optional[ + Union[ + List[models.JournalEntryLineItemInput], + List[models.JournalEntryLineItemInputTypedDict], + ] + ] = None, + memo: OptionalNullable[str] = UNSET, + posted_at: Optional[datetime] = None, + journal_symbol: OptionalNullable[str] = UNSET, + tax_type: OptionalNullable[str] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + accounting_period: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingJournalEntriesAddResponse: r"""Create Journal Entry Create Journal Entry - :param journal_entry: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param title: Journal entry title + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param company_id: The company or subsidiary id the transaction belongs to + :param line_items: Requires a minimum of 2 line items that sum to 0 + :param memo: Reference for the journal entry. + :param posted_at: This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. + :param journal_symbol: Journal symbol of the entry. For example IND for indirect costs + :param tax_type: The specific category of tax associated with a transaction like sales or purchase + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param number: Journal entry number. + :param tracking_categories: A list of linked tracking categories. + :param accounting_period: Accounting period + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -398,8 +612,29 @@ async def create_async( request = models.AccountingJournalEntriesAddRequest( raw=raw, service_id=service_id, - journal_entry=utils.get_pydantic_model( - journal_entry, models.JournalEntryInput + journal_entry=models.JournalEntryInput( + title=title, + currency_rate=currency_rate, + currency=currency, + company_id=company_id, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.JournalEntryLineItemInput]] + ), + memo=memo, + posted_at=posted_at, + journal_symbol=journal_symbol, + tax_type=tax_type, + tax_code=tax_code, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + accounting_period=accounting_period, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -414,6 +649,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -499,6 +735,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingJournalEntriesOneResponse: r"""Get Journal Entry @@ -511,6 +748,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -538,6 +776,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -618,6 +857,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingJournalEntriesOneResponse: r"""Get Journal Entry @@ -630,6 +870,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -657,6 +898,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -731,26 +973,66 @@ def update( self, *, id: str, - journal_entry: Union[ - models.JournalEntryInput, models.JournalEntryInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + title: OptionalNullable[str] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + company_id: OptionalNullable[str] = UNSET, + line_items: Optional[ + Union[ + List[models.JournalEntryLineItemInput], + List[models.JournalEntryLineItemInputTypedDict], + ] + ] = None, + memo: OptionalNullable[str] = UNSET, + posted_at: Optional[datetime] = None, + journal_symbol: OptionalNullable[str] = UNSET, + tax_type: OptionalNullable[str] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + accounting_period: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingJournalEntriesUpdateResponse: r"""Update Journal Entry Update Journal Entry :param id: ID of the record you are acting upon. - :param journal_entry: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param title: Journal entry title + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param company_id: The company or subsidiary id the transaction belongs to + :param line_items: Requires a minimum of 2 line items that sum to 0 + :param memo: Reference for the journal entry. + :param posted_at: This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. + :param journal_symbol: Journal symbol of the entry. For example IND for indirect costs + :param tax_type: The specific category of tax associated with a transaction like sales or purchase + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param number: Journal entry number. + :param tracking_categories: A list of linked tracking categories. + :param accounting_period: Accounting period + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -764,8 +1046,29 @@ def update( id=id, service_id=service_id, raw=raw, - journal_entry=utils.get_pydantic_model( - journal_entry, models.JournalEntryInput + journal_entry=models.JournalEntryInput( + title=title, + currency_rate=currency_rate, + currency=currency, + company_id=company_id, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.JournalEntryLineItemInput]] + ), + memo=memo, + posted_at=posted_at, + journal_symbol=journal_symbol, + tax_type=tax_type, + tax_code=tax_code, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + accounting_period=accounting_period, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -780,6 +1083,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -859,26 +1163,66 @@ async def update_async( self, *, id: str, - journal_entry: Union[ - models.JournalEntryInput, models.JournalEntryInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + title: OptionalNullable[str] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + company_id: OptionalNullable[str] = UNSET, + line_items: Optional[ + Union[ + List[models.JournalEntryLineItemInput], + List[models.JournalEntryLineItemInputTypedDict], + ] + ] = None, + memo: OptionalNullable[str] = UNSET, + posted_at: Optional[datetime] = None, + journal_symbol: OptionalNullable[str] = UNSET, + tax_type: OptionalNullable[str] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + accounting_period: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingJournalEntriesUpdateResponse: r"""Update Journal Entry Update Journal Entry :param id: ID of the record you are acting upon. - :param journal_entry: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param title: Journal entry title + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param company_id: The company or subsidiary id the transaction belongs to + :param line_items: Requires a minimum of 2 line items that sum to 0 + :param memo: Reference for the journal entry. + :param posted_at: This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. + :param journal_symbol: Journal symbol of the entry. For example IND for indirect costs + :param tax_type: The specific category of tax associated with a transaction like sales or purchase + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param number: Journal entry number. + :param tracking_categories: A list of linked tracking categories. + :param accounting_period: Accounting period + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -892,8 +1236,29 @@ async def update_async( id=id, service_id=service_id, raw=raw, - journal_entry=utils.get_pydantic_model( - journal_entry, models.JournalEntryInput + journal_entry=models.JournalEntryInput( + title=title, + currency_rate=currency_rate, + currency=currency, + company_id=company_id, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.JournalEntryLineItemInput]] + ), + memo=memo, + posted_at=posted_at, + journal_symbol=journal_symbol, + tax_type=tax_type, + tax_code=tax_code, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + accounting_period=accounting_period, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -908,6 +1273,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -992,6 +1358,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingJournalEntriesDeleteResponse: r"""Delete Journal Entry @@ -1003,6 +1370,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1029,6 +1397,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1110,6 +1479,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingJournalEntriesDeleteResponse: r"""Delete Journal Entry @@ -1121,6 +1491,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1147,6 +1518,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingJournalEntriesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/leads.py b/src/apideck_unify/leads.py index 4f6e5bac..3db8f5d8 100644 --- a/src/apideck_unify/leads.py +++ b/src/apideck_unify/leads.py @@ -3,30 +3,47 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Leads(BaseSDK): def list( self, *, - request: Union[ - models.CrmLeadsAllRequest, models.CrmLeadsAllRequestTypedDict - ] = models.CrmLeadsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.LeadsFilter, models.LeadsFilterTypedDict] + ] = None, + sort: Optional[Union[models.LeadsSort, models.LeadsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmLeadsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmLeadsAllResponse]: r"""List leads List leads - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +53,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmLeadsAllRequest) - request = cast(models.CrmLeadsAllRequest, request) + request = models.CrmLeadsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.LeadsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.LeadsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +75,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +109,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmLeadsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetLeadsResponse) + return models.CrmLeadsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetLeadsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +158,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmLeadsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +177,37 @@ def list( async def list_async( self, *, - request: Union[ - models.CrmLeadsAllRequest, models.CrmLeadsAllRequestTypedDict - ] = models.CrmLeadsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.LeadsFilter, models.LeadsFilterTypedDict] + ] = None, + sort: Optional[Union[models.LeadsSort, models.LeadsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmLeadsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmLeadsAllResponse]: r"""List leads List leads - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +217,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmLeadsAllRequest) - request = cast(models.CrmLeadsAllRequest, request) + request = models.CrmLeadsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.LeadsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.LeadsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +239,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +273,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmLeadsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetLeadsResponse) + return models.CrmLeadsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetLeadsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +322,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmLeadsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +341,85 @@ async def list_async( def create( self, *, - lead: Union[models.LeadInput, models.LeadInputTypedDict], + name: str, + company_name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + owner_id: OptionalNullable[str] = UNSET, + owner_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + prefix: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + monetary_amount: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + fax: OptionalNullable[str] = UNSET, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmLeadsAddResponse: r"""Create lead Create lead - :param lead: + :param name: Full name of the lead. + :param company_name: The name of the company the lead is associated with. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param owner_id: The owner of the lead. + :param owner_name: The name of the owner of the lead. + :param company_id: The company the lead is associated with. + :param lead_id: The identifier of the lead. + :param lead_source: The source of the lead. + :param first_name: The first name of the lead. + :param last_name: The last name of the lead. + :param description: The description of the lead. + :param prefix: The prefix of the lead. + :param title: The job title of the lead. + :param language: language code according to ISO 639-1. For the United States - EN + :param status: + :param monetary_amount: The monetary amount of the lead. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param fax: The fax number of the lead. + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param custom_fields: + :param tags: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +432,45 @@ def create( request = models.CrmLeadsAddRequest( raw=raw, service_id=service_id, - lead=utils.get_pydantic_model(lead, models.LeadInput), + lead=models.LeadInput( + name=name, + company_name=company_name, + owner_id=owner_id, + owner_name=owner_name, + company_id=company_id, + lead_id=lead_id, + lead_source=lead_source, + first_name=first_name, + last_name=last_name, + description=description, + prefix=prefix, + title=title, + language=language, + status=status, + monetary_amount=monetary_amount, + currency=currency, + fax=fax, + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +484,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +561,85 @@ def create( async def create_async( self, *, - lead: Union[models.LeadInput, models.LeadInputTypedDict], + name: str, + company_name: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + owner_id: OptionalNullable[str] = UNSET, + owner_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + prefix: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + monetary_amount: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + fax: OptionalNullable[str] = UNSET, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmLeadsAddResponse: r"""Create lead Create lead - :param lead: + :param name: Full name of the lead. + :param company_name: The name of the company the lead is associated with. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param owner_id: The owner of the lead. + :param owner_name: The name of the owner of the lead. + :param company_id: The company the lead is associated with. + :param lead_id: The identifier of the lead. + :param lead_source: The source of the lead. + :param first_name: The first name of the lead. + :param last_name: The last name of the lead. + :param description: The description of the lead. + :param prefix: The prefix of the lead. + :param title: The job title of the lead. + :param language: language code according to ISO 639-1. For the United States - EN + :param status: + :param monetary_amount: The monetary amount of the lead. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param fax: The fax number of the lead. + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param custom_fields: + :param tags: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +652,45 @@ async def create_async( request = models.CrmLeadsAddRequest( raw=raw, service_id=service_id, - lead=utils.get_pydantic_model(lead, models.LeadInput), + lead=models.LeadInput( + name=name, + company_name=company_name, + owner_id=owner_id, + owner_name=owner_name, + company_id=company_id, + lead_id=lead_id, + lead_source=lead_source, + first_name=first_name, + last_name=last_name, + description=description, + prefix=prefix, + title=title, + language=language, + status=status, + monetary_amount=monetary_amount, + currency=currency, + fax=fax, + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +704,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +788,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmLeadsOneResponse: r"""Get lead @@ -493,6 +801,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +829,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +910,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmLeadsOneResponse: r"""Get lead @@ -612,6 +923,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +951,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +1026,86 @@ def update( self, *, id: str, - lead: Union[models.LeadInput, models.LeadInputTypedDict], + name: str, + company_name: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + owner_id: OptionalNullable[str] = UNSET, + owner_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + prefix: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + monetary_amount: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + fax: OptionalNullable[str] = UNSET, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmLeadsUpdateResponse: r"""Update lead Update lead :param id: ID of the record you are acting upon. - :param lead: + :param name: Full name of the lead. + :param company_name: The name of the company the lead is associated with. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param owner_id: The owner of the lead. + :param owner_name: The name of the owner of the lead. + :param company_id: The company the lead is associated with. + :param lead_id: The identifier of the lead. + :param lead_source: The source of the lead. + :param first_name: The first name of the lead. + :param last_name: The last name of the lead. + :param description: The description of the lead. + :param prefix: The prefix of the lead. + :param title: The job title of the lead. + :param language: language code according to ISO 639-1. For the United States - EN + :param status: + :param monetary_amount: The monetary amount of the lead. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param fax: The fax number of the lead. + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param custom_fields: + :param tags: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +1119,45 @@ def update( id=id, service_id=service_id, raw=raw, - lead=utils.get_pydantic_model(lead, models.LeadInput), + lead=models.LeadInput( + name=name, + company_name=company_name, + owner_id=owner_id, + owner_name=owner_name, + company_id=company_id, + lead_id=lead_id, + lead_source=lead_source, + first_name=first_name, + last_name=last_name, + description=description, + prefix=prefix, + title=title, + language=language, + status=status, + monetary_amount=monetary_amount, + currency=currency, + fax=fax, + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +1171,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +1249,86 @@ async def update_async( self, *, id: str, - lead: Union[models.LeadInput, models.LeadInputTypedDict], + name: str, + company_name: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + owner_id: OptionalNullable[str] = UNSET, + owner_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + prefix: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + monetary_amount: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + fax: OptionalNullable[str] = UNSET, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + social_links: Optional[ + Union[List[models.SocialLink], List[models.SocialLinkTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + tags: OptionalNullable[List[str]] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmLeadsUpdateResponse: r"""Update lead Update lead :param id: ID of the record you are acting upon. - :param lead: + :param name: Full name of the lead. + :param company_name: The name of the company the lead is associated with. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param owner_id: The owner of the lead. + :param owner_name: The name of the owner of the lead. + :param company_id: The company the lead is associated with. + :param lead_id: The identifier of the lead. + :param lead_source: The source of the lead. + :param first_name: The first name of the lead. + :param last_name: The last name of the lead. + :param description: The description of the lead. + :param prefix: The prefix of the lead. + :param title: The job title of the lead. + :param language: language code according to ISO 639-1. For the United States - EN + :param status: + :param monetary_amount: The monetary amount of the lead. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param fax: The fax number of the lead. + :param websites: + :param addresses: + :param social_links: + :param phone_numbers: + :param emails: + :param custom_fields: + :param tags: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1342,45 @@ async def update_async( id=id, service_id=service_id, raw=raw, - lead=utils.get_pydantic_model(lead, models.LeadInput), + lead=models.LeadInput( + name=name, + company_name=company_name, + owner_id=owner_id, + owner_name=owner_name, + company_id=company_id, + lead_id=lead_id, + lead_source=lead_source, + first_name=first_name, + last_name=last_name, + description=description, + prefix=prefix, + title=title, + language=language, + status=status, + monetary_amount=monetary_amount, + currency=currency, + fax=fax, + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + social_links=utils.get_pydantic_model( + social_links, Optional[List[models.SocialLink]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + tags=tags, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1394,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1477,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmLeadsDeleteResponse: r"""Delete lead @@ -973,6 +1489,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1516,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1596,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmLeadsDeleteResponse: r"""Delete lead @@ -1089,6 +1608,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1635,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmLeadsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/ledgeraccounts.py b/src/apideck_unify/ledgeraccounts.py index 28f9821c..2642b7da 100644 --- a/src/apideck_unify/ledgeraccounts.py +++ b/src/apideck_unify/ledgeraccounts.py @@ -3,31 +3,50 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class LedgerAccounts(BaseSDK): def list( self, *, - request: Union[ - models.AccountingLedgerAccountsAllRequest, - models.AccountingLedgerAccountsAllRequestTypedDict, - ] = models.AccountingLedgerAccountsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.LedgerAccountsFilter, models.LedgerAccountsFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.LedgerAccountsSort, models.LedgerAccountsSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingLedgerAccountsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingLedgerAccountsAllResponse]: r"""List Ledger Accounts List Ledger Accounts - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +56,18 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingLedgerAccountsAllRequest - ) - request = cast(models.AccountingLedgerAccountsAllRequest, request) + request = models.AccountingLedgerAccountsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.LedgerAccountsFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.LedgerAccountsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -54,6 +80,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,9 +114,34 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingLedgerAccountsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetLedgerAccountsResponse) + return models.AccountingLedgerAccountsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetLedgerAccountsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -113,7 +165,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingLedgerAccountsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +184,39 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingLedgerAccountsAllRequest, - models.AccountingLedgerAccountsAllRequestTypedDict, - ] = models.AccountingLedgerAccountsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.LedgerAccountsFilter, models.LedgerAccountsFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.LedgerAccountsSort, models.LedgerAccountsSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingLedgerAccountsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingLedgerAccountsAllResponse]: r"""List Ledger Accounts List Ledger Accounts - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,11 +226,18 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingLedgerAccountsAllRequest - ) - request = cast(models.AccountingLedgerAccountsAllRequest, request) + request = models.AccountingLedgerAccountsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.LedgerAccountsFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.LedgerAccountsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -169,6 +250,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -202,9 +284,34 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingLedgerAccountsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetLedgerAccountsResponse) + return models.AccountingLedgerAccountsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetLedgerAccountsResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -228,7 +335,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingLedgerAccountsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -242,25 +354,86 @@ async def list_async( def create( self, *, - ledger_account: Union[ - models.LedgerAccountInput, models.LedgerAccountInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + display_id: Optional[str] = None, + nominal_code: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + classification: OptionalNullable[models.Classification] = UNSET, + type_: Optional[models.LedgerAccountType] = None, + sub_type: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + fully_qualified_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + opening_balance: OptionalNullable[float] = UNSET, + current_balance: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + tax_type: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + level: OptionalNullable[float] = UNSET, + active: OptionalNullable[bool] = UNSET, + status: OptionalNullable[models.AccountStatus] = UNSET, + header: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + parent_account: Optional[ + Union[models.ParentAccount, models.ParentAccountTypedDict] + ] = None, + sub_account: OptionalNullable[bool] = UNSET, + last_reconciliation_date: OptionalNullable[date] = UNSET, + subsidiaries: Optional[ + Union[ + List[models.LedgerAccountSubsidiaries], + List[models.LedgerAccountSubsidiariesTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLedgerAccountsAddResponse: r"""Create Ledger Account Create Ledger Account - :param ledger_account: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_id: The human readable display ID used when displaying the account + :param nominal_code: The nominal code of the ledger account. + :param code: The code assigned to the account. + :param classification: The classification of account. + :param type: The type of account. + :param sub_type: The sub type of account. + :param name: The name of the account. + :param fully_qualified_name: The fully qualified name of the account. + :param description: The description of the account. + :param opening_balance: The opening balance of the account. + :param current_balance: The current balance of the account. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param tax_type: The tax type of the account. + :param tax_rate: + :param level: + :param active: Whether the account is active or not. + :param status: The status of the account. + :param header: Whether the account is a header or not. + :param bank_account: + :param parent_account: + :param sub_account: Whether the account is a sub account or not. + :param last_reconciliation_date: Reconciliation Date means the last calendar day of each Reconciliation Period. + :param subsidiaries: The subsidiaries the account belongs to. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -273,8 +446,42 @@ def create( request = models.AccountingLedgerAccountsAddRequest( raw=raw, service_id=service_id, - ledger_account=utils.get_pydantic_model( - ledger_account, models.LedgerAccountInput + ledger_account=models.LedgerAccountInput( + display_id=display_id, + nominal_code=nominal_code, + code=code, + classification=classification, + type=type_, + sub_type=sub_type, + name=name, + fully_qualified_name=fully_qualified_name, + description=description, + opening_balance=opening_balance, + current_balance=current_balance, + currency=currency, + tax_type=tax_type, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + level=level, + active=active, + status=status, + header=header, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + parent_account=utils.get_pydantic_model( + parent_account, Optional[models.ParentAccount] + ), + sub_account=sub_account, + last_reconciliation_date=last_reconciliation_date, + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.LedgerAccountSubsidiaries]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -289,6 +496,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -367,25 +575,86 @@ def create( async def create_async( self, *, - ledger_account: Union[ - models.LedgerAccountInput, models.LedgerAccountInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + display_id: Optional[str] = None, + nominal_code: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + classification: OptionalNullable[models.Classification] = UNSET, + type_: Optional[models.LedgerAccountType] = None, + sub_type: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + fully_qualified_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + opening_balance: OptionalNullable[float] = UNSET, + current_balance: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + tax_type: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + level: OptionalNullable[float] = UNSET, + active: OptionalNullable[bool] = UNSET, + status: OptionalNullable[models.AccountStatus] = UNSET, + header: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + parent_account: Optional[ + Union[models.ParentAccount, models.ParentAccountTypedDict] + ] = None, + sub_account: OptionalNullable[bool] = UNSET, + last_reconciliation_date: OptionalNullable[date] = UNSET, + subsidiaries: Optional[ + Union[ + List[models.LedgerAccountSubsidiaries], + List[models.LedgerAccountSubsidiariesTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLedgerAccountsAddResponse: r"""Create Ledger Account Create Ledger Account - :param ledger_account: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_id: The human readable display ID used when displaying the account + :param nominal_code: The nominal code of the ledger account. + :param code: The code assigned to the account. + :param classification: The classification of account. + :param type: The type of account. + :param sub_type: The sub type of account. + :param name: The name of the account. + :param fully_qualified_name: The fully qualified name of the account. + :param description: The description of the account. + :param opening_balance: The opening balance of the account. + :param current_balance: The current balance of the account. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param tax_type: The tax type of the account. + :param tax_rate: + :param level: + :param active: Whether the account is active or not. + :param status: The status of the account. + :param header: Whether the account is a header or not. + :param bank_account: + :param parent_account: + :param sub_account: Whether the account is a sub account or not. + :param last_reconciliation_date: Reconciliation Date means the last calendar day of each Reconciliation Period. + :param subsidiaries: The subsidiaries the account belongs to. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -398,8 +667,42 @@ async def create_async( request = models.AccountingLedgerAccountsAddRequest( raw=raw, service_id=service_id, - ledger_account=utils.get_pydantic_model( - ledger_account, models.LedgerAccountInput + ledger_account=models.LedgerAccountInput( + display_id=display_id, + nominal_code=nominal_code, + code=code, + classification=classification, + type=type_, + sub_type=sub_type, + name=name, + fully_qualified_name=fully_qualified_name, + description=description, + opening_balance=opening_balance, + current_balance=current_balance, + currency=currency, + tax_type=tax_type, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + level=level, + active=active, + status=status, + header=header, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + parent_account=utils.get_pydantic_model( + parent_account, Optional[models.ParentAccount] + ), + sub_account=sub_account, + last_reconciliation_date=last_reconciliation_date, + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.LedgerAccountSubsidiaries]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -414,6 +717,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -499,6 +803,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLedgerAccountsOneResponse: r"""Get Ledger Account @@ -511,6 +816,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -538,6 +844,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -618,6 +925,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLedgerAccountsOneResponse: r"""Get Ledger Account @@ -630,6 +938,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -657,6 +966,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -731,26 +1041,87 @@ def update( self, *, id: str, - ledger_account: Union[ - models.LedgerAccountInput, models.LedgerAccountInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + display_id: Optional[str] = None, + nominal_code: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + classification: OptionalNullable[models.Classification] = UNSET, + type_: Optional[models.LedgerAccountType] = None, + sub_type: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + fully_qualified_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + opening_balance: OptionalNullable[float] = UNSET, + current_balance: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + tax_type: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + level: OptionalNullable[float] = UNSET, + active: OptionalNullable[bool] = UNSET, + status: OptionalNullable[models.AccountStatus] = UNSET, + header: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + parent_account: Optional[ + Union[models.ParentAccount, models.ParentAccountTypedDict] + ] = None, + sub_account: OptionalNullable[bool] = UNSET, + last_reconciliation_date: OptionalNullable[date] = UNSET, + subsidiaries: Optional[ + Union[ + List[models.LedgerAccountSubsidiaries], + List[models.LedgerAccountSubsidiariesTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLedgerAccountsUpdateResponse: r"""Update Ledger Account Update Ledger Account :param id: ID of the record you are acting upon. - :param ledger_account: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_id: The human readable display ID used when displaying the account + :param nominal_code: The nominal code of the ledger account. + :param code: The code assigned to the account. + :param classification: The classification of account. + :param type: The type of account. + :param sub_type: The sub type of account. + :param name: The name of the account. + :param fully_qualified_name: The fully qualified name of the account. + :param description: The description of the account. + :param opening_balance: The opening balance of the account. + :param current_balance: The current balance of the account. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param tax_type: The tax type of the account. + :param tax_rate: + :param level: + :param active: Whether the account is active or not. + :param status: The status of the account. + :param header: Whether the account is a header or not. + :param bank_account: + :param parent_account: + :param sub_account: Whether the account is a sub account or not. + :param last_reconciliation_date: Reconciliation Date means the last calendar day of each Reconciliation Period. + :param subsidiaries: The subsidiaries the account belongs to. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -764,8 +1135,42 @@ def update( id=id, service_id=service_id, raw=raw, - ledger_account=utils.get_pydantic_model( - ledger_account, models.LedgerAccountInput + ledger_account=models.LedgerAccountInput( + display_id=display_id, + nominal_code=nominal_code, + code=code, + classification=classification, + type=type_, + sub_type=sub_type, + name=name, + fully_qualified_name=fully_qualified_name, + description=description, + opening_balance=opening_balance, + current_balance=current_balance, + currency=currency, + tax_type=tax_type, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + level=level, + active=active, + status=status, + header=header, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + parent_account=utils.get_pydantic_model( + parent_account, Optional[models.ParentAccount] + ), + sub_account=sub_account, + last_reconciliation_date=last_reconciliation_date, + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.LedgerAccountSubsidiaries]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -780,6 +1185,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -859,26 +1265,87 @@ async def update_async( self, *, id: str, - ledger_account: Union[ - models.LedgerAccountInput, models.LedgerAccountInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + display_id: Optional[str] = None, + nominal_code: OptionalNullable[str] = UNSET, + code: OptionalNullable[str] = UNSET, + classification: OptionalNullable[models.Classification] = UNSET, + type_: Optional[models.LedgerAccountType] = None, + sub_type: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + fully_qualified_name: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + opening_balance: OptionalNullable[float] = UNSET, + current_balance: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + tax_type: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + level: OptionalNullable[float] = UNSET, + active: OptionalNullable[bool] = UNSET, + status: OptionalNullable[models.AccountStatus] = UNSET, + header: OptionalNullable[bool] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + parent_account: Optional[ + Union[models.ParentAccount, models.ParentAccountTypedDict] + ] = None, + sub_account: OptionalNullable[bool] = UNSET, + last_reconciliation_date: OptionalNullable[date] = UNSET, + subsidiaries: Optional[ + Union[ + List[models.LedgerAccountSubsidiaries], + List[models.LedgerAccountSubsidiariesTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLedgerAccountsUpdateResponse: r"""Update Ledger Account Update Ledger Account :param id: ID of the record you are acting upon. - :param ledger_account: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_id: The human readable display ID used when displaying the account + :param nominal_code: The nominal code of the ledger account. + :param code: The code assigned to the account. + :param classification: The classification of account. + :param type: The type of account. + :param sub_type: The sub type of account. + :param name: The name of the account. + :param fully_qualified_name: The fully qualified name of the account. + :param description: The description of the account. + :param opening_balance: The opening balance of the account. + :param current_balance: The current balance of the account. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param tax_type: The tax type of the account. + :param tax_rate: + :param level: + :param active: Whether the account is active or not. + :param status: The status of the account. + :param header: Whether the account is a header or not. + :param bank_account: + :param parent_account: + :param sub_account: Whether the account is a sub account or not. + :param last_reconciliation_date: Reconciliation Date means the last calendar day of each Reconciliation Period. + :param subsidiaries: The subsidiaries the account belongs to. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -892,8 +1359,42 @@ async def update_async( id=id, service_id=service_id, raw=raw, - ledger_account=utils.get_pydantic_model( - ledger_account, models.LedgerAccountInput + ledger_account=models.LedgerAccountInput( + display_id=display_id, + nominal_code=nominal_code, + code=code, + classification=classification, + type=type_, + sub_type=sub_type, + name=name, + fully_qualified_name=fully_qualified_name, + description=description, + opening_balance=opening_balance, + current_balance=current_balance, + currency=currency, + tax_type=tax_type, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + level=level, + active=active, + status=status, + header=header, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + parent_account=utils.get_pydantic_model( + parent_account, Optional[models.ParentAccount] + ), + sub_account=sub_account, + last_reconciliation_date=last_reconciliation_date, + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.LedgerAccountSubsidiaries]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -908,6 +1409,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -992,6 +1494,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLedgerAccountsDeleteResponse: r"""Delete Ledger Account @@ -1003,6 +1506,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1029,6 +1533,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1110,6 +1615,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLedgerAccountsDeleteResponse: r"""Delete Ledger Account @@ -1121,6 +1627,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1147,6 +1654,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLedgerAccountsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/locations.py b/src/apideck_unify/locations.py index 8964b964..ab236123 100644 --- a/src/apideck_unify/locations.py +++ b/src/apideck_unify/locations.py @@ -3,31 +3,46 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Locations(BaseSDK): def list( self, *, - request: Union[ - models.AccountingLocationsAllRequest, - models.AccountingLocationsAllRequestTypedDict, - ] = models.AccountingLocationsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[ + models.AccountingLocationsFilter, + models.AccountingLocationsFilterTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingLocationsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingLocationsAllResponse]: r"""List Locations List Locations - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. + :param filter_: Apply filters :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +52,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingLocationsAllRequest) - request = cast(models.AccountingLocationsAllRequest, request) + request = models.AccountingLocationsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + filter_=utils.get_pydantic_model( + filter_, Optional[models.AccountingLocationsFilter] + ), + ) req = self.build_request( method="GET", @@ -52,6 +74,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,10 +108,31 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingLocationsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetAccountingLocationsResponse + return models.AccountingLocationsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetAccountingLocationsResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -113,7 +157,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingLocationsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +176,36 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingLocationsAllRequest, - models.AccountingLocationsAllRequestTypedDict, - ] = models.AccountingLocationsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, + filter_: Optional[ + Union[ + models.AccountingLocationsFilter, + models.AccountingLocationsFilterTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingLocationsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingLocationsAllResponse]: r"""List Locations List Locations - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. + :param filter_: Apply filters :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,9 +215,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingLocationsAllRequest) - request = cast(models.AccountingLocationsAllRequest, request) + request = models.AccountingLocationsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + filter_=utils.get_pydantic_model( + filter_, Optional[models.AccountingLocationsFilter] + ), + ) req = self.build_request_async( method="GET", @@ -167,6 +237,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -200,10 +271,31 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingLocationsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + filter_=filter_, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetAccountingLocationsResponse + return models.AccountingLocationsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetAccountingLocationsResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -228,7 +320,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingLocationsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -242,25 +339,48 @@ async def list_async( def create( self, *, - accounting_location: Union[ - models.AccountingLocationInput, models.AccountingLocationInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + status: Optional[models.LocationStatus] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiaryReferenceInput], + List[models.SubsidiaryReferenceInputTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLocationsAddResponse: r"""Create Location Create Location - :param accounting_location: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: A unique identifier for an object. + :param company_name: The name of the company. + :param display_name: The display name of the location. + :param status: Based on the status some functionality is enabled or disabled. + :param addresses: + :param subsidiaries: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -273,8 +393,21 @@ def create( request = models.AccountingLocationsAddRequest( raw=raw, service_id=service_id, - accounting_location=utils.get_pydantic_model( - accounting_location, models.AccountingLocationInput + accounting_location=models.AccountingLocationInput( + parent_id=parent_id, + company_name=company_name, + display_name=display_name, + status=status, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiaryReferenceInput]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -289,6 +422,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -371,25 +505,48 @@ def create( async def create_async( self, *, - accounting_location: Union[ - models.AccountingLocationInput, models.AccountingLocationInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + status: Optional[models.LocationStatus] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiaryReferenceInput], + List[models.SubsidiaryReferenceInputTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLocationsAddResponse: r"""Create Location Create Location - :param accounting_location: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: A unique identifier for an object. + :param company_name: The name of the company. + :param display_name: The display name of the location. + :param status: Based on the status some functionality is enabled or disabled. + :param addresses: + :param subsidiaries: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -402,8 +559,21 @@ async def create_async( request = models.AccountingLocationsAddRequest( raw=raw, service_id=service_id, - accounting_location=utils.get_pydantic_model( - accounting_location, models.AccountingLocationInput + accounting_location=models.AccountingLocationInput( + parent_id=parent_id, + company_name=company_name, + display_name=display_name, + status=status, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiaryReferenceInput]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -418,6 +588,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -507,6 +678,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLocationsOneResponse: r"""Get Location @@ -519,6 +691,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -546,6 +719,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -628,6 +802,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLocationsOneResponse: r"""Get Location @@ -640,6 +815,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -667,6 +843,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -743,26 +920,49 @@ def update( self, *, id: str, - accounting_location: Union[ - models.AccountingLocationInput, models.AccountingLocationInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + status: Optional[models.LocationStatus] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiaryReferenceInput], + List[models.SubsidiaryReferenceInputTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLocationsUpdateResponse: r"""Update Location Update Location :param id: ID of the record you are acting upon. - :param accounting_location: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: A unique identifier for an object. + :param company_name: The name of the company. + :param display_name: The display name of the location. + :param status: Based on the status some functionality is enabled or disabled. + :param addresses: + :param subsidiaries: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -776,8 +976,21 @@ def update( id=id, service_id=service_id, raw=raw, - accounting_location=utils.get_pydantic_model( - accounting_location, models.AccountingLocationInput + accounting_location=models.AccountingLocationInput( + parent_id=parent_id, + company_name=company_name, + display_name=display_name, + status=status, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiaryReferenceInput]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -792,6 +1005,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -875,26 +1089,49 @@ async def update_async( self, *, id: str, - accounting_location: Union[ - models.AccountingLocationInput, models.AccountingLocationInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + status: Optional[models.LocationStatus] = None, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiaryReferenceInput], + List[models.SubsidiaryReferenceInputTypedDict], + ] + ] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLocationsUpdateResponse: r"""Update Location Update Location :param id: ID of the record you are acting upon. - :param accounting_location: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: A unique identifier for an object. + :param company_name: The name of the company. + :param display_name: The display name of the location. + :param status: Based on the status some functionality is enabled or disabled. + :param addresses: + :param subsidiaries: + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -908,8 +1145,21 @@ async def update_async( id=id, service_id=service_id, raw=raw, - accounting_location=utils.get_pydantic_model( - accounting_location, models.AccountingLocationInput + accounting_location=models.AccountingLocationInput( + parent_id=parent_id, + company_name=company_name, + display_name=display_name, + status=status, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiaryReferenceInput]] + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -924,6 +1174,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1012,6 +1263,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLocationsDeleteResponse: r"""Delete Location @@ -1023,6 +1275,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1049,6 +1302,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1130,6 +1384,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingLocationsDeleteResponse: r"""Delete Location @@ -1141,6 +1396,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1167,6 +1423,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingLocationsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/logs.py b/src/apideck_unify/logs.py index 00843b57..d9954e72 100644 --- a/src/apideck_unify/logs.py +++ b/src/apideck_unify/logs.py @@ -5,7 +5,8 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional, Union class Logs(BaseSDK): @@ -18,7 +19,8 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.VaultLogsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.VaultLogsAllResponse]: r"""Get all consumer request logs This endpoint includes all consumer request logs. @@ -30,6 +32,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -56,6 +59,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultLogsAllGlobals( app_id=self.sdk_configuration.globals.app_id, consumer_id=self.sdk_configuration.globals.consumer_id, @@ -89,9 +93,27 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.VaultLogsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + filter_=filter_, + cursor=next_cursor, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetLogsResponse) + return models.VaultLogsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetLogsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -115,7 +137,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.VaultLogsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -135,7 +162,8 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.VaultLogsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.VaultLogsAllResponse]: r"""Get all consumer request logs This endpoint includes all consumer request logs. @@ -147,6 +175,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -173,6 +202,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultLogsAllGlobals( app_id=self.sdk_configuration.globals.app_id, consumer_id=self.sdk_configuration.globals.consumer_id, @@ -206,9 +236,27 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.VaultLogsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + filter_=filter_, + cursor=next_cursor, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetLogsResponse) + return models.VaultLogsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetLogsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -232,7 +280,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.VaultLogsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) diff --git a/src/apideck_unify/messages.py b/src/apideck_unify/messages.py index 270275c3..3d17d1a6 100644 --- a/src/apideck_unify/messages.py +++ b/src/apideck_unify/messages.py @@ -3,30 +3,40 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Messages(BaseSDK): def list( self, *, - request: Union[ - models.SmsMessagesAllRequest, models.SmsMessagesAllRequestTypedDict - ] = models.SmsMessagesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.SmsMessagesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.SmsMessagesAllResponse]: r"""List Messages List Messages - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +46,13 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.SmsMessagesAllRequest) - request = cast(models.SmsMessagesAllRequest, request) + request = models.SmsMessagesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +65,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +99,29 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.SmsMessagesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetMessagesResponse) + return models.SmsMessagesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetMessagesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +145,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.SmsMessagesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +164,29 @@ def list( async def list_async( self, *, - request: Union[ - models.SmsMessagesAllRequest, models.SmsMessagesAllRequestTypedDict - ] = models.SmsMessagesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.SmsMessagesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.SmsMessagesAllResponse]: r"""List Messages List Messages - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +196,13 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.SmsMessagesAllRequest) - request = cast(models.SmsMessagesAllRequest, request) + request = models.SmsMessagesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +215,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +249,29 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.SmsMessagesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetMessagesResponse) + return models.SmsMessagesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetMessagesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +295,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.SmsMessagesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +314,45 @@ async def list_async( def create( self, *, - message: Union[models.MessageInput, models.MessageInputTypedDict], + from_: str, + to: str, + body: str, raw: Optional[bool] = False, service_id: Optional[str] = None, + subject: Optional[str] = None, + type_: Optional[models.MessageType] = None, + scheduled_at: Optional[datetime] = None, + webhook_url: Optional[str] = None, + reference: Optional[str] = None, + messaging_service_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.SmsMessagesAddResponse: r"""Create Message Create Message - :param message: + :param from_: The phone number that initiated the message. + :param to: The phone number that received the message. + :param body: The message text. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param subject: + :param type: Set to sms for SMS messages and mms for MMS messages. + :param scheduled_at: The scheduled date and time of the message. + :param webhook_url: Define a webhook to receive delivery notifications. + :param reference: A client reference. + :param messaging_service_id: The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +365,20 @@ def create( request = models.SmsMessagesAddRequest( raw=raw, service_id=service_id, - message=utils.get_pydantic_model(message, models.MessageInput), + message=models.MessageInput( + from_=from_, + to=to, + subject=subject, + body=body, + type=type_, + scheduled_at=scheduled_at, + webhook_url=webhook_url, + reference=reference, + messaging_service_id=messaging_service_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +392,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +469,45 @@ def create( async def create_async( self, *, - message: Union[models.MessageInput, models.MessageInputTypedDict], + from_: str, + to: str, + body: str, raw: Optional[bool] = False, service_id: Optional[str] = None, + subject: Optional[str] = None, + type_: Optional[models.MessageType] = None, + scheduled_at: Optional[datetime] = None, + webhook_url: Optional[str] = None, + reference: Optional[str] = None, + messaging_service_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.SmsMessagesAddResponse: r"""Create Message Create Message - :param message: + :param from_: The phone number that initiated the message. + :param to: The phone number that received the message. + :param body: The message text. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param subject: + :param type: Set to sms for SMS messages and mms for MMS messages. + :param scheduled_at: The scheduled date and time of the message. + :param webhook_url: Define a webhook to receive delivery notifications. + :param reference: A client reference. + :param messaging_service_id: The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +520,20 @@ async def create_async( request = models.SmsMessagesAddRequest( raw=raw, service_id=service_id, - message=utils.get_pydantic_model(message, models.MessageInput), + message=models.MessageInput( + from_=from_, + to=to, + subject=subject, + body=body, + type=type_, + scheduled_at=scheduled_at, + webhook_url=webhook_url, + reference=reference, + messaging_service_id=messaging_service_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +547,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +631,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.SmsMessagesOneResponse: r"""Get Message @@ -493,6 +644,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +672,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +753,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.SmsMessagesOneResponse: r"""Get Message @@ -612,6 +766,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +794,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +869,46 @@ def update( self, *, id: str, - message: Union[models.MessageInput, models.MessageInputTypedDict], + from_: str, + to: str, + body: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + subject: Optional[str] = None, + type_: Optional[models.MessageType] = None, + scheduled_at: Optional[datetime] = None, + webhook_url: Optional[str] = None, + reference: Optional[str] = None, + messaging_service_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.SmsMessagesUpdateResponse: r"""Update Message Update Message :param id: ID of the record you are acting upon. - :param message: + :param from_: The phone number that initiated the message. + :param to: The phone number that received the message. + :param body: The message text. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param subject: + :param type: Set to sms for SMS messages and mms for MMS messages. + :param scheduled_at: The scheduled date and time of the message. + :param webhook_url: Define a webhook to receive delivery notifications. + :param reference: A client reference. + :param messaging_service_id: The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +922,20 @@ def update( id=id, service_id=service_id, raw=raw, - message=utils.get_pydantic_model(message, models.MessageInput), + message=models.MessageInput( + from_=from_, + to=to, + subject=subject, + body=body, + type=type_, + scheduled_at=scheduled_at, + webhook_url=webhook_url, + reference=reference, + messaging_service_id=messaging_service_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +949,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +1027,46 @@ async def update_async( self, *, id: str, - message: Union[models.MessageInput, models.MessageInputTypedDict], + from_: str, + to: str, + body: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + subject: Optional[str] = None, + type_: Optional[models.MessageType] = None, + scheduled_at: Optional[datetime] = None, + webhook_url: Optional[str] = None, + reference: Optional[str] = None, + messaging_service_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.SmsMessagesUpdateResponse: r"""Update Message Update Message :param id: ID of the record you are acting upon. - :param message: + :param from_: The phone number that initiated the message. + :param to: The phone number that received the message. + :param body: The message text. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param subject: + :param type: Set to sms for SMS messages and mms for MMS messages. + :param scheduled_at: The scheduled date and time of the message. + :param webhook_url: Define a webhook to receive delivery notifications. + :param reference: A client reference. + :param messaging_service_id: The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1080,20 @@ async def update_async( id=id, service_id=service_id, raw=raw, - message=utils.get_pydantic_model(message, models.MessageInput), + message=models.MessageInput( + from_=from_, + to=to, + subject=subject, + body=body, + type=type_, + scheduled_at=scheduled_at, + webhook_url=webhook_url, + reference=reference, + messaging_service_id=messaging_service_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1107,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1190,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.SmsMessagesDeleteResponse: r"""Delete Message @@ -973,6 +1202,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1229,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1309,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.SmsMessagesDeleteResponse: r"""Delete Message @@ -1089,6 +1321,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1348,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.SmsMessagesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/models/__init__.py b/src/apideck_unify/models/__init__.py index f8e99190..96e94b43 100644 --- a/src/apideck_unify/models/__init__.py +++ b/src/apideck_unify/models/__init__.py @@ -1,11 +1,29 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +from .accounting_agedcreditorsoneop import ( + AccountingAgedCreditorsOneGlobals, + AccountingAgedCreditorsOneGlobalsTypedDict, + AccountingAgedCreditorsOneRequest, + AccountingAgedCreditorsOneRequestTypedDict, + AccountingAgedCreditorsOneResponse, + AccountingAgedCreditorsOneResponseTypedDict, +) +from .accounting_ageddebtorsoneop import ( + AccountingAgedDebtorsOneGlobals, + AccountingAgedDebtorsOneGlobalsTypedDict, + AccountingAgedDebtorsOneRequest, + AccountingAgedDebtorsOneRequestTypedDict, + AccountingAgedDebtorsOneResponse, + AccountingAgedDebtorsOneResponseTypedDict, +) from .accounting_attachmentsallop import ( AccountingAttachmentsAllGlobals, AccountingAttachmentsAllGlobalsTypedDict, AccountingAttachmentsAllRequest, AccountingAttachmentsAllRequestTypedDict, AccountingAttachmentsAllResponse, + AccountingAttachmentsAllResponseResult, + AccountingAttachmentsAllResponseResultTypedDict, AccountingAttachmentsAllResponseTypedDict, ) from .accounting_attachmentsdeleteop import ( @@ -54,6 +72,8 @@ AccountingBillPaymentsAllRequest, AccountingBillPaymentsAllRequestTypedDict, AccountingBillPaymentsAllResponse, + AccountingBillPaymentsAllResponseResult, + AccountingBillPaymentsAllResponseResultTypedDict, AccountingBillPaymentsAllResponseTypedDict, ) from .accounting_billpaymentsdeleteop import ( @@ -94,6 +114,8 @@ AccountingBillsAllRequest, AccountingBillsAllRequestTypedDict, AccountingBillsAllResponse, + AccountingBillsAllResponseResult, + AccountingBillsAllResponseResultTypedDict, AccountingBillsAllResponseTypedDict, ) from .accounting_billsdeleteop import ( @@ -142,6 +164,8 @@ AccountingCreditNotesAllRequest, AccountingCreditNotesAllRequestTypedDict, AccountingCreditNotesAllResponse, + AccountingCreditNotesAllResponseResult, + AccountingCreditNotesAllResponseResultTypedDict, AccountingCreditNotesAllResponseTypedDict, ) from .accounting_creditnotesdeleteop import ( @@ -182,6 +206,8 @@ AccountingCustomersAllRequest, AccountingCustomersAllRequestTypedDict, AccountingCustomersAllResponse, + AccountingCustomersAllResponseResult, + AccountingCustomersAllResponseResultTypedDict, AccountingCustomersAllResponseTypedDict, ) from .accounting_customersdeleteop import ( @@ -222,6 +248,8 @@ AccountingDepartmentsAllRequest, AccountingDepartmentsAllRequestTypedDict, AccountingDepartmentsAllResponse, + AccountingDepartmentsAllResponseResult, + AccountingDepartmentsAllResponseResultTypedDict, AccountingDepartmentsAllResponseTypedDict, ) from .accounting_departmentsdeleteop import ( @@ -262,6 +290,8 @@ AccountingExpensesAllRequest, AccountingExpensesAllRequestTypedDict, AccountingExpensesAllResponse, + AccountingExpensesAllResponseResult, + AccountingExpensesAllResponseResultTypedDict, AccountingExpensesAllResponseTypedDict, ) from .accounting_expensesdeleteop import ( @@ -302,6 +332,8 @@ AccountingInvoiceItemsAllRequest, AccountingInvoiceItemsAllRequestTypedDict, AccountingInvoiceItemsAllResponse, + AccountingInvoiceItemsAllResponseResult, + AccountingInvoiceItemsAllResponseResultTypedDict, AccountingInvoiceItemsAllResponseTypedDict, ) from .accounting_invoiceitemsdeleteop import ( @@ -342,6 +374,8 @@ AccountingInvoicesAllRequest, AccountingInvoicesAllRequestTypedDict, AccountingInvoicesAllResponse, + AccountingInvoicesAllResponseResult, + AccountingInvoicesAllResponseResultTypedDict, AccountingInvoicesAllResponseTypedDict, ) from .accounting_invoicesdeleteop import ( @@ -382,6 +416,8 @@ AccountingJournalEntriesAllRequest, AccountingJournalEntriesAllRequestTypedDict, AccountingJournalEntriesAllResponse, + AccountingJournalEntriesAllResponseResult, + AccountingJournalEntriesAllResponseResultTypedDict, AccountingJournalEntriesAllResponseTypedDict, ) from .accounting_journalentriesdeleteop import ( @@ -422,6 +458,8 @@ AccountingLedgerAccountsAllRequest, AccountingLedgerAccountsAllRequestTypedDict, AccountingLedgerAccountsAllResponse, + AccountingLedgerAccountsAllResponseResult, + AccountingLedgerAccountsAllResponseResultTypedDict, AccountingLedgerAccountsAllResponseTypedDict, ) from .accounting_ledgeraccountsdeleteop import ( @@ -462,6 +500,8 @@ AccountingLocationsAllRequest, AccountingLocationsAllRequestTypedDict, AccountingLocationsAllResponse, + AccountingLocationsAllResponseResult, + AccountingLocationsAllResponseResultTypedDict, AccountingLocationsAllResponseTypedDict, ) from .accounting_locationsdeleteop import ( @@ -502,6 +542,8 @@ AccountingPaymentsAllRequest, AccountingPaymentsAllRequestTypedDict, AccountingPaymentsAllResponse, + AccountingPaymentsAllResponseResult, + AccountingPaymentsAllResponseResultTypedDict, AccountingPaymentsAllResponseTypedDict, ) from .accounting_paymentsdeleteop import ( @@ -550,6 +592,8 @@ AccountingPurchaseOrdersAllRequest, AccountingPurchaseOrdersAllRequestTypedDict, AccountingPurchaseOrdersAllResponse, + AccountingPurchaseOrdersAllResponseResult, + AccountingPurchaseOrdersAllResponseResultTypedDict, AccountingPurchaseOrdersAllResponseTypedDict, ) from .accounting_purchaseordersdeleteop import ( @@ -590,6 +634,8 @@ AccountingSubsidiariesAllRequest, AccountingSubsidiariesAllRequestTypedDict, AccountingSubsidiariesAllResponse, + AccountingSubsidiariesAllResponseResult, + AccountingSubsidiariesAllResponseResultTypedDict, AccountingSubsidiariesAllResponseTypedDict, ) from .accounting_subsidiariesdeleteop import ( @@ -630,6 +676,8 @@ AccountingSuppliersAllRequest, AccountingSuppliersAllRequestTypedDict, AccountingSuppliersAllResponse, + AccountingSuppliersAllResponseResult, + AccountingSuppliersAllResponseResultTypedDict, AccountingSuppliersAllResponseTypedDict, ) from .accounting_suppliersdeleteop import ( @@ -670,6 +718,8 @@ AccountingTaxRatesAllRequest, AccountingTaxRatesAllRequestTypedDict, AccountingTaxRatesAllResponse, + AccountingTaxRatesAllResponseResult, + AccountingTaxRatesAllResponseResultTypedDict, AccountingTaxRatesAllResponseTypedDict, ) from .accounting_taxratesdeleteop import ( @@ -710,6 +760,8 @@ AccountingTrackingCategoriesAllRequest, AccountingTrackingCategoriesAllRequestTypedDict, AccountingTrackingCategoriesAllResponse, + AccountingTrackingCategoriesAllResponseResult, + AccountingTrackingCategoriesAllResponseResultTypedDict, AccountingTrackingCategoriesAllResponseTypedDict, ) from .accounting_trackingcategoriesdeleteop import ( @@ -776,6 +828,9 @@ ActivityAttendeeTypedDict, ) from .address import Address, AddressTypedDict, Type +from .agedcreditors import AgedCreditors, AgedCreditorsTypedDict +from .ageddebtors import AgedDebtors, AgedDebtorsTypedDict +from .agedreportfilter import AgedReportFilter, AgedReportFilterTypedDict from .allocation import ( Allocation, AllocationInput, @@ -838,6 +893,8 @@ AtsApplicantsAllRequest, AtsApplicantsAllRequestTypedDict, AtsApplicantsAllResponse, + AtsApplicantsAllResponseResult, + AtsApplicantsAllResponseResultTypedDict, AtsApplicantsAllResponseTypedDict, ) from .ats_applicantsdeleteop import ( @@ -878,6 +935,8 @@ AtsApplicationsAllRequest, AtsApplicationsAllRequestTypedDict, AtsApplicationsAllResponse, + AtsApplicationsAllResponseResult, + AtsApplicationsAllResponseResultTypedDict, AtsApplicationsAllResponseTypedDict, ) from .ats_applicationsdeleteop import ( @@ -910,6 +969,8 @@ AtsJobsAllRequest, AtsJobsAllRequestTypedDict, AtsJobsAllResponse, + AtsJobsAllResponseResult, + AtsJobsAllResponseResultTypedDict, AtsJobsAllResponseTypedDict, ) from .ats_jobsoneop import ( @@ -929,6 +990,12 @@ BadRequestResponseData, BadRequestResponseDetail, ) +from .balancebyperiod import BalanceByPeriod, BalanceByPeriodTypedDict +from .balancebytransaction import ( + BalanceByTransaction, + BalanceByTransactionTypedDict, + TransactionType, +) from .balancesheet import ( BalanceSheet, BalanceSheetAssetsAccount, @@ -1073,6 +1140,8 @@ ConnectorApisAllRequest, ConnectorApisAllRequestTypedDict, ConnectorApisAllResponse, + ConnectorApisAllResponseResult, + ConnectorApisAllResponseResultTypedDict, ConnectorApisAllResponseTypedDict, ) from .connector_apisoneop import ( @@ -1105,6 +1174,8 @@ ConnectorConnectorsAllRequest, ConnectorConnectorsAllRequestTypedDict, ConnectorConnectorsAllResponse, + ConnectorConnectorsAllResponseResult, + ConnectorConnectorsAllResponseResultTypedDict, ConnectorConnectorsAllResponseTypedDict, ) from .connector_connectorsoneop import ( @@ -1318,6 +1389,8 @@ CrmActivitiesAllRequest, CrmActivitiesAllRequestTypedDict, CrmActivitiesAllResponse, + CrmActivitiesAllResponseResult, + CrmActivitiesAllResponseResultTypedDict, CrmActivitiesAllResponseTypedDict, ) from .crm_activitiesdeleteop import ( @@ -1358,6 +1431,8 @@ CrmCompaniesAllRequest, CrmCompaniesAllRequestTypedDict, CrmCompaniesAllResponse, + CrmCompaniesAllResponseResult, + CrmCompaniesAllResponseResultTypedDict, CrmCompaniesAllResponseTypedDict, ) from .crm_companiesdeleteop import ( @@ -1398,6 +1473,8 @@ CrmContactsAllRequest, CrmContactsAllRequestTypedDict, CrmContactsAllResponse, + CrmContactsAllResponseResult, + CrmContactsAllResponseResultTypedDict, CrmContactsAllResponseTypedDict, ) from .crm_contactsdeleteop import ( @@ -1438,6 +1515,8 @@ CrmLeadsAllRequest, CrmLeadsAllRequestTypedDict, CrmLeadsAllResponse, + CrmLeadsAllResponseResult, + CrmLeadsAllResponseResultTypedDict, CrmLeadsAllResponseTypedDict, ) from .crm_leadsdeleteop import ( @@ -1478,6 +1557,8 @@ CrmNotesAllRequest, CrmNotesAllRequestTypedDict, CrmNotesAllResponse, + CrmNotesAllResponseResult, + CrmNotesAllResponseResultTypedDict, CrmNotesAllResponseTypedDict, ) from .crm_notesdeleteop import ( @@ -1518,6 +1599,8 @@ CrmOpportunitiesAllRequest, CrmOpportunitiesAllRequestTypedDict, CrmOpportunitiesAllResponse, + CrmOpportunitiesAllResponseResult, + CrmOpportunitiesAllResponseResultTypedDict, CrmOpportunitiesAllResponseTypedDict, ) from .crm_opportunitiesdeleteop import ( @@ -1558,6 +1641,8 @@ CrmPipelinesAllRequest, CrmPipelinesAllRequestTypedDict, CrmPipelinesAllResponse, + CrmPipelinesAllResponseResult, + CrmPipelinesAllResponseResultTypedDict, CrmPipelinesAllResponseTypedDict, ) from .crm_pipelinesdeleteop import ( @@ -1598,6 +1683,8 @@ CrmUsersAllRequest, CrmUsersAllRequestTypedDict, CrmUsersAllResponse, + CrmUsersAllResponseResult, + CrmUsersAllResponseResultTypedDict, CrmUsersAllResponseTypedDict, ) from .crm_usersdeleteop import ( @@ -1798,6 +1885,8 @@ EcommerceCustomersAllRequest, EcommerceCustomersAllRequestTypedDict, EcommerceCustomersAllResponse, + EcommerceCustomersAllResponseResult, + EcommerceCustomersAllResponseResultTypedDict, EcommerceCustomersAllResponseTypedDict, ) from .ecommerce_customersoneop import ( @@ -1814,6 +1903,8 @@ EcommerceOrdersAllRequest, EcommerceOrdersAllRequestTypedDict, EcommerceOrdersAllResponse, + EcommerceOrdersAllResponseResult, + EcommerceOrdersAllResponseResultTypedDict, EcommerceOrdersAllResponseTypedDict, ) from .ecommerce_ordersoneop import ( @@ -1830,6 +1921,8 @@ EcommerceProductsAllRequest, EcommerceProductsAllRequestTypedDict, EcommerceProductsAllResponse, + EcommerceProductsAllResponseResult, + EcommerceProductsAllResponseResultTypedDict, EcommerceProductsAllResponseTypedDict, ) from .ecommerce_productsoneop import ( @@ -1961,6 +2054,8 @@ FileStorageDriveGroupsAllRequest, FileStorageDriveGroupsAllRequestTypedDict, FileStorageDriveGroupsAllResponse, + FileStorageDriveGroupsAllResponseResult, + FileStorageDriveGroupsAllResponseResultTypedDict, FileStorageDriveGroupsAllResponseTypedDict, ) from .filestorage_drivegroupsdeleteop import ( @@ -2001,6 +2096,8 @@ FileStorageDrivesAllRequest, FileStorageDrivesAllRequestTypedDict, FileStorageDrivesAllResponse, + FileStorageDrivesAllResponseResult, + FileStorageDrivesAllResponseResultTypedDict, FileStorageDrivesAllResponseTypedDict, ) from .filestorage_drivesdeleteop import ( @@ -2033,6 +2130,8 @@ FileStorageFilesAllRequest, FileStorageFilesAllRequestTypedDict, FileStorageFilesAllResponse, + FileStorageFilesAllResponseResult, + FileStorageFilesAllResponseResultTypedDict, FileStorageFilesAllResponseTypedDict, ) from .filestorage_filesdeleteop import ( @@ -2137,6 +2236,8 @@ FileStorageSharedLinksAllRequest, FileStorageSharedLinksAllRequestTypedDict, FileStorageSharedLinksAllResponse, + FileStorageSharedLinksAllResponseResult, + FileStorageSharedLinksAllResponseResultTypedDict, FileStorageSharedLinksAllResponseTypedDict, ) from .filestorage_sharedlinksdeleteop import ( @@ -2224,6 +2325,14 @@ ) from .getactivitiesresponse import GetActivitiesResponse, GetActivitiesResponseTypedDict from .getactivityresponse import GetActivityResponse, GetActivityResponseTypedDict +from .getagedcreditorsresponse import ( + GetAgedCreditorsResponse, + GetAgedCreditorsResponseTypedDict, +) +from .getageddebtorsresponse import ( + GetAgedDebtorsResponse, + GetAgedDebtorsResponseTypedDict, +) from .getapiresourcecoverageresponse import ( GetAPIResourceCoverageResponse, GetAPIResourceCoverageResponseTypedDict, @@ -2500,6 +2609,8 @@ HrisCompaniesAllRequest, HrisCompaniesAllRequestTypedDict, HrisCompaniesAllResponse, + HrisCompaniesAllResponseResult, + HrisCompaniesAllResponseResultTypedDict, HrisCompaniesAllResponseTypedDict, ) from .hris_companiesdeleteop import ( @@ -2540,6 +2651,8 @@ HrisDepartmentsAllRequest, HrisDepartmentsAllRequestTypedDict, HrisDepartmentsAllResponse, + HrisDepartmentsAllResponseResult, + HrisDepartmentsAllResponseResultTypedDict, HrisDepartmentsAllResponseTypedDict, ) from .hris_departmentsdeleteop import ( @@ -2596,6 +2709,8 @@ HrisEmployeesAllRequest, HrisEmployeesAllRequestTypedDict, HrisEmployeesAllResponse, + HrisEmployeesAllResponseResult, + HrisEmployeesAllResponseResultTypedDict, HrisEmployeesAllResponseTypedDict, ) from .hris_employeeschedulesallop import ( @@ -2660,6 +2775,8 @@ HrisTimeOffRequestsAllRequest, HrisTimeOffRequestsAllRequestTypedDict, HrisTimeOffRequestsAllResponse, + HrisTimeOffRequestsAllResponseResult, + HrisTimeOffRequestsAllResponseResultTypedDict, HrisTimeOffRequestsAllResponseTypedDict, ) from .hris_timeoffrequestsdeleteop import ( @@ -2744,6 +2861,8 @@ IssueTrackingCollectionsAllRequest, IssueTrackingCollectionsAllRequestTypedDict, IssueTrackingCollectionsAllResponse, + IssueTrackingCollectionsAllResponseResult, + IssueTrackingCollectionsAllResponseResultTypedDict, IssueTrackingCollectionsAllResponseTypedDict, ) from .issuetracking_collectionsoneop import ( @@ -2760,6 +2879,8 @@ IssueTrackingCollectionTagsAllRequest, IssueTrackingCollectionTagsAllRequestTypedDict, IssueTrackingCollectionTagsAllResponse, + IssueTrackingCollectionTagsAllResponseResult, + IssueTrackingCollectionTagsAllResponseResultTypedDict, IssueTrackingCollectionTagsAllResponseTypedDict, ) from .issuetracking_collectionticketcommentsaddop import ( @@ -2776,6 +2897,8 @@ IssueTrackingCollectionTicketCommentsAllRequest, IssueTrackingCollectionTicketCommentsAllRequestTypedDict, IssueTrackingCollectionTicketCommentsAllResponse, + IssueTrackingCollectionTicketCommentsAllResponseResult, + IssueTrackingCollectionTicketCommentsAllResponseResultTypedDict, IssueTrackingCollectionTicketCommentsAllResponseTypedDict, ) from .issuetracking_collectionticketcommentsdeleteop import ( @@ -2792,6 +2915,8 @@ IssueTrackingCollectionTicketCommentsOneRequest, IssueTrackingCollectionTicketCommentsOneRequestTypedDict, IssueTrackingCollectionTicketCommentsOneResponse, + IssueTrackingCollectionTicketCommentsOneResponseResult, + IssueTrackingCollectionTicketCommentsOneResponseResultTypedDict, IssueTrackingCollectionTicketCommentsOneResponseTypedDict, ) from .issuetracking_collectionticketcommentsupdateop import ( @@ -2816,6 +2941,8 @@ IssueTrackingCollectionTicketsAllRequest, IssueTrackingCollectionTicketsAllRequestTypedDict, IssueTrackingCollectionTicketsAllResponse, + IssueTrackingCollectionTicketsAllResponseResult, + IssueTrackingCollectionTicketsAllResponseResultTypedDict, IssueTrackingCollectionTicketsAllResponseTypedDict, ) from .issuetracking_collectionticketsdeleteop import ( @@ -2848,6 +2975,8 @@ IssueTrackingCollectionUsersAllRequest, IssueTrackingCollectionUsersAllRequestTypedDict, IssueTrackingCollectionUsersAllResponse, + IssueTrackingCollectionUsersAllResponseResult, + IssueTrackingCollectionUsersAllResponseResultTypedDict, IssueTrackingCollectionUsersAllResponseTypedDict, ) from .issuetracking_collectionusersoneop import ( @@ -2985,6 +3114,11 @@ from .opportunity import Opportunity, OpportunityTypedDict from .opportunity_input import OpportunityInput, OpportunityInputTypedDict from .orderssort import OrdersSort, OrdersSortBy, OrdersSortTypedDict +from .outstandingbalance import OutstandingBalance, OutstandingBalanceTypedDict +from .outstandingbalancebycurrency import ( + OutstandingBalanceByCurrency, + OutstandingBalanceByCurrencyTypedDict, +) from .owner import Owner, OwnerTypedDict from .paginationcoverage import ( PaginationCoverage, @@ -3106,6 +3240,8 @@ SmsMessagesAllRequest, SmsMessagesAllRequestTypedDict, SmsMessagesAllResponse, + SmsMessagesAllResponseResult, + SmsMessagesAllResponseResultTypedDict, SmsMessagesAllResponseTypedDict, ) from .sms_messagesdeleteop import ( @@ -3445,6 +3581,8 @@ VaultConsumersAllRequest, VaultConsumersAllRequestTypedDict, VaultConsumersAllResponse, + VaultConsumersAllResponseResult, + VaultConsumersAllResponseResultTypedDict, VaultConsumersAllResponseTypedDict, ) from .vault_consumersdeleteop import ( @@ -3501,6 +3639,8 @@ VaultLogsAllRequest, VaultLogsAllRequestTypedDict, VaultLogsAllResponse, + VaultLogsAllResponseResult, + VaultLogsAllResponseResultTypedDict, VaultLogsAllResponseTypedDict, ) from .vault_sessionscreateop import ( @@ -3526,6 +3666,8 @@ WebhookEventLogsAllRequest, WebhookEventLogsAllRequestTypedDict, WebhookEventLogsAllResponse, + WebhookEventLogsAllResponseResult, + WebhookEventLogsAllResponseResultTypedDict, WebhookEventLogsAllResponseTypedDict, ) from .webhook_webhooksaddop import ( @@ -3540,6 +3682,8 @@ WebhookWebhooksAllRequest, WebhookWebhooksAllRequestTypedDict, WebhookWebhooksAllResponse, + WebhookWebhooksAllResponseResult, + WebhookWebhooksAllResponseResultTypedDict, WebhookWebhooksAllResponseTypedDict, ) from .webhook_webhooksdeleteop import ( @@ -3610,11 +3754,25 @@ "APITypedDict", "AccountStatus", "AccountType", + "AccountingAgedCreditorsOneGlobals", + "AccountingAgedCreditorsOneGlobalsTypedDict", + "AccountingAgedCreditorsOneRequest", + "AccountingAgedCreditorsOneRequestTypedDict", + "AccountingAgedCreditorsOneResponse", + "AccountingAgedCreditorsOneResponseTypedDict", + "AccountingAgedDebtorsOneGlobals", + "AccountingAgedDebtorsOneGlobalsTypedDict", + "AccountingAgedDebtorsOneRequest", + "AccountingAgedDebtorsOneRequestTypedDict", + "AccountingAgedDebtorsOneResponse", + "AccountingAgedDebtorsOneResponseTypedDict", "AccountingAttachmentsAllGlobals", "AccountingAttachmentsAllGlobalsTypedDict", "AccountingAttachmentsAllRequest", "AccountingAttachmentsAllRequestTypedDict", "AccountingAttachmentsAllResponse", + "AccountingAttachmentsAllResponseResult", + "AccountingAttachmentsAllResponseResultTypedDict", "AccountingAttachmentsAllResponseTypedDict", "AccountingAttachmentsDeleteGlobals", "AccountingAttachmentsDeleteGlobalsTypedDict", @@ -3651,6 +3809,8 @@ "AccountingBillPaymentsAllRequest", "AccountingBillPaymentsAllRequestTypedDict", "AccountingBillPaymentsAllResponse", + "AccountingBillPaymentsAllResponseResult", + "AccountingBillPaymentsAllResponseResultTypedDict", "AccountingBillPaymentsAllResponseTypedDict", "AccountingBillPaymentsDeleteGlobals", "AccountingBillPaymentsDeleteGlobalsTypedDict", @@ -3681,6 +3841,8 @@ "AccountingBillsAllRequest", "AccountingBillsAllRequestTypedDict", "AccountingBillsAllResponse", + "AccountingBillsAllResponseResult", + "AccountingBillsAllResponseResultTypedDict", "AccountingBillsAllResponseTypedDict", "AccountingBillsDeleteGlobals", "AccountingBillsDeleteGlobalsTypedDict", @@ -3717,6 +3879,8 @@ "AccountingCreditNotesAllRequest", "AccountingCreditNotesAllRequestTypedDict", "AccountingCreditNotesAllResponse", + "AccountingCreditNotesAllResponseResult", + "AccountingCreditNotesAllResponseResultTypedDict", "AccountingCreditNotesAllResponseTypedDict", "AccountingCreditNotesDeleteGlobals", "AccountingCreditNotesDeleteGlobalsTypedDict", @@ -3747,6 +3911,8 @@ "AccountingCustomersAllRequest", "AccountingCustomersAllRequestTypedDict", "AccountingCustomersAllResponse", + "AccountingCustomersAllResponseResult", + "AccountingCustomersAllResponseResultTypedDict", "AccountingCustomersAllResponseTypedDict", "AccountingCustomersDeleteGlobals", "AccountingCustomersDeleteGlobalsTypedDict", @@ -3781,6 +3947,8 @@ "AccountingDepartmentsAllRequest", "AccountingDepartmentsAllRequestTypedDict", "AccountingDepartmentsAllResponse", + "AccountingDepartmentsAllResponseResult", + "AccountingDepartmentsAllResponseResultTypedDict", "AccountingDepartmentsAllResponseTypedDict", "AccountingDepartmentsDeleteGlobals", "AccountingDepartmentsDeleteGlobalsTypedDict", @@ -3813,6 +3981,8 @@ "AccountingExpensesAllRequest", "AccountingExpensesAllRequestTypedDict", "AccountingExpensesAllResponse", + "AccountingExpensesAllResponseResult", + "AccountingExpensesAllResponseResultTypedDict", "AccountingExpensesAllResponseTypedDict", "AccountingExpensesDeleteGlobals", "AccountingExpensesDeleteGlobalsTypedDict", @@ -3843,6 +4013,8 @@ "AccountingInvoiceItemsAllRequest", "AccountingInvoiceItemsAllRequestTypedDict", "AccountingInvoiceItemsAllResponse", + "AccountingInvoiceItemsAllResponseResult", + "AccountingInvoiceItemsAllResponseResultTypedDict", "AccountingInvoiceItemsAllResponseTypedDict", "AccountingInvoiceItemsDeleteGlobals", "AccountingInvoiceItemsDeleteGlobalsTypedDict", @@ -3873,6 +4045,8 @@ "AccountingInvoicesAllRequest", "AccountingInvoicesAllRequestTypedDict", "AccountingInvoicesAllResponse", + "AccountingInvoicesAllResponseResult", + "AccountingInvoicesAllResponseResultTypedDict", "AccountingInvoicesAllResponseTypedDict", "AccountingInvoicesDeleteGlobals", "AccountingInvoicesDeleteGlobalsTypedDict", @@ -3903,6 +4077,8 @@ "AccountingJournalEntriesAllRequest", "AccountingJournalEntriesAllRequestTypedDict", "AccountingJournalEntriesAllResponse", + "AccountingJournalEntriesAllResponseResult", + "AccountingJournalEntriesAllResponseResultTypedDict", "AccountingJournalEntriesAllResponseTypedDict", "AccountingJournalEntriesDeleteGlobals", "AccountingJournalEntriesDeleteGlobalsTypedDict", @@ -3933,6 +4109,8 @@ "AccountingLedgerAccountsAllRequest", "AccountingLedgerAccountsAllRequestTypedDict", "AccountingLedgerAccountsAllResponse", + "AccountingLedgerAccountsAllResponseResult", + "AccountingLedgerAccountsAllResponseResultTypedDict", "AccountingLedgerAccountsAllResponseTypedDict", "AccountingLedgerAccountsDeleteGlobals", "AccountingLedgerAccountsDeleteGlobalsTypedDict", @@ -3967,6 +4145,8 @@ "AccountingLocationsAllRequest", "AccountingLocationsAllRequestTypedDict", "AccountingLocationsAllResponse", + "AccountingLocationsAllResponseResult", + "AccountingLocationsAllResponseResultTypedDict", "AccountingLocationsAllResponseTypedDict", "AccountingLocationsDeleteGlobals", "AccountingLocationsDeleteGlobalsTypedDict", @@ -3999,6 +4179,8 @@ "AccountingPaymentsAllRequest", "AccountingPaymentsAllRequestTypedDict", "AccountingPaymentsAllResponse", + "AccountingPaymentsAllResponseResult", + "AccountingPaymentsAllResponseResultTypedDict", "AccountingPaymentsAllResponseTypedDict", "AccountingPaymentsDeleteGlobals", "AccountingPaymentsDeleteGlobalsTypedDict", @@ -4035,6 +4217,8 @@ "AccountingPurchaseOrdersAllRequest", "AccountingPurchaseOrdersAllRequestTypedDict", "AccountingPurchaseOrdersAllResponse", + "AccountingPurchaseOrdersAllResponseResult", + "AccountingPurchaseOrdersAllResponseResultTypedDict", "AccountingPurchaseOrdersAllResponseTypedDict", "AccountingPurchaseOrdersDeleteGlobals", "AccountingPurchaseOrdersDeleteGlobalsTypedDict", @@ -4065,6 +4249,8 @@ "AccountingSubsidiariesAllRequest", "AccountingSubsidiariesAllRequestTypedDict", "AccountingSubsidiariesAllResponse", + "AccountingSubsidiariesAllResponseResult", + "AccountingSubsidiariesAllResponseResultTypedDict", "AccountingSubsidiariesAllResponseTypedDict", "AccountingSubsidiariesDeleteGlobals", "AccountingSubsidiariesDeleteGlobalsTypedDict", @@ -4095,6 +4281,8 @@ "AccountingSuppliersAllRequest", "AccountingSuppliersAllRequestTypedDict", "AccountingSuppliersAllResponse", + "AccountingSuppliersAllResponseResult", + "AccountingSuppliersAllResponseResultTypedDict", "AccountingSuppliersAllResponseTypedDict", "AccountingSuppliersDeleteGlobals", "AccountingSuppliersDeleteGlobalsTypedDict", @@ -4125,6 +4313,8 @@ "AccountingTaxRatesAllRequest", "AccountingTaxRatesAllRequestTypedDict", "AccountingTaxRatesAllResponse", + "AccountingTaxRatesAllResponseResult", + "AccountingTaxRatesAllResponseResultTypedDict", "AccountingTaxRatesAllResponseTypedDict", "AccountingTaxRatesDeleteGlobals", "AccountingTaxRatesDeleteGlobalsTypedDict", @@ -4155,6 +4345,8 @@ "AccountingTrackingCategoriesAllRequest", "AccountingTrackingCategoriesAllRequestTypedDict", "AccountingTrackingCategoriesAllResponse", + "AccountingTrackingCategoriesAllResponseResult", + "AccountingTrackingCategoriesAllResponseResultTypedDict", "AccountingTrackingCategoriesAllResponseTypedDict", "AccountingTrackingCategoriesDeleteGlobals", "AccountingTrackingCategoriesDeleteGlobalsTypedDict", @@ -4193,6 +4385,12 @@ "AddressTypedDict", "Addresses", "AddressesTypedDict", + "AgedCreditors", + "AgedCreditorsTypedDict", + "AgedDebtors", + "AgedDebtorsTypedDict", + "AgedReportFilter", + "AgedReportFilterTypedDict", "Allocation", "AllocationInput", "AllocationInputTypedDict", @@ -4230,6 +4428,8 @@ "AtsApplicantsAllRequest", "AtsApplicantsAllRequestTypedDict", "AtsApplicantsAllResponse", + "AtsApplicantsAllResponseResult", + "AtsApplicantsAllResponseResultTypedDict", "AtsApplicantsAllResponseTypedDict", "AtsApplicantsDeleteGlobals", "AtsApplicantsDeleteGlobalsTypedDict", @@ -4260,6 +4460,8 @@ "AtsApplicationsAllRequest", "AtsApplicationsAllRequestTypedDict", "AtsApplicationsAllResponse", + "AtsApplicationsAllResponseResult", + "AtsApplicationsAllResponseResultTypedDict", "AtsApplicationsAllResponseTypedDict", "AtsApplicationsDeleteGlobals", "AtsApplicationsDeleteGlobalsTypedDict", @@ -4284,6 +4486,8 @@ "AtsJobsAllRequest", "AtsJobsAllRequestTypedDict", "AtsJobsAllResponse", + "AtsJobsAllResponseResult", + "AtsJobsAllResponseResultTypedDict", "AtsJobsAllResponseTypedDict", "AtsJobsOneGlobals", "AtsJobsOneGlobalsTypedDict", @@ -4303,6 +4507,10 @@ "BadRequestResponse", "BadRequestResponseData", "BadRequestResponseDetail", + "BalanceByPeriod", + "BalanceByPeriodTypedDict", + "BalanceByTransaction", + "BalanceByTransactionTypedDict", "BalanceSheet", "BalanceSheetAssetsAccount", "BalanceSheetAssetsAccountTypedDict", @@ -4421,6 +4629,8 @@ "ConnectorApisAllRequest", "ConnectorApisAllRequestTypedDict", "ConnectorApisAllResponse", + "ConnectorApisAllResponseResult", + "ConnectorApisAllResponseResultTypedDict", "ConnectorApisAllResponseTypedDict", "ConnectorApisOneGlobals", "ConnectorApisOneGlobalsTypedDict", @@ -4446,6 +4656,8 @@ "ConnectorConnectorsAllRequest", "ConnectorConnectorsAllRequestTypedDict", "ConnectorConnectorsAllResponse", + "ConnectorConnectorsAllResponseResult", + "ConnectorConnectorsAllResponseResultTypedDict", "ConnectorConnectorsAllResponseTypedDict", "ConnectorConnectorsOneGlobals", "ConnectorConnectorsOneGlobalsTypedDict", @@ -4620,6 +4832,8 @@ "CrmActivitiesAllRequest", "CrmActivitiesAllRequestTypedDict", "CrmActivitiesAllResponse", + "CrmActivitiesAllResponseResult", + "CrmActivitiesAllResponseResultTypedDict", "CrmActivitiesAllResponseTypedDict", "CrmActivitiesDeleteGlobals", "CrmActivitiesDeleteGlobalsTypedDict", @@ -4650,6 +4864,8 @@ "CrmCompaniesAllRequest", "CrmCompaniesAllRequestTypedDict", "CrmCompaniesAllResponse", + "CrmCompaniesAllResponseResult", + "CrmCompaniesAllResponseResultTypedDict", "CrmCompaniesAllResponseTypedDict", "CrmCompaniesDeleteGlobals", "CrmCompaniesDeleteGlobalsTypedDict", @@ -4680,6 +4896,8 @@ "CrmContactsAllRequest", "CrmContactsAllRequestTypedDict", "CrmContactsAllResponse", + "CrmContactsAllResponseResult", + "CrmContactsAllResponseResultTypedDict", "CrmContactsAllResponseTypedDict", "CrmContactsDeleteGlobals", "CrmContactsDeleteGlobalsTypedDict", @@ -4710,6 +4928,8 @@ "CrmLeadsAllRequest", "CrmLeadsAllRequestTypedDict", "CrmLeadsAllResponse", + "CrmLeadsAllResponseResult", + "CrmLeadsAllResponseResultTypedDict", "CrmLeadsAllResponseTypedDict", "CrmLeadsDeleteGlobals", "CrmLeadsDeleteGlobalsTypedDict", @@ -4740,6 +4960,8 @@ "CrmNotesAllRequest", "CrmNotesAllRequestTypedDict", "CrmNotesAllResponse", + "CrmNotesAllResponseResult", + "CrmNotesAllResponseResultTypedDict", "CrmNotesAllResponseTypedDict", "CrmNotesDeleteGlobals", "CrmNotesDeleteGlobalsTypedDict", @@ -4770,6 +4992,8 @@ "CrmOpportunitiesAllRequest", "CrmOpportunitiesAllRequestTypedDict", "CrmOpportunitiesAllResponse", + "CrmOpportunitiesAllResponseResult", + "CrmOpportunitiesAllResponseResultTypedDict", "CrmOpportunitiesAllResponseTypedDict", "CrmOpportunitiesDeleteGlobals", "CrmOpportunitiesDeleteGlobalsTypedDict", @@ -4800,6 +5024,8 @@ "CrmPipelinesAllRequest", "CrmPipelinesAllRequestTypedDict", "CrmPipelinesAllResponse", + "CrmPipelinesAllResponseResult", + "CrmPipelinesAllResponseResultTypedDict", "CrmPipelinesAllResponseTypedDict", "CrmPipelinesDeleteGlobals", "CrmPipelinesDeleteGlobalsTypedDict", @@ -4830,6 +5056,8 @@ "CrmUsersAllRequest", "CrmUsersAllRequestTypedDict", "CrmUsersAllResponse", + "CrmUsersAllResponseResult", + "CrmUsersAllResponseResultTypedDict", "CrmUsersAllResponseTypedDict", "CrmUsersDeleteGlobals", "CrmUsersDeleteGlobalsTypedDict", @@ -5003,6 +5231,8 @@ "EcommerceCustomersAllRequest", "EcommerceCustomersAllRequestTypedDict", "EcommerceCustomersAllResponse", + "EcommerceCustomersAllResponseResult", + "EcommerceCustomersAllResponseResultTypedDict", "EcommerceCustomersAllResponseTypedDict", "EcommerceCustomersFilter", "EcommerceCustomersFilterTypedDict", @@ -5025,6 +5255,8 @@ "EcommerceOrdersAllRequest", "EcommerceOrdersAllRequestTypedDict", "EcommerceOrdersAllResponse", + "EcommerceOrdersAllResponseResult", + "EcommerceOrdersAllResponseResultTypedDict", "EcommerceOrdersAllResponseTypedDict", "EcommerceOrdersFilter", "EcommerceOrdersFilterTypedDict", @@ -5049,6 +5281,8 @@ "EcommerceProductsAllRequest", "EcommerceProductsAllRequestTypedDict", "EcommerceProductsAllResponse", + "EcommerceProductsAllResponseResult", + "EcommerceProductsAllResponseResultTypedDict", "EcommerceProductsAllResponseTypedDict", "EcommerceProductsOneGlobals", "EcommerceProductsOneGlobalsTypedDict", @@ -5131,6 +5365,8 @@ "FileStorageDriveGroupsAllRequest", "FileStorageDriveGroupsAllRequestTypedDict", "FileStorageDriveGroupsAllResponse", + "FileStorageDriveGroupsAllResponseResult", + "FileStorageDriveGroupsAllResponseResultTypedDict", "FileStorageDriveGroupsAllResponseTypedDict", "FileStorageDriveGroupsDeleteGlobals", "FileStorageDriveGroupsDeleteGlobalsTypedDict", @@ -5161,6 +5397,8 @@ "FileStorageDrivesAllRequest", "FileStorageDrivesAllRequestTypedDict", "FileStorageDrivesAllResponse", + "FileStorageDrivesAllResponseResult", + "FileStorageDrivesAllResponseResultTypedDict", "FileStorageDrivesAllResponseTypedDict", "FileStorageDrivesDeleteGlobals", "FileStorageDrivesDeleteGlobalsTypedDict", @@ -5185,6 +5423,8 @@ "FileStorageFilesAllRequest", "FileStorageFilesAllRequestTypedDict", "FileStorageFilesAllResponse", + "FileStorageFilesAllResponseResult", + "FileStorageFilesAllResponseResultTypedDict", "FileStorageFilesAllResponseTypedDict", "FileStorageFilesDeleteGlobals", "FileStorageFilesDeleteGlobalsTypedDict", @@ -5263,6 +5503,8 @@ "FileStorageSharedLinksAllRequest", "FileStorageSharedLinksAllRequestTypedDict", "FileStorageSharedLinksAllResponse", + "FileStorageSharedLinksAllResponseResult", + "FileStorageSharedLinksAllResponseResultTypedDict", "FileStorageSharedLinksAllResponseTypedDict", "FileStorageSharedLinksDeleteGlobals", "FileStorageSharedLinksDeleteGlobalsTypedDict", @@ -5351,6 +5593,10 @@ "GetActivitiesResponseTypedDict", "GetActivityResponse", "GetActivityResponseTypedDict", + "GetAgedCreditorsResponse", + "GetAgedCreditorsResponseTypedDict", + "GetAgedDebtorsResponse", + "GetAgedDebtorsResponseTypedDict", "GetApisResponse", "GetApisResponseTypedDict", "GetApplicantResponse", @@ -5584,6 +5830,8 @@ "HrisCompaniesAllRequest", "HrisCompaniesAllRequestTypedDict", "HrisCompaniesAllResponse", + "HrisCompaniesAllResponseResult", + "HrisCompaniesAllResponseResultTypedDict", "HrisCompaniesAllResponseTypedDict", "HrisCompaniesDeleteGlobals", "HrisCompaniesDeleteGlobalsTypedDict", @@ -5619,6 +5867,8 @@ "HrisDepartmentsAllRequest", "HrisDepartmentsAllRequestTypedDict", "HrisDepartmentsAllResponse", + "HrisDepartmentsAllResponseResult", + "HrisDepartmentsAllResponseResultTypedDict", "HrisDepartmentsAllResponseTypedDict", "HrisDepartmentsDeleteGlobals", "HrisDepartmentsDeleteGlobalsTypedDict", @@ -5667,6 +5917,8 @@ "HrisEmployeesAllRequest", "HrisEmployeesAllRequestTypedDict", "HrisEmployeesAllResponse", + "HrisEmployeesAllResponseResult", + "HrisEmployeesAllResponseResultTypedDict", "HrisEmployeesAllResponseTypedDict", "HrisEmployeesDeleteGlobals", "HrisEmployeesDeleteGlobalsTypedDict", @@ -5709,6 +5961,8 @@ "HrisTimeOffRequestsAllRequest", "HrisTimeOffRequestsAllRequestTypedDict", "HrisTimeOffRequestsAllResponse", + "HrisTimeOffRequestsAllResponseResult", + "HrisTimeOffRequestsAllResponseResultTypedDict", "HrisTimeOffRequestsAllResponseTypedDict", "HrisTimeOffRequestsDeleteGlobals", "HrisTimeOffRequestsDeleteGlobalsTypedDict", @@ -5771,6 +6025,8 @@ "IssueTrackingCollectionTagsAllRequest", "IssueTrackingCollectionTagsAllRequestTypedDict", "IssueTrackingCollectionTagsAllResponse", + "IssueTrackingCollectionTagsAllResponseResult", + "IssueTrackingCollectionTagsAllResponseResultTypedDict", "IssueTrackingCollectionTagsAllResponseTypedDict", "IssueTrackingCollectionTicketCommentsAddGlobals", "IssueTrackingCollectionTicketCommentsAddGlobalsTypedDict", @@ -5783,6 +6039,8 @@ "IssueTrackingCollectionTicketCommentsAllRequest", "IssueTrackingCollectionTicketCommentsAllRequestTypedDict", "IssueTrackingCollectionTicketCommentsAllResponse", + "IssueTrackingCollectionTicketCommentsAllResponseResult", + "IssueTrackingCollectionTicketCommentsAllResponseResultTypedDict", "IssueTrackingCollectionTicketCommentsAllResponseTypedDict", "IssueTrackingCollectionTicketCommentsDeleteGlobals", "IssueTrackingCollectionTicketCommentsDeleteGlobalsTypedDict", @@ -5795,6 +6053,8 @@ "IssueTrackingCollectionTicketCommentsOneRequest", "IssueTrackingCollectionTicketCommentsOneRequestTypedDict", "IssueTrackingCollectionTicketCommentsOneResponse", + "IssueTrackingCollectionTicketCommentsOneResponseResult", + "IssueTrackingCollectionTicketCommentsOneResponseResultTypedDict", "IssueTrackingCollectionTicketCommentsOneResponseTypedDict", "IssueTrackingCollectionTicketCommentsUpdateGlobals", "IssueTrackingCollectionTicketCommentsUpdateGlobalsTypedDict", @@ -5813,6 +6073,8 @@ "IssueTrackingCollectionTicketsAllRequest", "IssueTrackingCollectionTicketsAllRequestTypedDict", "IssueTrackingCollectionTicketsAllResponse", + "IssueTrackingCollectionTicketsAllResponseResult", + "IssueTrackingCollectionTicketsAllResponseResultTypedDict", "IssueTrackingCollectionTicketsAllResponseTypedDict", "IssueTrackingCollectionTicketsDeleteGlobals", "IssueTrackingCollectionTicketsDeleteGlobalsTypedDict", @@ -5837,6 +6099,8 @@ "IssueTrackingCollectionUsersAllRequest", "IssueTrackingCollectionUsersAllRequestTypedDict", "IssueTrackingCollectionUsersAllResponse", + "IssueTrackingCollectionUsersAllResponseResult", + "IssueTrackingCollectionUsersAllResponseResultTypedDict", "IssueTrackingCollectionUsersAllResponseTypedDict", "IssueTrackingCollectionUsersOneGlobals", "IssueTrackingCollectionUsersOneGlobalsTypedDict", @@ -5849,6 +6113,8 @@ "IssueTrackingCollectionsAllRequest", "IssueTrackingCollectionsAllRequestTypedDict", "IssueTrackingCollectionsAllResponse", + "IssueTrackingCollectionsAllResponseResult", + "IssueTrackingCollectionsAllResponseResultTypedDict", "IssueTrackingCollectionsAllResponseTypedDict", "IssueTrackingCollectionsOneGlobals", "IssueTrackingCollectionsOneGlobalsTypedDict", @@ -5986,6 +6252,10 @@ "OrdersSort", "OrdersSortBy", "OrdersSortTypedDict", + "OutstandingBalance", + "OutstandingBalanceByCurrency", + "OutstandingBalanceByCurrencyTypedDict", + "OutstandingBalanceTypedDict", "Owner", "OwnerTypedDict", "PaginationCoverage", @@ -6109,6 +6379,8 @@ "SmsMessagesAllRequest", "SmsMessagesAllRequestTypedDict", "SmsMessagesAllResponse", + "SmsMessagesAllResponseResult", + "SmsMessagesAllResponseResultTypedDict", "SmsMessagesAllResponseTypedDict", "SmsMessagesDeleteGlobals", "SmsMessagesDeleteGlobalsTypedDict", @@ -6205,6 +6477,7 @@ "TrackingCategoryTypedDict", "TrackingItem", "TrackingItemTypedDict", + "TransactionType", "Type", "UnauthorizedResponse", "UnauthorizedResponseData", @@ -6401,6 +6674,8 @@ "VaultConsumersAllRequest", "VaultConsumersAllRequestTypedDict", "VaultConsumersAllResponse", + "VaultConsumersAllResponseResult", + "VaultConsumersAllResponseResultTypedDict", "VaultConsumersAllResponseTypedDict", "VaultConsumersDeleteGlobals", "VaultConsumersDeleteGlobalsTypedDict", @@ -6443,6 +6718,8 @@ "VaultLogsAllRequest", "VaultLogsAllRequestTypedDict", "VaultLogsAllResponse", + "VaultLogsAllResponseResult", + "VaultLogsAllResponseResultTypedDict", "VaultLogsAllResponseTypedDict", "VaultSessionsCreateGlobals", "VaultSessionsCreateGlobalsTypedDict", @@ -6469,6 +6746,8 @@ "WebhookEventLogsAllRequest", "WebhookEventLogsAllRequestTypedDict", "WebhookEventLogsAllResponse", + "WebhookEventLogsAllResponseResult", + "WebhookEventLogsAllResponseResultTypedDict", "WebhookEventLogsAllResponseTypedDict", "WebhookEventLogsFilter", "WebhookEventLogsFilterService", @@ -6491,6 +6770,8 @@ "WebhookWebhooksAllRequest", "WebhookWebhooksAllRequestTypedDict", "WebhookWebhooksAllResponse", + "WebhookWebhooksAllResponseResult", + "WebhookWebhooksAllResponseResultTypedDict", "WebhookWebhooksAllResponseTypedDict", "WebhookWebhooksDeleteGlobals", "WebhookWebhooksDeleteGlobalsTypedDict", diff --git a/src/apideck_unify/models/accounting_agedcreditorsoneop.py b/src/apideck_unify/models/accounting_agedcreditorsoneop.py new file mode 100644 index 00000000..cc48ce5e --- /dev/null +++ b/src/apideck_unify/models/accounting_agedcreditorsoneop.py @@ -0,0 +1,136 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .agedreportfilter import AgedReportFilter, AgedReportFilterTypedDict +from .getagedcreditorsresponse import ( + GetAgedCreditorsResponse, + GetAgedCreditorsResponseTypedDict, +) +from .unexpectederrorresponse import ( + UnexpectedErrorResponse, + UnexpectedErrorResponseTypedDict, +) +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +class AccountingAgedCreditorsOneGlobalsTypedDict(TypedDict): + consumer_id: NotRequired[str] + r"""ID of the consumer which you want to get or push data from""" + app_id: NotRequired[str] + r"""The ID of your Unify application""" + + +class AccountingAgedCreditorsOneGlobals(BaseModel): + consumer_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-consumer-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""ID of the consumer which you want to get or push data from""" + + app_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-app-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The ID of your Unify application""" + + +class AccountingAgedCreditorsOneRequestTypedDict(TypedDict): + raw: NotRequired[bool] + r"""Include raw response. Mostly used for debugging purposes""" + service_id: NotRequired[str] + r"""Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.""" + filter_: NotRequired[AgedReportFilterTypedDict] + r"""Apply filters""" + pass_through: NotRequired[Dict[str, Any]] + r"""Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads""" + fields: NotRequired[Nullable[str]] + r"""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.""" + + +class AccountingAgedCreditorsOneRequest(BaseModel): + raw: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Include raw response. Mostly used for debugging purposes""" + + service_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-service-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.""" + + filter_: Annotated[ + Optional[AgedReportFilter], + pydantic.Field(alias="filter"), + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = None + r"""Apply filters""" + + pass_through: Annotated[ + Optional[Dict[str, Any]], + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = None + r"""Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads""" + + fields: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["raw", "serviceId", "filter", "pass_through", "fields"] + nullable_fields = ["fields"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in 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 + + +AccountingAgedCreditorsOneResponseTypedDict = TypeAliasType( + "AccountingAgedCreditorsOneResponseTypedDict", + Union[GetAgedCreditorsResponseTypedDict, UnexpectedErrorResponseTypedDict], +) + + +AccountingAgedCreditorsOneResponse = TypeAliasType( + "AccountingAgedCreditorsOneResponse", + Union[GetAgedCreditorsResponse, UnexpectedErrorResponse], +) diff --git a/src/apideck_unify/models/accounting_ageddebtorsoneop.py b/src/apideck_unify/models/accounting_ageddebtorsoneop.py new file mode 100644 index 00000000..6df45656 --- /dev/null +++ b/src/apideck_unify/models/accounting_ageddebtorsoneop.py @@ -0,0 +1,136 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .agedreportfilter import AgedReportFilter, AgedReportFilterTypedDict +from .getageddebtorsresponse import ( + GetAgedDebtorsResponse, + GetAgedDebtorsResponseTypedDict, +) +from .unexpectederrorresponse import ( + UnexpectedErrorResponse, + UnexpectedErrorResponseTypedDict, +) +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +class AccountingAgedDebtorsOneGlobalsTypedDict(TypedDict): + consumer_id: NotRequired[str] + r"""ID of the consumer which you want to get or push data from""" + app_id: NotRequired[str] + r"""The ID of your Unify application""" + + +class AccountingAgedDebtorsOneGlobals(BaseModel): + consumer_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-consumer-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""ID of the consumer which you want to get or push data from""" + + app_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-app-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The ID of your Unify application""" + + +class AccountingAgedDebtorsOneRequestTypedDict(TypedDict): + raw: NotRequired[bool] + r"""Include raw response. Mostly used for debugging purposes""" + service_id: NotRequired[str] + r"""Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.""" + filter_: NotRequired[AgedReportFilterTypedDict] + r"""Apply filters""" + pass_through: NotRequired[Dict[str, Any]] + r"""Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads""" + fields: NotRequired[Nullable[str]] + r"""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.""" + + +class AccountingAgedDebtorsOneRequest(BaseModel): + raw: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Include raw response. Mostly used for debugging purposes""" + + service_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-service-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.""" + + filter_: Annotated[ + Optional[AgedReportFilter], + pydantic.Field(alias="filter"), + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = None + r"""Apply filters""" + + pass_through: Annotated[ + Optional[Dict[str, Any]], + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = None + r"""Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads""" + + fields: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""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.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["raw", "serviceId", "filter", "pass_through", "fields"] + nullable_fields = ["fields"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in 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 + + +AccountingAgedDebtorsOneResponseTypedDict = TypeAliasType( + "AccountingAgedDebtorsOneResponseTypedDict", + Union[GetAgedDebtorsResponseTypedDict, UnexpectedErrorResponseTypedDict], +) + + +AccountingAgedDebtorsOneResponse = TypeAliasType( + "AccountingAgedDebtorsOneResponse", + Union[GetAgedDebtorsResponse, UnexpectedErrorResponse], +) diff --git a/src/apideck_unify/models/accounting_attachmentsallop.py b/src/apideck_unify/models/accounting_attachmentsallop.py index 93f1c802..d3a0c24e 100644 --- a/src/apideck_unify/models/accounting_attachmentsallop.py +++ b/src/apideck_unify/models/accounting_attachmentsallop.py @@ -25,7 +25,7 @@ ) import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -143,13 +143,23 @@ def serialize_model(self, handler): return m -AccountingAttachmentsAllResponseTypedDict = TypeAliasType( - "AccountingAttachmentsAllResponseTypedDict", +AccountingAttachmentsAllResponseResultTypedDict = TypeAliasType( + "AccountingAttachmentsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetAttachmentsResponseTypedDict], ) -AccountingAttachmentsAllResponse = TypeAliasType( - "AccountingAttachmentsAllResponse", +AccountingAttachmentsAllResponseResult = TypeAliasType( + "AccountingAttachmentsAllResponseResult", Union[UnexpectedErrorResponse, GetAttachmentsResponse], ) + + +class AccountingAttachmentsAllResponseTypedDict(TypedDict): + result: AccountingAttachmentsAllResponseResultTypedDict + + +class AccountingAttachmentsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingAttachmentsAllResponse]] + + result: AccountingAttachmentsAllResponseResult diff --git a/src/apideck_unify/models/accounting_billpaymentsallop.py b/src/apideck_unify/models/accounting_billpaymentsallop.py index b9a37479..23bfcb55 100644 --- a/src/apideck_unify/models/accounting_billpaymentsallop.py +++ b/src/apideck_unify/models/accounting_billpaymentsallop.py @@ -21,7 +21,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -158,13 +158,23 @@ def serialize_model(self, handler): return m -AccountingBillPaymentsAllResponseTypedDict = TypeAliasType( - "AccountingBillPaymentsAllResponseTypedDict", +AccountingBillPaymentsAllResponseResultTypedDict = TypeAliasType( + "AccountingBillPaymentsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetBillPaymentsResponseTypedDict], ) -AccountingBillPaymentsAllResponse = TypeAliasType( - "AccountingBillPaymentsAllResponse", +AccountingBillPaymentsAllResponseResult = TypeAliasType( + "AccountingBillPaymentsAllResponseResult", Union[UnexpectedErrorResponse, GetBillPaymentsResponse], ) + + +class AccountingBillPaymentsAllResponseTypedDict(TypedDict): + result: AccountingBillPaymentsAllResponseResultTypedDict + + +class AccountingBillPaymentsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingBillPaymentsAllResponse]] + + result: AccountingBillPaymentsAllResponseResult diff --git a/src/apideck_unify/models/accounting_billsallop.py b/src/apideck_unify/models/accounting_billsallop.py index 99121974..d0d16517 100644 --- a/src/apideck_unify/models/accounting_billsallop.py +++ b/src/apideck_unify/models/accounting_billsallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,22 @@ def serialize_model(self, handler): return m -AccountingBillsAllResponseTypedDict = TypeAliasType( - "AccountingBillsAllResponseTypedDict", +AccountingBillsAllResponseResultTypedDict = TypeAliasType( + "AccountingBillsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetBillsResponseTypedDict], ) -AccountingBillsAllResponse = TypeAliasType( - "AccountingBillsAllResponse", Union[UnexpectedErrorResponse, GetBillsResponse] +AccountingBillsAllResponseResult = TypeAliasType( + "AccountingBillsAllResponseResult", Union[UnexpectedErrorResponse, GetBillsResponse] ) + + +class AccountingBillsAllResponseTypedDict(TypedDict): + result: AccountingBillsAllResponseResultTypedDict + + +class AccountingBillsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingBillsAllResponse]] + + result: AccountingBillsAllResponseResult diff --git a/src/apideck_unify/models/accounting_creditnotesallop.py b/src/apideck_unify/models/accounting_creditnotesallop.py index 07036e44..549f4fde 100644 --- a/src/apideck_unify/models/accounting_creditnotesallop.py +++ b/src/apideck_unify/models/accounting_creditnotesallop.py @@ -21,7 +21,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -158,13 +158,23 @@ def serialize_model(self, handler): return m -AccountingCreditNotesAllResponseTypedDict = TypeAliasType( - "AccountingCreditNotesAllResponseTypedDict", +AccountingCreditNotesAllResponseResultTypedDict = TypeAliasType( + "AccountingCreditNotesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetCreditNotesResponseTypedDict], ) -AccountingCreditNotesAllResponse = TypeAliasType( - "AccountingCreditNotesAllResponse", +AccountingCreditNotesAllResponseResult = TypeAliasType( + "AccountingCreditNotesAllResponseResult", Union[UnexpectedErrorResponse, GetCreditNotesResponse], ) + + +class AccountingCreditNotesAllResponseTypedDict(TypedDict): + result: AccountingCreditNotesAllResponseResultTypedDict + + +class AccountingCreditNotesAllResponse(BaseModel): + next: Callable[[], Optional[AccountingCreditNotesAllResponse]] + + result: AccountingCreditNotesAllResponseResult diff --git a/src/apideck_unify/models/accounting_customersallop.py b/src/apideck_unify/models/accounting_customersallop.py index 88269c48..ece6dd9f 100644 --- a/src/apideck_unify/models/accounting_customersallop.py +++ b/src/apideck_unify/models/accounting_customersallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,13 +155,23 @@ def serialize_model(self, handler): return m -AccountingCustomersAllResponseTypedDict = TypeAliasType( - "AccountingCustomersAllResponseTypedDict", +AccountingCustomersAllResponseResultTypedDict = TypeAliasType( + "AccountingCustomersAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetCustomersResponseTypedDict], ) -AccountingCustomersAllResponse = TypeAliasType( - "AccountingCustomersAllResponse", +AccountingCustomersAllResponseResult = TypeAliasType( + "AccountingCustomersAllResponseResult", Union[UnexpectedErrorResponse, GetCustomersResponse], ) + + +class AccountingCustomersAllResponseTypedDict(TypedDict): + result: AccountingCustomersAllResponseResultTypedDict + + +class AccountingCustomersAllResponse(BaseModel): + next: Callable[[], Optional[AccountingCustomersAllResponse]] + + result: AccountingCustomersAllResponseResult diff --git a/src/apideck_unify/models/accounting_departmentsallop.py b/src/apideck_unify/models/accounting_departmentsallop.py index 9a6d87e8..62528f81 100644 --- a/src/apideck_unify/models/accounting_departmentsallop.py +++ b/src/apideck_unify/models/accounting_departmentsallop.py @@ -23,7 +23,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -135,13 +135,23 @@ def serialize_model(self, handler): return m -AccountingDepartmentsAllResponseTypedDict = TypeAliasType( - "AccountingDepartmentsAllResponseTypedDict", +AccountingDepartmentsAllResponseResultTypedDict = TypeAliasType( + "AccountingDepartmentsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetAccountingDepartmentsResponseTypedDict], ) -AccountingDepartmentsAllResponse = TypeAliasType( - "AccountingDepartmentsAllResponse", +AccountingDepartmentsAllResponseResult = TypeAliasType( + "AccountingDepartmentsAllResponseResult", Union[UnexpectedErrorResponse, GetAccountingDepartmentsResponse], ) + + +class AccountingDepartmentsAllResponseTypedDict(TypedDict): + result: AccountingDepartmentsAllResponseResultTypedDict + + +class AccountingDepartmentsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingDepartmentsAllResponse]] + + result: AccountingDepartmentsAllResponseResult diff --git a/src/apideck_unify/models/accounting_expensesallop.py b/src/apideck_unify/models/accounting_expensesallop.py index 416abcc4..c00367ef 100644 --- a/src/apideck_unify/models/accounting_expensesallop.py +++ b/src/apideck_unify/models/accounting_expensesallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -111,12 +111,23 @@ def serialize_model(self, handler): return m -AccountingExpensesAllResponseTypedDict = TypeAliasType( - "AccountingExpensesAllResponseTypedDict", +AccountingExpensesAllResponseResultTypedDict = TypeAliasType( + "AccountingExpensesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetExpensesResponseTypedDict], ) -AccountingExpensesAllResponse = TypeAliasType( - "AccountingExpensesAllResponse", Union[UnexpectedErrorResponse, GetExpensesResponse] +AccountingExpensesAllResponseResult = TypeAliasType( + "AccountingExpensesAllResponseResult", + Union[UnexpectedErrorResponse, GetExpensesResponse], ) + + +class AccountingExpensesAllResponseTypedDict(TypedDict): + result: AccountingExpensesAllResponseResultTypedDict + + +class AccountingExpensesAllResponse(BaseModel): + next: Callable[[], Optional[AccountingExpensesAllResponse]] + + result: AccountingExpensesAllResponseResult diff --git a/src/apideck_unify/models/accounting_invoiceitemsallop.py b/src/apideck_unify/models/accounting_invoiceitemsallop.py index e6d87edf..476eeab9 100644 --- a/src/apideck_unify/models/accounting_invoiceitemsallop.py +++ b/src/apideck_unify/models/accounting_invoiceitemsallop.py @@ -20,7 +20,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -148,13 +148,23 @@ def serialize_model(self, handler): return m -AccountingInvoiceItemsAllResponseTypedDict = TypeAliasType( - "AccountingInvoiceItemsAllResponseTypedDict", +AccountingInvoiceItemsAllResponseResultTypedDict = TypeAliasType( + "AccountingInvoiceItemsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetInvoiceItemsResponseTypedDict], ) -AccountingInvoiceItemsAllResponse = TypeAliasType( - "AccountingInvoiceItemsAllResponse", +AccountingInvoiceItemsAllResponseResult = TypeAliasType( + "AccountingInvoiceItemsAllResponseResult", Union[UnexpectedErrorResponse, GetInvoiceItemsResponse], ) + + +class AccountingInvoiceItemsAllResponseTypedDict(TypedDict): + result: AccountingInvoiceItemsAllResponseResultTypedDict + + +class AccountingInvoiceItemsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingInvoiceItemsAllResponse]] + + result: AccountingInvoiceItemsAllResponseResult diff --git a/src/apideck_unify/models/accounting_invoicesallop.py b/src/apideck_unify/models/accounting_invoicesallop.py index 5661a407..313ff959 100644 --- a/src/apideck_unify/models/accounting_invoicesallop.py +++ b/src/apideck_unify/models/accounting_invoicesallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,23 @@ def serialize_model(self, handler): return m -AccountingInvoicesAllResponseTypedDict = TypeAliasType( - "AccountingInvoicesAllResponseTypedDict", +AccountingInvoicesAllResponseResultTypedDict = TypeAliasType( + "AccountingInvoicesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetInvoicesResponseTypedDict], ) -AccountingInvoicesAllResponse = TypeAliasType( - "AccountingInvoicesAllResponse", Union[UnexpectedErrorResponse, GetInvoicesResponse] +AccountingInvoicesAllResponseResult = TypeAliasType( + "AccountingInvoicesAllResponseResult", + Union[UnexpectedErrorResponse, GetInvoicesResponse], ) + + +class AccountingInvoicesAllResponseTypedDict(TypedDict): + result: AccountingInvoicesAllResponseResultTypedDict + + +class AccountingInvoicesAllResponse(BaseModel): + next: Callable[[], Optional[AccountingInvoicesAllResponse]] + + result: AccountingInvoicesAllResponseResult diff --git a/src/apideck_unify/models/accounting_journalentriesallop.py b/src/apideck_unify/models/accounting_journalentriesallop.py index 7a91cbcf..41e883c5 100644 --- a/src/apideck_unify/models/accounting_journalentriesallop.py +++ b/src/apideck_unify/models/accounting_journalentriesallop.py @@ -21,7 +21,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -158,13 +158,23 @@ def serialize_model(self, handler): return m -AccountingJournalEntriesAllResponseTypedDict = TypeAliasType( - "AccountingJournalEntriesAllResponseTypedDict", +AccountingJournalEntriesAllResponseResultTypedDict = TypeAliasType( + "AccountingJournalEntriesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetJournalEntriesResponseTypedDict], ) -AccountingJournalEntriesAllResponse = TypeAliasType( - "AccountingJournalEntriesAllResponse", +AccountingJournalEntriesAllResponseResult = TypeAliasType( + "AccountingJournalEntriesAllResponseResult", Union[UnexpectedErrorResponse, GetJournalEntriesResponse], ) + + +class AccountingJournalEntriesAllResponseTypedDict(TypedDict): + result: AccountingJournalEntriesAllResponseResultTypedDict + + +class AccountingJournalEntriesAllResponse(BaseModel): + next: Callable[[], Optional[AccountingJournalEntriesAllResponse]] + + result: AccountingJournalEntriesAllResponseResult diff --git a/src/apideck_unify/models/accounting_ledgeraccountsallop.py b/src/apideck_unify/models/accounting_ledgeraccountsallop.py index df1d15ce..3d70eacb 100644 --- a/src/apideck_unify/models/accounting_ledgeraccountsallop.py +++ b/src/apideck_unify/models/accounting_ledgeraccountsallop.py @@ -21,7 +21,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -158,13 +158,23 @@ def serialize_model(self, handler): return m -AccountingLedgerAccountsAllResponseTypedDict = TypeAliasType( - "AccountingLedgerAccountsAllResponseTypedDict", +AccountingLedgerAccountsAllResponseResultTypedDict = TypeAliasType( + "AccountingLedgerAccountsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetLedgerAccountsResponseTypedDict], ) -AccountingLedgerAccountsAllResponse = TypeAliasType( - "AccountingLedgerAccountsAllResponse", +AccountingLedgerAccountsAllResponseResult = TypeAliasType( + "AccountingLedgerAccountsAllResponseResult", Union[UnexpectedErrorResponse, GetLedgerAccountsResponse], ) + + +class AccountingLedgerAccountsAllResponseTypedDict(TypedDict): + result: AccountingLedgerAccountsAllResponseResultTypedDict + + +class AccountingLedgerAccountsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingLedgerAccountsAllResponse]] + + result: AccountingLedgerAccountsAllResponseResult diff --git a/src/apideck_unify/models/accounting_locationsallop.py b/src/apideck_unify/models/accounting_locationsallop.py index ba2f4c8e..579b2ed9 100644 --- a/src/apideck_unify/models/accounting_locationsallop.py +++ b/src/apideck_unify/models/accounting_locationsallop.py @@ -23,7 +23,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -135,13 +135,23 @@ def serialize_model(self, handler): return m -AccountingLocationsAllResponseTypedDict = TypeAliasType( - "AccountingLocationsAllResponseTypedDict", +AccountingLocationsAllResponseResultTypedDict = TypeAliasType( + "AccountingLocationsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetAccountingLocationsResponseTypedDict], ) -AccountingLocationsAllResponse = TypeAliasType( - "AccountingLocationsAllResponse", +AccountingLocationsAllResponseResult = TypeAliasType( + "AccountingLocationsAllResponseResult", Union[UnexpectedErrorResponse, GetAccountingLocationsResponse], ) + + +class AccountingLocationsAllResponseTypedDict(TypedDict): + result: AccountingLocationsAllResponseResultTypedDict + + +class AccountingLocationsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingLocationsAllResponse]] + + result: AccountingLocationsAllResponseResult diff --git a/src/apideck_unify/models/accounting_paymentsallop.py b/src/apideck_unify/models/accounting_paymentsallop.py index b388d7fa..cb148389 100644 --- a/src/apideck_unify/models/accounting_paymentsallop.py +++ b/src/apideck_unify/models/accounting_paymentsallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,23 @@ def serialize_model(self, handler): return m -AccountingPaymentsAllResponseTypedDict = TypeAliasType( - "AccountingPaymentsAllResponseTypedDict", +AccountingPaymentsAllResponseResultTypedDict = TypeAliasType( + "AccountingPaymentsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetPaymentsResponseTypedDict], ) -AccountingPaymentsAllResponse = TypeAliasType( - "AccountingPaymentsAllResponse", Union[UnexpectedErrorResponse, GetPaymentsResponse] +AccountingPaymentsAllResponseResult = TypeAliasType( + "AccountingPaymentsAllResponseResult", + Union[UnexpectedErrorResponse, GetPaymentsResponse], ) + + +class AccountingPaymentsAllResponseTypedDict(TypedDict): + result: AccountingPaymentsAllResponseResultTypedDict + + +class AccountingPaymentsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingPaymentsAllResponse]] + + result: AccountingPaymentsAllResponseResult diff --git a/src/apideck_unify/models/accounting_purchaseordersallop.py b/src/apideck_unify/models/accounting_purchaseordersallop.py index 0684089a..3a9078d7 100644 --- a/src/apideck_unify/models/accounting_purchaseordersallop.py +++ b/src/apideck_unify/models/accounting_purchaseordersallop.py @@ -21,7 +21,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -149,13 +149,23 @@ def serialize_model(self, handler): return m -AccountingPurchaseOrdersAllResponseTypedDict = TypeAliasType( - "AccountingPurchaseOrdersAllResponseTypedDict", +AccountingPurchaseOrdersAllResponseResultTypedDict = TypeAliasType( + "AccountingPurchaseOrdersAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetPurchaseOrdersResponseTypedDict], ) -AccountingPurchaseOrdersAllResponse = TypeAliasType( - "AccountingPurchaseOrdersAllResponse", +AccountingPurchaseOrdersAllResponseResult = TypeAliasType( + "AccountingPurchaseOrdersAllResponseResult", Union[UnexpectedErrorResponse, GetPurchaseOrdersResponse], ) + + +class AccountingPurchaseOrdersAllResponseTypedDict(TypedDict): + result: AccountingPurchaseOrdersAllResponseResultTypedDict + + +class AccountingPurchaseOrdersAllResponse(BaseModel): + next: Callable[[], Optional[AccountingPurchaseOrdersAllResponse]] + + result: AccountingPurchaseOrdersAllResponseResult diff --git a/src/apideck_unify/models/accounting_subsidiariesallop.py b/src/apideck_unify/models/accounting_subsidiariesallop.py index cd3dc2a8..5ca7137b 100644 --- a/src/apideck_unify/models/accounting_subsidiariesallop.py +++ b/src/apideck_unify/models/accounting_subsidiariesallop.py @@ -19,7 +19,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -122,13 +122,23 @@ def serialize_model(self, handler): return m -AccountingSubsidiariesAllResponseTypedDict = TypeAliasType( - "AccountingSubsidiariesAllResponseTypedDict", +AccountingSubsidiariesAllResponseResultTypedDict = TypeAliasType( + "AccountingSubsidiariesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetSubsidiariesResponseTypedDict], ) -AccountingSubsidiariesAllResponse = TypeAliasType( - "AccountingSubsidiariesAllResponse", +AccountingSubsidiariesAllResponseResult = TypeAliasType( + "AccountingSubsidiariesAllResponseResult", Union[UnexpectedErrorResponse, GetSubsidiariesResponse], ) + + +class AccountingSubsidiariesAllResponseTypedDict(TypedDict): + result: AccountingSubsidiariesAllResponseResultTypedDict + + +class AccountingSubsidiariesAllResponse(BaseModel): + next: Callable[[], Optional[AccountingSubsidiariesAllResponse]] + + result: AccountingSubsidiariesAllResponseResult diff --git a/src/apideck_unify/models/accounting_suppliersallop.py b/src/apideck_unify/models/accounting_suppliersallop.py index 1da2d700..d1f07cf3 100644 --- a/src/apideck_unify/models/accounting_suppliersallop.py +++ b/src/apideck_unify/models/accounting_suppliersallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,13 +155,23 @@ def serialize_model(self, handler): return m -AccountingSuppliersAllResponseTypedDict = TypeAliasType( - "AccountingSuppliersAllResponseTypedDict", +AccountingSuppliersAllResponseResultTypedDict = TypeAliasType( + "AccountingSuppliersAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetSuppliersResponseTypedDict], ) -AccountingSuppliersAllResponse = TypeAliasType( - "AccountingSuppliersAllResponse", +AccountingSuppliersAllResponseResult = TypeAliasType( + "AccountingSuppliersAllResponseResult", Union[UnexpectedErrorResponse, GetSuppliersResponse], ) + + +class AccountingSuppliersAllResponseTypedDict(TypedDict): + result: AccountingSuppliersAllResponseResultTypedDict + + +class AccountingSuppliersAllResponse(BaseModel): + next: Callable[[], Optional[AccountingSuppliersAllResponse]] + + result: AccountingSuppliersAllResponseResult diff --git a/src/apideck_unify/models/accounting_taxratesallop.py b/src/apideck_unify/models/accounting_taxratesallop.py index b7b4d498..d3d6ef4b 100644 --- a/src/apideck_unify/models/accounting_taxratesallop.py +++ b/src/apideck_unify/models/accounting_taxratesallop.py @@ -17,7 +17,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -145,12 +145,23 @@ def serialize_model(self, handler): return m -AccountingTaxRatesAllResponseTypedDict = TypeAliasType( - "AccountingTaxRatesAllResponseTypedDict", +AccountingTaxRatesAllResponseResultTypedDict = TypeAliasType( + "AccountingTaxRatesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetTaxRatesResponseTypedDict], ) -AccountingTaxRatesAllResponse = TypeAliasType( - "AccountingTaxRatesAllResponse", Union[UnexpectedErrorResponse, GetTaxRatesResponse] +AccountingTaxRatesAllResponseResult = TypeAliasType( + "AccountingTaxRatesAllResponseResult", + Union[UnexpectedErrorResponse, GetTaxRatesResponse], ) + + +class AccountingTaxRatesAllResponseTypedDict(TypedDict): + result: AccountingTaxRatesAllResponseResultTypedDict + + +class AccountingTaxRatesAllResponse(BaseModel): + next: Callable[[], Optional[AccountingTaxRatesAllResponse]] + + result: AccountingTaxRatesAllResponseResult diff --git a/src/apideck_unify/models/accounting_taxratesupdateop.py b/src/apideck_unify/models/accounting_taxratesupdateop.py index 76b7701f..a387ee27 100644 --- a/src/apideck_unify/models/accounting_taxratesupdateop.py +++ b/src/apideck_unify/models/accounting_taxratesupdateop.py @@ -44,7 +44,7 @@ class AccountingTaxRatesUpdateGlobals(BaseModel): class AccountingTaxRatesUpdateRequestTypedDict(TypedDict): - id: str + id_param: str r"""ID of the record you are acting upon.""" tax_rate: TaxRateInputTypedDict service_id: NotRequired[str] @@ -54,8 +54,10 @@ class AccountingTaxRatesUpdateRequestTypedDict(TypedDict): class AccountingTaxRatesUpdateRequest(BaseModel): - id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + id_param: Annotated[ + str, + pydantic.Field(alias="id"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), ] r"""ID of the record you are acting upon.""" diff --git a/src/apideck_unify/models/accounting_trackingcategoriesallop.py b/src/apideck_unify/models/accounting_trackingcategoriesallop.py index b0c86140..a33b6266 100644 --- a/src/apideck_unify/models/accounting_trackingcategoriesallop.py +++ b/src/apideck_unify/models/accounting_trackingcategoriesallop.py @@ -19,7 +19,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -137,13 +137,23 @@ def serialize_model(self, handler): return m -AccountingTrackingCategoriesAllResponseTypedDict = TypeAliasType( - "AccountingTrackingCategoriesAllResponseTypedDict", +AccountingTrackingCategoriesAllResponseResultTypedDict = TypeAliasType( + "AccountingTrackingCategoriesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetTrackingCategoriesResponseTypedDict], ) -AccountingTrackingCategoriesAllResponse = TypeAliasType( - "AccountingTrackingCategoriesAllResponse", +AccountingTrackingCategoriesAllResponseResult = TypeAliasType( + "AccountingTrackingCategoriesAllResponseResult", Union[UnexpectedErrorResponse, GetTrackingCategoriesResponse], ) + + +class AccountingTrackingCategoriesAllResponseTypedDict(TypedDict): + result: AccountingTrackingCategoriesAllResponseResultTypedDict + + +class AccountingTrackingCategoriesAllResponse(BaseModel): + next: Callable[[], Optional[AccountingTrackingCategoriesAllResponse]] + + result: AccountingTrackingCategoriesAllResponseResult diff --git a/src/apideck_unify/models/agedcreditors.py b/src/apideck_unify/models/agedcreditors.py new file mode 100644 index 00000000..363abb6e --- /dev/null +++ b/src/apideck_unify/models/agedcreditors.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .outstandingbalance import OutstandingBalance, OutstandingBalanceTypedDict +from apideck_unify.types import BaseModel +from datetime import date, datetime +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class AgedCreditorsTypedDict(TypedDict): + report_generated_at: NotRequired[datetime] + r"""The exact date and time the report was generated.""" + report_as_of_date: NotRequired[date] + r"""The cutoff date for transactions included in the report.""" + period_count: NotRequired[int] + r"""Number of aging periods shown in the report.""" + period_length: NotRequired[int] + r"""Length of each aging period in days.""" + outstanding_balances: NotRequired[List[OutstandingBalanceTypedDict]] + + +class AgedCreditors(BaseModel): + report_generated_at: Optional[datetime] = None + r"""The exact date and time the report was generated.""" + + report_as_of_date: Optional[date] = None + r"""The cutoff date for transactions included in the report.""" + + period_count: Optional[int] = 4 + r"""Number of aging periods shown in the report.""" + + period_length: Optional[int] = 30 + r"""Length of each aging period in days.""" + + outstanding_balances: Optional[List[OutstandingBalance]] = None diff --git a/src/apideck_unify/models/ageddebtors.py b/src/apideck_unify/models/ageddebtors.py new file mode 100644 index 00000000..1a700c3e --- /dev/null +++ b/src/apideck_unify/models/ageddebtors.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .outstandingbalance import OutstandingBalance, OutstandingBalanceTypedDict +from apideck_unify.types import BaseModel +from datetime import date, datetime +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class AgedDebtorsTypedDict(TypedDict): + report_generated_at: NotRequired[datetime] + r"""The exact date and time the report was generated.""" + report_as_of_date: NotRequired[date] + r"""The cutoff date for transactions included in the report.""" + period_count: NotRequired[int] + r"""Number of aging periods shown in the report.""" + period_length: NotRequired[int] + r"""Length of each aging period in days.""" + outstanding_balances: NotRequired[List[OutstandingBalanceTypedDict]] + + +class AgedDebtors(BaseModel): + report_generated_at: Optional[datetime] = None + r"""The exact date and time the report was generated.""" + + report_as_of_date: Optional[date] = None + r"""The cutoff date for transactions included in the report.""" + + period_count: Optional[int] = 4 + r"""Number of aging periods shown in the report.""" + + period_length: Optional[int] = 30 + r"""Length of each aging period in days.""" + + outstanding_balances: Optional[List[OutstandingBalance]] = None diff --git a/src/apideck_unify/models/agedreportfilter.py b/src/apideck_unify/models/agedreportfilter.py new file mode 100644 index 00000000..6c9a8c4f --- /dev/null +++ b/src/apideck_unify/models/agedreportfilter.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from apideck_unify.types import BaseModel +from apideck_unify.utils import FieldMetadata +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AgedReportFilterTypedDict(TypedDict): + customer_id: NotRequired[str] + r"""Filter by customer id""" + report_as_of_date: NotRequired[str] + r"""The cutoff date for considering transactions""" + period_count: NotRequired[int] + r"""Number of periods to split the aged creditors report into""" + period_length: NotRequired[int] + r"""Length of each period in days""" + + +class AgedReportFilter(BaseModel): + customer_id: Annotated[Optional[str], FieldMetadata(query=True)] = None + r"""Filter by customer id""" + + report_as_of_date: Annotated[Optional[str], FieldMetadata(query=True)] = None + r"""The cutoff date for considering transactions""" + + period_count: Annotated[Optional[int], FieldMetadata(query=True)] = None + r"""Number of periods to split the aged creditors report into""" + + period_length: Annotated[Optional[int], FieldMetadata(query=True)] = None + r"""Length of each period in days""" diff --git a/src/apideck_unify/models/ats_applicantsallop.py b/src/apideck_unify/models/ats_applicantsallop.py index 01f749bf..b1b75ee6 100644 --- a/src/apideck_unify/models/ats_applicantsallop.py +++ b/src/apideck_unify/models/ats_applicantsallop.py @@ -17,7 +17,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -145,12 +145,23 @@ def serialize_model(self, handler): return m -AtsApplicantsAllResponseTypedDict = TypeAliasType( - "AtsApplicantsAllResponseTypedDict", +AtsApplicantsAllResponseResultTypedDict = TypeAliasType( + "AtsApplicantsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetApplicantsResponseTypedDict], ) -AtsApplicantsAllResponse = TypeAliasType( - "AtsApplicantsAllResponse", Union[UnexpectedErrorResponse, GetApplicantsResponse] +AtsApplicantsAllResponseResult = TypeAliasType( + "AtsApplicantsAllResponseResult", + Union[UnexpectedErrorResponse, GetApplicantsResponse], ) + + +class AtsApplicantsAllResponseTypedDict(TypedDict): + result: AtsApplicantsAllResponseResultTypedDict + + +class AtsApplicantsAllResponse(BaseModel): + next: Callable[[], Optional[AtsApplicantsAllResponse]] + + result: AtsApplicantsAllResponseResult diff --git a/src/apideck_unify/models/ats_applicationsallop.py b/src/apideck_unify/models/ats_applicationsallop.py index 2f3f8a50..df4915b1 100644 --- a/src/apideck_unify/models/ats_applicationsallop.py +++ b/src/apideck_unify/models/ats_applicationsallop.py @@ -19,7 +19,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -122,13 +122,23 @@ def serialize_model(self, handler): return m -AtsApplicationsAllResponseTypedDict = TypeAliasType( - "AtsApplicationsAllResponseTypedDict", +AtsApplicationsAllResponseResultTypedDict = TypeAliasType( + "AtsApplicationsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetApplicationsResponseTypedDict], ) -AtsApplicationsAllResponse = TypeAliasType( - "AtsApplicationsAllResponse", +AtsApplicationsAllResponseResult = TypeAliasType( + "AtsApplicationsAllResponseResult", Union[UnexpectedErrorResponse, GetApplicationsResponse], ) + + +class AtsApplicationsAllResponseTypedDict(TypedDict): + result: AtsApplicationsAllResponseResultTypedDict + + +class AtsApplicationsAllResponse(BaseModel): + next: Callable[[], Optional[AtsApplicationsAllResponse]] + + result: AtsApplicationsAllResponseResult diff --git a/src/apideck_unify/models/ats_jobsallop.py b/src/apideck_unify/models/ats_jobsallop.py index 737f0dac..aa1313f3 100644 --- a/src/apideck_unify/models/ats_jobsallop.py +++ b/src/apideck_unify/models/ats_jobsallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -134,12 +134,22 @@ def serialize_model(self, handler): return m -AtsJobsAllResponseTypedDict = TypeAliasType( - "AtsJobsAllResponseTypedDict", +AtsJobsAllResponseResultTypedDict = TypeAliasType( + "AtsJobsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetJobsResponseTypedDict], ) -AtsJobsAllResponse = TypeAliasType( - "AtsJobsAllResponse", Union[UnexpectedErrorResponse, GetJobsResponse] +AtsJobsAllResponseResult = TypeAliasType( + "AtsJobsAllResponseResult", Union[UnexpectedErrorResponse, GetJobsResponse] ) + + +class AtsJobsAllResponseTypedDict(TypedDict): + result: AtsJobsAllResponseResultTypedDict + + +class AtsJobsAllResponse(BaseModel): + next: Callable[[], Optional[AtsJobsAllResponse]] + + result: AtsJobsAllResponseResult diff --git a/src/apideck_unify/models/balancebyperiod.py b/src/apideck_unify/models/balancebyperiod.py new file mode 100644 index 00000000..b0c48c51 --- /dev/null +++ b/src/apideck_unify/models/balancebyperiod.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .balancebytransaction import BalanceByTransaction, BalanceByTransactionTypedDict +from apideck_unify.types import BaseModel +from datetime import date +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class BalanceByPeriodTypedDict(TypedDict): + start_date: NotRequired[date] + r"""Start date of the period.""" + end_date: NotRequired[date] + r"""End date of the period.""" + total_amount: NotRequired[float] + r"""Total amount of the period.""" + balances_by_transaction: NotRequired[List[BalanceByTransactionTypedDict]] + + +class BalanceByPeriod(BaseModel): + start_date: Optional[date] = None + r"""Start date of the period.""" + + end_date: Optional[date] = None + r"""End date of the period.""" + + total_amount: Optional[float] = None + r"""Total amount of the period.""" + + balances_by_transaction: Optional[List[BalanceByTransaction]] = None diff --git a/src/apideck_unify/models/balancebytransaction.py b/src/apideck_unify/models/balancebytransaction.py new file mode 100644 index 00000000..f4720adf --- /dev/null +++ b/src/apideck_unify/models/balancebytransaction.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from apideck_unify.types import BaseModel +from datetime import date +from enum import Enum +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class TransactionType(str, Enum): + r"""Type of the transaction.""" + + INVOICE = "invoice" + CREDIT_NOTE = "credit_note" + BILL = "bill" + PAYMENT = "payment" + BILL_PAYMENT = "bill-payment" + + +class BalanceByTransactionTypedDict(TypedDict): + transaction_id: NotRequired[str] + r"""Unique identifier for the transaction.""" + transaction_date: NotRequired[date] + r"""Date of the transaction.""" + transaction_type: NotRequired[TransactionType] + r"""Type of the transaction.""" + due_date: NotRequired[date] + r"""Due date of the transaction.""" + original_amount: NotRequired[float] + r"""Original amount of the transaction.""" + outstanding_balance: NotRequired[float] + r"""Outstanding balance of the transaction.""" + + +class BalanceByTransaction(BaseModel): + transaction_id: Optional[str] = None + r"""Unique identifier for the transaction.""" + + transaction_date: Optional[date] = None + r"""Date of the transaction.""" + + transaction_type: Optional[TransactionType] = None + r"""Type of the transaction.""" + + due_date: Optional[date] = None + r"""Due date of the transaction.""" + + original_amount: Optional[float] = None + r"""Original amount of the transaction.""" + + outstanding_balance: Optional[float] = None + r"""Outstanding balance of the transaction.""" diff --git a/src/apideck_unify/models/connector_apisallop.py b/src/apideck_unify/models/connector_apisallop.py index 2c891ffd..8ccdf479 100644 --- a/src/apideck_unify/models/connector_apisallop.py +++ b/src/apideck_unify/models/connector_apisallop.py @@ -17,7 +17,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -95,12 +95,22 @@ def serialize_model(self, handler): return m -ConnectorApisAllResponseTypedDict = TypeAliasType( - "ConnectorApisAllResponseTypedDict", +ConnectorApisAllResponseResultTypedDict = TypeAliasType( + "ConnectorApisAllResponseResultTypedDict", Union[GetApisResponseTypedDict, UnexpectedErrorResponseTypedDict], ) -ConnectorApisAllResponse = TypeAliasType( - "ConnectorApisAllResponse", Union[GetApisResponse, UnexpectedErrorResponse] +ConnectorApisAllResponseResult = TypeAliasType( + "ConnectorApisAllResponseResult", Union[GetApisResponse, UnexpectedErrorResponse] ) + + +class ConnectorApisAllResponseTypedDict(TypedDict): + result: ConnectorApisAllResponseResultTypedDict + + +class ConnectorApisAllResponse(BaseModel): + next: Callable[[], Optional[ConnectorApisAllResponse]] + + result: ConnectorApisAllResponseResult diff --git a/src/apideck_unify/models/connector_connectorsallop.py b/src/apideck_unify/models/connector_connectorsallop.py index 87737e8d..3fd89179 100644 --- a/src/apideck_unify/models/connector_connectorsallop.py +++ b/src/apideck_unify/models/connector_connectorsallop.py @@ -17,7 +17,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -95,13 +95,23 @@ def serialize_model(self, handler): return m -ConnectorConnectorsAllResponseTypedDict = TypeAliasType( - "ConnectorConnectorsAllResponseTypedDict", +ConnectorConnectorsAllResponseResultTypedDict = TypeAliasType( + "ConnectorConnectorsAllResponseResultTypedDict", Union[GetConnectorsResponseTypedDict, UnexpectedErrorResponseTypedDict], ) -ConnectorConnectorsAllResponse = TypeAliasType( - "ConnectorConnectorsAllResponse", +ConnectorConnectorsAllResponseResult = TypeAliasType( + "ConnectorConnectorsAllResponseResult", Union[GetConnectorsResponse, UnexpectedErrorResponse], ) + + +class ConnectorConnectorsAllResponseTypedDict(TypedDict): + result: ConnectorConnectorsAllResponseResultTypedDict + + +class ConnectorConnectorsAllResponse(BaseModel): + next: Callable[[], Optional[ConnectorConnectorsAllResponse]] + + result: ConnectorConnectorsAllResponseResult diff --git a/src/apideck_unify/models/crm_activitiesallop.py b/src/apideck_unify/models/crm_activitiesallop.py index c84362fa..612d1ae5 100644 --- a/src/apideck_unify/models/crm_activitiesallop.py +++ b/src/apideck_unify/models/crm_activitiesallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,23 @@ def serialize_model(self, handler): return m -CrmActivitiesAllResponseTypedDict = TypeAliasType( - "CrmActivitiesAllResponseTypedDict", +CrmActivitiesAllResponseResultTypedDict = TypeAliasType( + "CrmActivitiesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetActivitiesResponseTypedDict], ) -CrmActivitiesAllResponse = TypeAliasType( - "CrmActivitiesAllResponse", Union[UnexpectedErrorResponse, GetActivitiesResponse] +CrmActivitiesAllResponseResult = TypeAliasType( + "CrmActivitiesAllResponseResult", + Union[UnexpectedErrorResponse, GetActivitiesResponse], ) + + +class CrmActivitiesAllResponseTypedDict(TypedDict): + result: CrmActivitiesAllResponseResultTypedDict + + +class CrmActivitiesAllResponse(BaseModel): + next: Callable[[], Optional[CrmActivitiesAllResponse]] + + result: CrmActivitiesAllResponseResult diff --git a/src/apideck_unify/models/crm_companiesallop.py b/src/apideck_unify/models/crm_companiesallop.py index 6e509f64..f88a320a 100644 --- a/src/apideck_unify/models/crm_companiesallop.py +++ b/src/apideck_unify/models/crm_companiesallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,23 @@ def serialize_model(self, handler): return m -CrmCompaniesAllResponseTypedDict = TypeAliasType( - "CrmCompaniesAllResponseTypedDict", +CrmCompaniesAllResponseResultTypedDict = TypeAliasType( + "CrmCompaniesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetCompaniesResponseTypedDict], ) -CrmCompaniesAllResponse = TypeAliasType( - "CrmCompaniesAllResponse", Union[UnexpectedErrorResponse, GetCompaniesResponse] +CrmCompaniesAllResponseResult = TypeAliasType( + "CrmCompaniesAllResponseResult", + Union[UnexpectedErrorResponse, GetCompaniesResponse], ) + + +class CrmCompaniesAllResponseTypedDict(TypedDict): + result: CrmCompaniesAllResponseResultTypedDict + + +class CrmCompaniesAllResponse(BaseModel): + next: Callable[[], Optional[CrmCompaniesAllResponse]] + + result: CrmCompaniesAllResponseResult diff --git a/src/apideck_unify/models/crm_contactsallop.py b/src/apideck_unify/models/crm_contactsallop.py index a89c6f9e..0ac97a48 100644 --- a/src/apideck_unify/models/crm_contactsallop.py +++ b/src/apideck_unify/models/crm_contactsallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,22 @@ def serialize_model(self, handler): return m -CrmContactsAllResponseTypedDict = TypeAliasType( - "CrmContactsAllResponseTypedDict", +CrmContactsAllResponseResultTypedDict = TypeAliasType( + "CrmContactsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetContactsResponseTypedDict], ) -CrmContactsAllResponse = TypeAliasType( - "CrmContactsAllResponse", Union[UnexpectedErrorResponse, GetContactsResponse] +CrmContactsAllResponseResult = TypeAliasType( + "CrmContactsAllResponseResult", Union[UnexpectedErrorResponse, GetContactsResponse] ) + + +class CrmContactsAllResponseTypedDict(TypedDict): + result: CrmContactsAllResponseResultTypedDict + + +class CrmContactsAllResponse(BaseModel): + next: Callable[[], Optional[CrmContactsAllResponse]] + + result: CrmContactsAllResponseResult diff --git a/src/apideck_unify/models/crm_leadsallop.py b/src/apideck_unify/models/crm_leadsallop.py index ec319943..d9a2929a 100644 --- a/src/apideck_unify/models/crm_leadsallop.py +++ b/src/apideck_unify/models/crm_leadsallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,22 @@ def serialize_model(self, handler): return m -CrmLeadsAllResponseTypedDict = TypeAliasType( - "CrmLeadsAllResponseTypedDict", +CrmLeadsAllResponseResultTypedDict = TypeAliasType( + "CrmLeadsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetLeadsResponseTypedDict], ) -CrmLeadsAllResponse = TypeAliasType( - "CrmLeadsAllResponse", Union[UnexpectedErrorResponse, GetLeadsResponse] +CrmLeadsAllResponseResult = TypeAliasType( + "CrmLeadsAllResponseResult", Union[UnexpectedErrorResponse, GetLeadsResponse] ) + + +class CrmLeadsAllResponseTypedDict(TypedDict): + result: CrmLeadsAllResponseResultTypedDict + + +class CrmLeadsAllResponse(BaseModel): + next: Callable[[], Optional[CrmLeadsAllResponse]] + + result: CrmLeadsAllResponseResult diff --git a/src/apideck_unify/models/crm_notesallop.py b/src/apideck_unify/models/crm_notesallop.py index af587404..b627898d 100644 --- a/src/apideck_unify/models/crm_notesallop.py +++ b/src/apideck_unify/models/crm_notesallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -134,12 +134,22 @@ def serialize_model(self, handler): return m -CrmNotesAllResponseTypedDict = TypeAliasType( - "CrmNotesAllResponseTypedDict", +CrmNotesAllResponseResultTypedDict = TypeAliasType( + "CrmNotesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetNotesResponseTypedDict], ) -CrmNotesAllResponse = TypeAliasType( - "CrmNotesAllResponse", Union[UnexpectedErrorResponse, GetNotesResponse] +CrmNotesAllResponseResult = TypeAliasType( + "CrmNotesAllResponseResult", Union[UnexpectedErrorResponse, GetNotesResponse] ) + + +class CrmNotesAllResponseTypedDict(TypedDict): + result: CrmNotesAllResponseResultTypedDict + + +class CrmNotesAllResponse(BaseModel): + next: Callable[[], Optional[CrmNotesAllResponse]] + + result: CrmNotesAllResponseResult diff --git a/src/apideck_unify/models/crm_opportunitiesallop.py b/src/apideck_unify/models/crm_opportunitiesallop.py index 8ae1d452..6ed3b20e 100644 --- a/src/apideck_unify/models/crm_opportunitiesallop.py +++ b/src/apideck_unify/models/crm_opportunitiesallop.py @@ -21,7 +21,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -158,13 +158,23 @@ def serialize_model(self, handler): return m -CrmOpportunitiesAllResponseTypedDict = TypeAliasType( - "CrmOpportunitiesAllResponseTypedDict", +CrmOpportunitiesAllResponseResultTypedDict = TypeAliasType( + "CrmOpportunitiesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetOpportunitiesResponseTypedDict], ) -CrmOpportunitiesAllResponse = TypeAliasType( - "CrmOpportunitiesAllResponse", +CrmOpportunitiesAllResponseResult = TypeAliasType( + "CrmOpportunitiesAllResponseResult", Union[UnexpectedErrorResponse, GetOpportunitiesResponse], ) + + +class CrmOpportunitiesAllResponseTypedDict(TypedDict): + result: CrmOpportunitiesAllResponseResultTypedDict + + +class CrmOpportunitiesAllResponse(BaseModel): + next: Callable[[], Optional[CrmOpportunitiesAllResponse]] + + result: CrmOpportunitiesAllResponseResult diff --git a/src/apideck_unify/models/crm_pipelinesallop.py b/src/apideck_unify/models/crm_pipelinesallop.py index a6b64acc..8218f2b5 100644 --- a/src/apideck_unify/models/crm_pipelinesallop.py +++ b/src/apideck_unify/models/crm_pipelinesallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -134,12 +134,23 @@ def serialize_model(self, handler): return m -CrmPipelinesAllResponseTypedDict = TypeAliasType( - "CrmPipelinesAllResponseTypedDict", +CrmPipelinesAllResponseResultTypedDict = TypeAliasType( + "CrmPipelinesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetPipelinesResponseTypedDict], ) -CrmPipelinesAllResponse = TypeAliasType( - "CrmPipelinesAllResponse", Union[UnexpectedErrorResponse, GetPipelinesResponse] +CrmPipelinesAllResponseResult = TypeAliasType( + "CrmPipelinesAllResponseResult", + Union[UnexpectedErrorResponse, GetPipelinesResponse], ) + + +class CrmPipelinesAllResponseTypedDict(TypedDict): + result: CrmPipelinesAllResponseResultTypedDict + + +class CrmPipelinesAllResponse(BaseModel): + next: Callable[[], Optional[CrmPipelinesAllResponse]] + + result: CrmPipelinesAllResponseResult diff --git a/src/apideck_unify/models/crm_pipelinesupdateop.py b/src/apideck_unify/models/crm_pipelinesupdateop.py index 77edded8..43ec7708 100644 --- a/src/apideck_unify/models/crm_pipelinesupdateop.py +++ b/src/apideck_unify/models/crm_pipelinesupdateop.py @@ -47,7 +47,7 @@ class CrmPipelinesUpdateGlobals(BaseModel): class CrmPipelinesUpdateRequestTypedDict(TypedDict): - id: str + id_param: str r"""ID of the record you are acting upon.""" pipeline: PipelineInputTypedDict service_id: NotRequired[str] @@ -57,8 +57,10 @@ class CrmPipelinesUpdateRequestTypedDict(TypedDict): class CrmPipelinesUpdateRequest(BaseModel): - id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + id_param: Annotated[ + str, + pydantic.Field(alias="id"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), ] r"""ID of the record you are acting upon.""" diff --git a/src/apideck_unify/models/crm_usersallop.py b/src/apideck_unify/models/crm_usersallop.py index 9384b25f..54fa1e8d 100644 --- a/src/apideck_unify/models/crm_usersallop.py +++ b/src/apideck_unify/models/crm_usersallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -134,12 +134,22 @@ def serialize_model(self, handler): return m -CrmUsersAllResponseTypedDict = TypeAliasType( - "CrmUsersAllResponseTypedDict", +CrmUsersAllResponseResultTypedDict = TypeAliasType( + "CrmUsersAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetUsersResponseTypedDict], ) -CrmUsersAllResponse = TypeAliasType( - "CrmUsersAllResponse", Union[UnexpectedErrorResponse, GetUsersResponse] +CrmUsersAllResponseResult = TypeAliasType( + "CrmUsersAllResponseResult", Union[UnexpectedErrorResponse, GetUsersResponse] ) + + +class CrmUsersAllResponseTypedDict(TypedDict): + result: CrmUsersAllResponseResultTypedDict + + +class CrmUsersAllResponse(BaseModel): + next: Callable[[], Optional[CrmUsersAllResponse]] + + result: CrmUsersAllResponseResult diff --git a/src/apideck_unify/models/ecommerce_customersallop.py b/src/apideck_unify/models/ecommerce_customersallop.py index d5056e8c..f44404fd 100644 --- a/src/apideck_unify/models/ecommerce_customersallop.py +++ b/src/apideck_unify/models/ecommerce_customersallop.py @@ -23,7 +23,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -151,13 +151,23 @@ def serialize_model(self, handler): return m -EcommerceCustomersAllResponseTypedDict = TypeAliasType( - "EcommerceCustomersAllResponseTypedDict", +EcommerceCustomersAllResponseResultTypedDict = TypeAliasType( + "EcommerceCustomersAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetEcommerceCustomersResponseTypedDict], ) -EcommerceCustomersAllResponse = TypeAliasType( - "EcommerceCustomersAllResponse", +EcommerceCustomersAllResponseResult = TypeAliasType( + "EcommerceCustomersAllResponseResult", Union[UnexpectedErrorResponse, GetEcommerceCustomersResponse], ) + + +class EcommerceCustomersAllResponseTypedDict(TypedDict): + result: EcommerceCustomersAllResponseResultTypedDict + + +class EcommerceCustomersAllResponse(BaseModel): + next: Callable[[], Optional[EcommerceCustomersAllResponse]] + + result: EcommerceCustomersAllResponseResult diff --git a/src/apideck_unify/models/ecommerce_ordersallop.py b/src/apideck_unify/models/ecommerce_ordersallop.py index b1c61697..93c25c78 100644 --- a/src/apideck_unify/models/ecommerce_ordersallop.py +++ b/src/apideck_unify/models/ecommerce_ordersallop.py @@ -21,7 +21,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -158,13 +158,23 @@ def serialize_model(self, handler): return m -EcommerceOrdersAllResponseTypedDict = TypeAliasType( - "EcommerceOrdersAllResponseTypedDict", +EcommerceOrdersAllResponseResultTypedDict = TypeAliasType( + "EcommerceOrdersAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetEcommerceOrdersResponseTypedDict], ) -EcommerceOrdersAllResponse = TypeAliasType( - "EcommerceOrdersAllResponse", +EcommerceOrdersAllResponseResult = TypeAliasType( + "EcommerceOrdersAllResponseResult", Union[UnexpectedErrorResponse, GetEcommerceOrdersResponse], ) + + +class EcommerceOrdersAllResponseTypedDict(TypedDict): + result: EcommerceOrdersAllResponseResultTypedDict + + +class EcommerceOrdersAllResponse(BaseModel): + next: Callable[[], Optional[EcommerceOrdersAllResponse]] + + result: EcommerceOrdersAllResponseResult diff --git a/src/apideck_unify/models/ecommerce_productsallop.py b/src/apideck_unify/models/ecommerce_productsallop.py index 8ce96a6e..ed73719d 100644 --- a/src/apideck_unify/models/ecommerce_productsallop.py +++ b/src/apideck_unify/models/ecommerce_productsallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -134,12 +134,23 @@ def serialize_model(self, handler): return m -EcommerceProductsAllResponseTypedDict = TypeAliasType( - "EcommerceProductsAllResponseTypedDict", +EcommerceProductsAllResponseResultTypedDict = TypeAliasType( + "EcommerceProductsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetProductsResponseTypedDict], ) -EcommerceProductsAllResponse = TypeAliasType( - "EcommerceProductsAllResponse", Union[UnexpectedErrorResponse, GetProductsResponse] +EcommerceProductsAllResponseResult = TypeAliasType( + "EcommerceProductsAllResponseResult", + Union[UnexpectedErrorResponse, GetProductsResponse], ) + + +class EcommerceProductsAllResponseTypedDict(TypedDict): + result: EcommerceProductsAllResponseResultTypedDict + + +class EcommerceProductsAllResponse(BaseModel): + next: Callable[[], Optional[EcommerceProductsAllResponse]] + + result: EcommerceProductsAllResponseResult diff --git a/src/apideck_unify/models/filestorage_drivegroupsallop.py b/src/apideck_unify/models/filestorage_drivegroupsallop.py index 5239fb60..c91ab53c 100644 --- a/src/apideck_unify/models/filestorage_drivegroupsallop.py +++ b/src/apideck_unify/models/filestorage_drivegroupsallop.py @@ -20,7 +20,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -148,13 +148,23 @@ def serialize_model(self, handler): return m -FileStorageDriveGroupsAllResponseTypedDict = TypeAliasType( - "FileStorageDriveGroupsAllResponseTypedDict", +FileStorageDriveGroupsAllResponseResultTypedDict = TypeAliasType( + "FileStorageDriveGroupsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetDriveGroupsResponseTypedDict], ) -FileStorageDriveGroupsAllResponse = TypeAliasType( - "FileStorageDriveGroupsAllResponse", +FileStorageDriveGroupsAllResponseResult = TypeAliasType( + "FileStorageDriveGroupsAllResponseResult", Union[UnexpectedErrorResponse, GetDriveGroupsResponse], ) + + +class FileStorageDriveGroupsAllResponseTypedDict(TypedDict): + result: FileStorageDriveGroupsAllResponseResultTypedDict + + +class FileStorageDriveGroupsAllResponse(BaseModel): + next: Callable[[], Optional[FileStorageDriveGroupsAllResponse]] + + result: FileStorageDriveGroupsAllResponseResult diff --git a/src/apideck_unify/models/filestorage_drivesallop.py b/src/apideck_unify/models/filestorage_drivesallop.py index 13f3eeae..cdd6380c 100644 --- a/src/apideck_unify/models/filestorage_drivesallop.py +++ b/src/apideck_unify/models/filestorage_drivesallop.py @@ -17,7 +17,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -129,12 +129,23 @@ def serialize_model(self, handler): return m -FileStorageDrivesAllResponseTypedDict = TypeAliasType( - "FileStorageDrivesAllResponseTypedDict", +FileStorageDrivesAllResponseResultTypedDict = TypeAliasType( + "FileStorageDrivesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetDrivesResponseTypedDict], ) -FileStorageDrivesAllResponse = TypeAliasType( - "FileStorageDrivesAllResponse", Union[UnexpectedErrorResponse, GetDrivesResponse] +FileStorageDrivesAllResponseResult = TypeAliasType( + "FileStorageDrivesAllResponseResult", + Union[UnexpectedErrorResponse, GetDrivesResponse], ) + + +class FileStorageDrivesAllResponseTypedDict(TypedDict): + result: FileStorageDrivesAllResponseResultTypedDict + + +class FileStorageDrivesAllResponse(BaseModel): + next: Callable[[], Optional[FileStorageDrivesAllResponse]] + + result: FileStorageDrivesAllResponseResult diff --git a/src/apideck_unify/models/filestorage_filesallop.py b/src/apideck_unify/models/filestorage_filesallop.py index 6274c336..1a5fdf71 100644 --- a/src/apideck_unify/models/filestorage_filesallop.py +++ b/src/apideck_unify/models/filestorage_filesallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,23 @@ def serialize_model(self, handler): return m -FileStorageFilesAllResponseTypedDict = TypeAliasType( - "FileStorageFilesAllResponseTypedDict", +FileStorageFilesAllResponseResultTypedDict = TypeAliasType( + "FileStorageFilesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetFilesResponseTypedDict], ) -FileStorageFilesAllResponse = TypeAliasType( - "FileStorageFilesAllResponse", Union[UnexpectedErrorResponse, GetFilesResponse] +FileStorageFilesAllResponseResult = TypeAliasType( + "FileStorageFilesAllResponseResult", + Union[UnexpectedErrorResponse, GetFilesResponse], ) + + +class FileStorageFilesAllResponseTypedDict(TypedDict): + result: FileStorageFilesAllResponseResultTypedDict + + +class FileStorageFilesAllResponse(BaseModel): + next: Callable[[], Optional[FileStorageFilesAllResponse]] + + result: FileStorageFilesAllResponseResult diff --git a/src/apideck_unify/models/filestorage_filessearchop.py b/src/apideck_unify/models/filestorage_filessearchop.py index b96e92c6..2745a2a4 100644 --- a/src/apideck_unify/models/filestorage_filessearchop.py +++ b/src/apideck_unify/models/filestorage_filessearchop.py @@ -54,7 +54,7 @@ class FileStorageFilesSearchRequestTypedDict(TypedDict): files_search: FilesSearchTypedDict service_id: NotRequired[str] r"""Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.""" - pass_through: NotRequired[Dict[str, Any]] + pass_through_param: NotRequired[Dict[str, Any]] r"""Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads""" fields: NotRequired[Nullable[str]] r"""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.""" @@ -79,8 +79,9 @@ class FileStorageFilesSearchRequest(BaseModel): ] = None r"""Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API.""" - pass_through: Annotated[ + pass_through_param: Annotated[ Optional[Dict[str, Any]], + pydantic.Field(alias="pass_through"), FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), ] = None r"""Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads""" @@ -114,7 +115,7 @@ class FileStorageFilesSearchRequest(BaseModel): def serialize_model(self, handler): optional_fields = [ "serviceId", - "pass_through", + "pass_through_param", "fields", "cursor", "limit", diff --git a/src/apideck_unify/models/filestorage_sharedlinksallop.py b/src/apideck_unify/models/filestorage_sharedlinksallop.py index 561d67a7..8aa1c91a 100644 --- a/src/apideck_unify/models/filestorage_sharedlinksallop.py +++ b/src/apideck_unify/models/filestorage_sharedlinksallop.py @@ -19,7 +19,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -137,13 +137,23 @@ def serialize_model(self, handler): return m -FileStorageSharedLinksAllResponseTypedDict = TypeAliasType( - "FileStorageSharedLinksAllResponseTypedDict", +FileStorageSharedLinksAllResponseResultTypedDict = TypeAliasType( + "FileStorageSharedLinksAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetSharedLinksResponseTypedDict], ) -FileStorageSharedLinksAllResponse = TypeAliasType( - "FileStorageSharedLinksAllResponse", +FileStorageSharedLinksAllResponseResult = TypeAliasType( + "FileStorageSharedLinksAllResponseResult", Union[UnexpectedErrorResponse, GetSharedLinksResponse], ) + + +class FileStorageSharedLinksAllResponseTypedDict(TypedDict): + result: FileStorageSharedLinksAllResponseResultTypedDict + + +class FileStorageSharedLinksAllResponse(BaseModel): + next: Callable[[], Optional[FileStorageSharedLinksAllResponse]] + + result: FileStorageSharedLinksAllResponseResult diff --git a/src/apideck_unify/models/getagedcreditorsresponse.py b/src/apideck_unify/models/getagedcreditorsresponse.py new file mode 100644 index 00000000..094e6ca9 --- /dev/null +++ b/src/apideck_unify/models/getagedcreditorsresponse.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .agedcreditors import AgedCreditors, AgedCreditorsTypedDict +from apideck_unify.types import BaseModel +from typing_extensions import TypedDict + + +class GetAgedCreditorsResponseTypedDict(TypedDict): + r"""Aged Creditors""" + + status_code: int + r"""HTTP Response Status Code""" + status: str + r"""HTTP Response Status""" + service: str + r"""Apideck ID of service provider""" + resource: str + r"""Unified API resource name""" + operation: str + r"""Operation performed""" + data: AgedCreditorsTypedDict + + +class GetAgedCreditorsResponse(BaseModel): + r"""Aged Creditors""" + + status_code: int + r"""HTTP Response Status Code""" + + status: str + r"""HTTP Response Status""" + + service: str + r"""Apideck ID of service provider""" + + resource: str + r"""Unified API resource name""" + + operation: str + r"""Operation performed""" + + data: AgedCreditors diff --git a/src/apideck_unify/models/getageddebtorsresponse.py b/src/apideck_unify/models/getageddebtorsresponse.py new file mode 100644 index 00000000..ab0aefef --- /dev/null +++ b/src/apideck_unify/models/getageddebtorsresponse.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .ageddebtors import AgedDebtors, AgedDebtorsTypedDict +from apideck_unify.types import BaseModel +from typing_extensions import TypedDict + + +class GetAgedDebtorsResponseTypedDict(TypedDict): + r"""Aged Debtors""" + + status_code: int + r"""HTTP Response Status Code""" + status: str + r"""HTTP Response Status""" + service: str + r"""Apideck ID of service provider""" + resource: str + r"""Unified API resource name""" + operation: str + r"""Operation performed""" + data: AgedDebtorsTypedDict + + +class GetAgedDebtorsResponse(BaseModel): + r"""Aged Debtors""" + + status_code: int + r"""HTTP Response Status Code""" + + status: str + r"""HTTP Response Status""" + + service: str + r"""Apideck ID of service provider""" + + resource: str + r"""Unified API resource name""" + + operation: str + r"""Operation performed""" + + data: AgedDebtors diff --git a/src/apideck_unify/models/hris_companiesallop.py b/src/apideck_unify/models/hris_companiesallop.py index b66981c7..31eff8e0 100644 --- a/src/apideck_unify/models/hris_companiesallop.py +++ b/src/apideck_unify/models/hris_companiesallop.py @@ -19,7 +19,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -137,12 +137,23 @@ def serialize_model(self, handler): return m -HrisCompaniesAllResponseTypedDict = TypeAliasType( - "HrisCompaniesAllResponseTypedDict", +HrisCompaniesAllResponseResultTypedDict = TypeAliasType( + "HrisCompaniesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetHrisCompaniesResponseTypedDict], ) -HrisCompaniesAllResponse = TypeAliasType( - "HrisCompaniesAllResponse", Union[UnexpectedErrorResponse, GetHrisCompaniesResponse] +HrisCompaniesAllResponseResult = TypeAliasType( + "HrisCompaniesAllResponseResult", + Union[UnexpectedErrorResponse, GetHrisCompaniesResponse], ) + + +class HrisCompaniesAllResponseTypedDict(TypedDict): + result: HrisCompaniesAllResponseResultTypedDict + + +class HrisCompaniesAllResponse(BaseModel): + next: Callable[[], Optional[HrisCompaniesAllResponse]] + + result: HrisCompaniesAllResponseResult diff --git a/src/apideck_unify/models/hris_departmentsallop.py b/src/apideck_unify/models/hris_departmentsallop.py index 4cf6f024..23a176db 100644 --- a/src/apideck_unify/models/hris_departmentsallop.py +++ b/src/apideck_unify/models/hris_departmentsallop.py @@ -19,7 +19,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -137,12 +137,23 @@ def serialize_model(self, handler): return m -HrisDepartmentsAllResponseTypedDict = TypeAliasType( - "HrisDepartmentsAllResponseTypedDict", +HrisDepartmentsAllResponseResultTypedDict = TypeAliasType( + "HrisDepartmentsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetDepartmentsResponseTypedDict], ) -HrisDepartmentsAllResponse = TypeAliasType( - "HrisDepartmentsAllResponse", Union[UnexpectedErrorResponse, GetDepartmentsResponse] +HrisDepartmentsAllResponseResult = TypeAliasType( + "HrisDepartmentsAllResponseResult", + Union[UnexpectedErrorResponse, GetDepartmentsResponse], ) + + +class HrisDepartmentsAllResponseTypedDict(TypedDict): + result: HrisDepartmentsAllResponseResultTypedDict + + +class HrisDepartmentsAllResponse(BaseModel): + next: Callable[[], Optional[HrisDepartmentsAllResponse]] + + result: HrisDepartmentsAllResponseResult diff --git a/src/apideck_unify/models/hris_employeesallop.py b/src/apideck_unify/models/hris_employeesallop.py index 597f2358..c691239b 100644 --- a/src/apideck_unify/models/hris_employeesallop.py +++ b/src/apideck_unify/models/hris_employeesallop.py @@ -18,7 +18,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -155,12 +155,23 @@ def serialize_model(self, handler): return m -HrisEmployeesAllResponseTypedDict = TypeAliasType( - "HrisEmployeesAllResponseTypedDict", +HrisEmployeesAllResponseResultTypedDict = TypeAliasType( + "HrisEmployeesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetEmployeesResponseTypedDict], ) -HrisEmployeesAllResponse = TypeAliasType( - "HrisEmployeesAllResponse", Union[UnexpectedErrorResponse, GetEmployeesResponse] +HrisEmployeesAllResponseResult = TypeAliasType( + "HrisEmployeesAllResponseResult", + Union[UnexpectedErrorResponse, GetEmployeesResponse], ) + + +class HrisEmployeesAllResponseTypedDict(TypedDict): + result: HrisEmployeesAllResponseResultTypedDict + + +class HrisEmployeesAllResponse(BaseModel): + next: Callable[[], Optional[HrisEmployeesAllResponse]] + + result: HrisEmployeesAllResponseResult diff --git a/src/apideck_unify/models/hris_employeesupdateop.py b/src/apideck_unify/models/hris_employeesupdateop.py index 119988d3..48119d91 100644 --- a/src/apideck_unify/models/hris_employeesupdateop.py +++ b/src/apideck_unify/models/hris_employeesupdateop.py @@ -47,7 +47,7 @@ class HrisEmployeesUpdateGlobals(BaseModel): class HrisEmployeesUpdateRequestTypedDict(TypedDict): - id: str + id_param: str r"""ID of the record you are acting upon.""" employee: EmployeeInputTypedDict service_id: NotRequired[str] @@ -57,8 +57,10 @@ class HrisEmployeesUpdateRequestTypedDict(TypedDict): class HrisEmployeesUpdateRequest(BaseModel): - id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + id_param: Annotated[ + str, + pydantic.Field(alias="id"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), ] r"""ID of the record you are acting upon.""" diff --git a/src/apideck_unify/models/hris_timeoffrequestsallop.py b/src/apideck_unify/models/hris_timeoffrequestsallop.py index 89056c87..7a480ff7 100644 --- a/src/apideck_unify/models/hris_timeoffrequestsallop.py +++ b/src/apideck_unify/models/hris_timeoffrequestsallop.py @@ -20,7 +20,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -148,13 +148,23 @@ def serialize_model(self, handler): return m -HrisTimeOffRequestsAllResponseTypedDict = TypeAliasType( - "HrisTimeOffRequestsAllResponseTypedDict", +HrisTimeOffRequestsAllResponseResultTypedDict = TypeAliasType( + "HrisTimeOffRequestsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetTimeOffRequestsResponseTypedDict], ) -HrisTimeOffRequestsAllResponse = TypeAliasType( - "HrisTimeOffRequestsAllResponse", +HrisTimeOffRequestsAllResponseResult = TypeAliasType( + "HrisTimeOffRequestsAllResponseResult", Union[UnexpectedErrorResponse, GetTimeOffRequestsResponse], ) + + +class HrisTimeOffRequestsAllResponseTypedDict(TypedDict): + result: HrisTimeOffRequestsAllResponseResultTypedDict + + +class HrisTimeOffRequestsAllResponse(BaseModel): + next: Callable[[], Optional[HrisTimeOffRequestsAllResponse]] + + result: HrisTimeOffRequestsAllResponseResult diff --git a/src/apideck_unify/models/hris_timeoffrequestsupdateop.py b/src/apideck_unify/models/hris_timeoffrequestsupdateop.py index 9b812919..a236b3d1 100644 --- a/src/apideck_unify/models/hris_timeoffrequestsupdateop.py +++ b/src/apideck_unify/models/hris_timeoffrequestsupdateop.py @@ -49,7 +49,7 @@ class HrisTimeOffRequestsUpdateGlobals(BaseModel): class HrisTimeOffRequestsUpdateRequestTypedDict(TypedDict): id: str r"""ID of the record you are acting upon.""" - employee_id: str + employee_id_param: str r"""ID of the employee you are acting upon.""" time_off_request: TimeOffRequestInputTypedDict service_id: NotRequired[str] @@ -64,8 +64,10 @@ class HrisTimeOffRequestsUpdateRequest(BaseModel): ] r"""ID of the record you are acting upon.""" - employee_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + employee_id_param: Annotated[ + str, + pydantic.Field(alias="employee_id"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), ] r"""ID of the employee you are acting upon.""" diff --git a/src/apideck_unify/models/issuetracking_collectionsallop.py b/src/apideck_unify/models/issuetracking_collectionsallop.py index 5c5f1cda..41e3781d 100644 --- a/src/apideck_unify/models/issuetracking_collectionsallop.py +++ b/src/apideck_unify/models/issuetracking_collectionsallop.py @@ -20,7 +20,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -147,13 +147,23 @@ def serialize_model(self, handler): return m -IssueTrackingCollectionsAllResponseTypedDict = TypeAliasType( - "IssueTrackingCollectionsAllResponseTypedDict", +IssueTrackingCollectionsAllResponseResultTypedDict = TypeAliasType( + "IssueTrackingCollectionsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetCollectionsResponseTypedDict], ) -IssueTrackingCollectionsAllResponse = TypeAliasType( - "IssueTrackingCollectionsAllResponse", +IssueTrackingCollectionsAllResponseResult = TypeAliasType( + "IssueTrackingCollectionsAllResponseResult", Union[UnexpectedErrorResponse, GetCollectionsResponse], ) + + +class IssueTrackingCollectionsAllResponseTypedDict(TypedDict): + result: IssueTrackingCollectionsAllResponseResultTypedDict + + +class IssueTrackingCollectionsAllResponse(BaseModel): + next: Callable[[], Optional[IssueTrackingCollectionsAllResponse]] + + result: IssueTrackingCollectionsAllResponseResult diff --git a/src/apideck_unify/models/issuetracking_collectiontagsallop.py b/src/apideck_unify/models/issuetracking_collectiontagsallop.py index a7d96b37..6b816113 100644 --- a/src/apideck_unify/models/issuetracking_collectiontagsallop.py +++ b/src/apideck_unify/models/issuetracking_collectiontagsallop.py @@ -24,7 +24,7 @@ ) import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -149,13 +149,23 @@ def serialize_model(self, handler): return m -IssueTrackingCollectionTagsAllResponseTypedDict = TypeAliasType( - "IssueTrackingCollectionTagsAllResponseTypedDict", +IssueTrackingCollectionTagsAllResponseResultTypedDict = TypeAliasType( + "IssueTrackingCollectionTagsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetCollectionTagsResponseTypedDict], ) -IssueTrackingCollectionTagsAllResponse = TypeAliasType( - "IssueTrackingCollectionTagsAllResponse", +IssueTrackingCollectionTagsAllResponseResult = TypeAliasType( + "IssueTrackingCollectionTagsAllResponseResult", Union[UnexpectedErrorResponse, GetCollectionTagsResponse], ) + + +class IssueTrackingCollectionTagsAllResponseTypedDict(TypedDict): + result: IssueTrackingCollectionTagsAllResponseResultTypedDict + + +class IssueTrackingCollectionTagsAllResponse(BaseModel): + next: Callable[[], Optional[IssueTrackingCollectionTagsAllResponse]] + + result: IssueTrackingCollectionTagsAllResponseResult diff --git a/src/apideck_unify/models/issuetracking_collectionticketcommentsallop.py b/src/apideck_unify/models/issuetracking_collectionticketcommentsallop.py index dc97ce49..ab3c3601 100644 --- a/src/apideck_unify/models/issuetracking_collectionticketcommentsallop.py +++ b/src/apideck_unify/models/issuetracking_collectionticketcommentsallop.py @@ -22,7 +22,7 @@ ) import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -163,13 +163,23 @@ def serialize_model(self, handler): return m -IssueTrackingCollectionTicketCommentsAllResponseTypedDict = TypeAliasType( - "IssueTrackingCollectionTicketCommentsAllResponseTypedDict", +IssueTrackingCollectionTicketCommentsAllResponseResultTypedDict = TypeAliasType( + "IssueTrackingCollectionTicketCommentsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetCommentsResponseTypedDict], ) -IssueTrackingCollectionTicketCommentsAllResponse = TypeAliasType( - "IssueTrackingCollectionTicketCommentsAllResponse", +IssueTrackingCollectionTicketCommentsAllResponseResult = TypeAliasType( + "IssueTrackingCollectionTicketCommentsAllResponseResult", Union[UnexpectedErrorResponse, GetCommentsResponse], ) + + +class IssueTrackingCollectionTicketCommentsAllResponseTypedDict(TypedDict): + result: IssueTrackingCollectionTicketCommentsAllResponseResultTypedDict + + +class IssueTrackingCollectionTicketCommentsAllResponse(BaseModel): + next: Callable[[], Optional[IssueTrackingCollectionTicketCommentsAllResponse]] + + result: IssueTrackingCollectionTicketCommentsAllResponseResult diff --git a/src/apideck_unify/models/issuetracking_collectionticketcommentsoneop.py b/src/apideck_unify/models/issuetracking_collectionticketcommentsoneop.py index c559a6c5..5402cd65 100644 --- a/src/apideck_unify/models/issuetracking_collectionticketcommentsoneop.py +++ b/src/apideck_unify/models/issuetracking_collectionticketcommentsoneop.py @@ -21,7 +21,7 @@ ) import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -145,13 +145,23 @@ def serialize_model(self, handler): return m -IssueTrackingCollectionTicketCommentsOneResponseTypedDict = TypeAliasType( - "IssueTrackingCollectionTicketCommentsOneResponseTypedDict", +IssueTrackingCollectionTicketCommentsOneResponseResultTypedDict = TypeAliasType( + "IssueTrackingCollectionTicketCommentsOneResponseResultTypedDict", Union[GetCommentResponseTypedDict, UnexpectedErrorResponseTypedDict], ) -IssueTrackingCollectionTicketCommentsOneResponse = TypeAliasType( - "IssueTrackingCollectionTicketCommentsOneResponse", +IssueTrackingCollectionTicketCommentsOneResponseResult = TypeAliasType( + "IssueTrackingCollectionTicketCommentsOneResponseResult", Union[GetCommentResponse, UnexpectedErrorResponse], ) + + +class IssueTrackingCollectionTicketCommentsOneResponseTypedDict(TypedDict): + result: IssueTrackingCollectionTicketCommentsOneResponseResultTypedDict + + +class IssueTrackingCollectionTicketCommentsOneResponse(BaseModel): + next: Callable[[], Optional[IssueTrackingCollectionTicketCommentsOneResponse]] + + result: IssueTrackingCollectionTicketCommentsOneResponseResult diff --git a/src/apideck_unify/models/issuetracking_collectionticketsallop.py b/src/apideck_unify/models/issuetracking_collectionticketsallop.py index e4ede58f..c3d2f0c0 100644 --- a/src/apideck_unify/models/issuetracking_collectionticketsallop.py +++ b/src/apideck_unify/models/issuetracking_collectionticketsallop.py @@ -23,7 +23,7 @@ ) import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -167,13 +167,23 @@ def serialize_model(self, handler): return m -IssueTrackingCollectionTicketsAllResponseTypedDict = TypeAliasType( - "IssueTrackingCollectionTicketsAllResponseTypedDict", +IssueTrackingCollectionTicketsAllResponseResultTypedDict = TypeAliasType( + "IssueTrackingCollectionTicketsAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetTicketsResponseTypedDict], ) -IssueTrackingCollectionTicketsAllResponse = TypeAliasType( - "IssueTrackingCollectionTicketsAllResponse", +IssueTrackingCollectionTicketsAllResponseResult = TypeAliasType( + "IssueTrackingCollectionTicketsAllResponseResult", Union[UnexpectedErrorResponse, GetTicketsResponse], ) + + +class IssueTrackingCollectionTicketsAllResponseTypedDict(TypedDict): + result: IssueTrackingCollectionTicketsAllResponseResultTypedDict + + +class IssueTrackingCollectionTicketsAllResponse(BaseModel): + next: Callable[[], Optional[IssueTrackingCollectionTicketsAllResponse]] + + result: IssueTrackingCollectionTicketsAllResponseResult diff --git a/src/apideck_unify/models/issuetracking_collectionusersallop.py b/src/apideck_unify/models/issuetracking_collectionusersallop.py index b6390049..2a78d212 100644 --- a/src/apideck_unify/models/issuetracking_collectionusersallop.py +++ b/src/apideck_unify/models/issuetracking_collectionusersallop.py @@ -24,7 +24,7 @@ ) import pydantic from pydantic import model_serializer -from typing import Any, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -149,13 +149,23 @@ def serialize_model(self, handler): return m -IssueTrackingCollectionUsersAllResponseTypedDict = TypeAliasType( - "IssueTrackingCollectionUsersAllResponseTypedDict", +IssueTrackingCollectionUsersAllResponseResultTypedDict = TypeAliasType( + "IssueTrackingCollectionUsersAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetCollectionUsersResponseTypedDict], ) -IssueTrackingCollectionUsersAllResponse = TypeAliasType( - "IssueTrackingCollectionUsersAllResponse", +IssueTrackingCollectionUsersAllResponseResult = TypeAliasType( + "IssueTrackingCollectionUsersAllResponseResult", Union[UnexpectedErrorResponse, GetCollectionUsersResponse], ) + + +class IssueTrackingCollectionUsersAllResponseTypedDict(TypedDict): + result: IssueTrackingCollectionUsersAllResponseResultTypedDict + + +class IssueTrackingCollectionUsersAllResponse(BaseModel): + next: Callable[[], Optional[IssueTrackingCollectionUsersAllResponse]] + + result: IssueTrackingCollectionUsersAllResponseResult diff --git a/src/apideck_unify/models/outstandingbalance.py b/src/apideck_unify/models/outstandingbalance.py new file mode 100644 index 00000000..667f0fd8 --- /dev/null +++ b/src/apideck_unify/models/outstandingbalance.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .outstandingbalancebycurrency import ( + OutstandingBalanceByCurrency, + OutstandingBalanceByCurrencyTypedDict, +) +from apideck_unify.types import BaseModel +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class OutstandingBalanceTypedDict(TypedDict): + customer_id: NotRequired[str] + r"""Unique identifier for the customer or supplier.""" + customer_name: NotRequired[str] + r"""Full name of the customer or supplier.""" + outstanding_balances_by_currency: NotRequired[ + List[OutstandingBalanceByCurrencyTypedDict] + ] + + +class OutstandingBalance(BaseModel): + customer_id: Optional[str] = None + r"""Unique identifier for the customer or supplier.""" + + customer_name: Optional[str] = None + r"""Full name of the customer or supplier.""" + + outstanding_balances_by_currency: Optional[List[OutstandingBalanceByCurrency]] = ( + None + ) diff --git a/src/apideck_unify/models/outstandingbalancebycurrency.py b/src/apideck_unify/models/outstandingbalancebycurrency.py new file mode 100644 index 00000000..6ba3e693 --- /dev/null +++ b/src/apideck_unify/models/outstandingbalancebycurrency.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .balancebyperiod import BalanceByPeriod, BalanceByPeriodTypedDict +from .currency import Currency +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class OutstandingBalanceByCurrencyTypedDict(TypedDict): + 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).""" + balances_by_period: NotRequired[List[BalanceByPeriodTypedDict]] + + +class OutstandingBalanceByCurrency(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).""" + + balances_by_period: Optional[List[BalanceByPeriod]] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["currency", "balances_by_period"] + nullable_fields = ["currency"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in 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/sms_messagesallop.py b/src/apideck_unify/models/sms_messagesallop.py index 3f9387f1..d60166f0 100644 --- a/src/apideck_unify/models/sms_messagesallop.py +++ b/src/apideck_unify/models/sms_messagesallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -119,12 +119,22 @@ def serialize_model(self, handler): return m -SmsMessagesAllResponseTypedDict = TypeAliasType( - "SmsMessagesAllResponseTypedDict", +SmsMessagesAllResponseResultTypedDict = TypeAliasType( + "SmsMessagesAllResponseResultTypedDict", Union[UnexpectedErrorResponseTypedDict, GetMessagesResponseTypedDict], ) -SmsMessagesAllResponse = TypeAliasType( - "SmsMessagesAllResponse", Union[UnexpectedErrorResponse, GetMessagesResponse] +SmsMessagesAllResponseResult = TypeAliasType( + "SmsMessagesAllResponseResult", Union[UnexpectedErrorResponse, GetMessagesResponse] ) + + +class SmsMessagesAllResponseTypedDict(TypedDict): + result: SmsMessagesAllResponseResultTypedDict + + +class SmsMessagesAllResponse(BaseModel): + next: Callable[[], Optional[SmsMessagesAllResponse]] + + result: SmsMessagesAllResponseResult diff --git a/src/apideck_unify/models/vault_consumersallop.py b/src/apideck_unify/models/vault_consumersallop.py index b66bfebd..f0e65da3 100644 --- a/src/apideck_unify/models/vault_consumersallop.py +++ b/src/apideck_unify/models/vault_consumersallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -85,12 +85,23 @@ def serialize_model(self, handler): return m -VaultConsumersAllResponseTypedDict = TypeAliasType( - "VaultConsumersAllResponseTypedDict", +VaultConsumersAllResponseResultTypedDict = TypeAliasType( + "VaultConsumersAllResponseResultTypedDict", Union[GetConsumersResponseTypedDict, UnexpectedErrorResponseTypedDict], ) -VaultConsumersAllResponse = TypeAliasType( - "VaultConsumersAllResponse", Union[GetConsumersResponse, UnexpectedErrorResponse] +VaultConsumersAllResponseResult = TypeAliasType( + "VaultConsumersAllResponseResult", + Union[GetConsumersResponse, UnexpectedErrorResponse], ) + + +class VaultConsumersAllResponseTypedDict(TypedDict): + result: VaultConsumersAllResponseResultTypedDict + + +class VaultConsumersAllResponse(BaseModel): + next: Callable[[], Optional[VaultConsumersAllResponse]] + + result: VaultConsumersAllResponseResult diff --git a/src/apideck_unify/models/vault_logsallop.py b/src/apideck_unify/models/vault_logsallop.py index e0b4f8f0..75554657 100644 --- a/src/apideck_unify/models/vault_logsallop.py +++ b/src/apideck_unify/models/vault_logsallop.py @@ -17,7 +17,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -104,12 +104,22 @@ def serialize_model(self, handler): return m -VaultLogsAllResponseTypedDict = TypeAliasType( - "VaultLogsAllResponseTypedDict", +VaultLogsAllResponseResultTypedDict = TypeAliasType( + "VaultLogsAllResponseResultTypedDict", Union[GetLogsResponseTypedDict, UnexpectedErrorResponseTypedDict], ) -VaultLogsAllResponse = TypeAliasType( - "VaultLogsAllResponse", Union[GetLogsResponse, UnexpectedErrorResponse] +VaultLogsAllResponseResult = TypeAliasType( + "VaultLogsAllResponseResult", Union[GetLogsResponse, UnexpectedErrorResponse] ) + + +class VaultLogsAllResponseTypedDict(TypedDict): + result: VaultLogsAllResponseResultTypedDict + + +class VaultLogsAllResponse(BaseModel): + next: Callable[[], Optional[VaultLogsAllResponse]] + + result: VaultLogsAllResponseResult diff --git a/src/apideck_unify/models/webhook_eventlogsallop.py b/src/apideck_unify/models/webhook_eventlogsallop.py index c33c5e17..139c12a9 100644 --- a/src/apideck_unify/models/webhook_eventlogsallop.py +++ b/src/apideck_unify/models/webhook_eventlogsallop.py @@ -23,7 +23,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -101,13 +101,23 @@ def serialize_model(self, handler): return m -WebhookEventLogsAllResponseTypedDict = TypeAliasType( - "WebhookEventLogsAllResponseTypedDict", +WebhookEventLogsAllResponseResultTypedDict = TypeAliasType( + "WebhookEventLogsAllResponseResultTypedDict", Union[GetWebhookEventLogsResponseTypedDict, UnexpectedErrorResponseTypedDict], ) -WebhookEventLogsAllResponse = TypeAliasType( - "WebhookEventLogsAllResponse", +WebhookEventLogsAllResponseResult = TypeAliasType( + "WebhookEventLogsAllResponseResult", Union[GetWebhookEventLogsResponse, UnexpectedErrorResponse], ) + + +class WebhookEventLogsAllResponseTypedDict(TypedDict): + result: WebhookEventLogsAllResponseResultTypedDict + + +class WebhookEventLogsAllResponse(BaseModel): + next: Callable[[], Optional[WebhookEventLogsAllResponse]] + + result: WebhookEventLogsAllResponseResult diff --git a/src/apideck_unify/models/webhook_webhooksallop.py b/src/apideck_unify/models/webhook_webhooksallop.py index eb54c617..6d12bb28 100644 --- a/src/apideck_unify/models/webhook_webhooksallop.py +++ b/src/apideck_unify/models/webhook_webhooksallop.py @@ -16,7 +16,7 @@ from apideck_unify.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata import pydantic from pydantic import model_serializer -from typing import Optional, Union +from typing import Callable, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -85,12 +85,23 @@ def serialize_model(self, handler): return m -WebhookWebhooksAllResponseTypedDict = TypeAliasType( - "WebhookWebhooksAllResponseTypedDict", +WebhookWebhooksAllResponseResultTypedDict = TypeAliasType( + "WebhookWebhooksAllResponseResultTypedDict", Union[GetWebhooksResponseTypedDict, UnexpectedErrorResponseTypedDict], ) -WebhookWebhooksAllResponse = TypeAliasType( - "WebhookWebhooksAllResponse", Union[GetWebhooksResponse, UnexpectedErrorResponse] +WebhookWebhooksAllResponseResult = TypeAliasType( + "WebhookWebhooksAllResponseResult", + Union[GetWebhooksResponse, UnexpectedErrorResponse], ) + + +class WebhookWebhooksAllResponseTypedDict(TypedDict): + result: WebhookWebhooksAllResponseResultTypedDict + + +class WebhookWebhooksAllResponse(BaseModel): + next: Callable[[], Optional[WebhookWebhooksAllResponse]] + + result: WebhookWebhooksAllResponseResult diff --git a/src/apideck_unify/notes.py b/src/apideck_unify/notes.py index c0d788f6..e072918a 100644 --- a/src/apideck_unify/notes.py +++ b/src/apideck_unify/notes.py @@ -3,30 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Notes(BaseSDK): def list( self, *, - request: Union[ - models.CrmNotesAllRequest, models.CrmNotesAllRequestTypedDict - ] = models.CrmNotesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmNotesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmNotesAllResponse]: r"""List notes List notes - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmNotesAllRequest) - request = cast(models.CrmNotesAllRequest, request) + request = models.CrmNotesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +101,30 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmNotesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetNotesResponse) + return models.CrmNotesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetNotesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +148,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmNotesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +167,31 @@ def list( async def list_async( self, *, - request: Union[ - models.CrmNotesAllRequest, models.CrmNotesAllRequestTypedDict - ] = models.CrmNotesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmNotesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmNotesAllResponse]: r"""List notes List notes - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +201,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmNotesAllRequest) - request = cast(models.CrmNotesAllRequest, request) + request = models.CrmNotesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +221,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +255,30 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmNotesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetNotesResponse) + return models.CrmNotesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetNotesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +302,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmNotesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +321,43 @@ async def list_async( def create( self, *, - note: Union[models.NoteInput, models.NoteInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + title: OptionalNullable[str] = UNSET, + content: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + opportunity_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmNotesAddResponse: r"""Create note Create note - :param note: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param title: The title of the note + :param content: The content of the note. + :param owner_id: The user that owns the note. + :param contact_id: The contact that is related to the note. + :param company_id: The company that is related to the note. + :param opportunity_id: The opportunity that is related to the note. + :param lead_id: The lead that is related to the note. + :param active: Whether the Note is active or not. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +370,19 @@ def create( request = models.CrmNotesAddRequest( raw=raw, service_id=service_id, - note=utils.get_pydantic_model(note, models.NoteInput), + note=models.NoteInput( + title=title, + content=content, + owner_id=owner_id, + contact_id=contact_id, + company_id=company_id, + opportunity_id=opportunity_id, + lead_id=lead_id, + active=active, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +396,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +473,43 @@ def create( async def create_async( self, *, - note: Union[models.NoteInput, models.NoteInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + title: OptionalNullable[str] = UNSET, + content: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + opportunity_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmNotesAddResponse: r"""Create note Create note - :param note: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param title: The title of the note + :param content: The content of the note. + :param owner_id: The user that owns the note. + :param contact_id: The contact that is related to the note. + :param company_id: The company that is related to the note. + :param opportunity_id: The opportunity that is related to the note. + :param lead_id: The lead that is related to the note. + :param active: Whether the Note is active or not. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +522,19 @@ async def create_async( request = models.CrmNotesAddRequest( raw=raw, service_id=service_id, - note=utils.get_pydantic_model(note, models.NoteInput), + note=models.NoteInput( + title=title, + content=content, + owner_id=owner_id, + contact_id=contact_id, + company_id=company_id, + opportunity_id=opportunity_id, + lead_id=lead_id, + active=active, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +548,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +632,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmNotesOneResponse: r"""Get note @@ -493,6 +645,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +673,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +754,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmNotesOneResponse: r"""Get note @@ -612,6 +767,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +795,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +870,44 @@ def update( self, *, id: str, - note: Union[models.NoteInput, models.NoteInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + title: OptionalNullable[str] = UNSET, + content: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + opportunity_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmNotesUpdateResponse: r"""Update note Update note :param id: ID of the record you are acting upon. - :param note: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param title: The title of the note + :param content: The content of the note. + :param owner_id: The user that owns the note. + :param contact_id: The contact that is related to the note. + :param company_id: The company that is related to the note. + :param opportunity_id: The opportunity that is related to the note. + :param lead_id: The lead that is related to the note. + :param active: Whether the Note is active or not. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +921,19 @@ def update( id=id, service_id=service_id, raw=raw, - note=utils.get_pydantic_model(note, models.NoteInput), + note=models.NoteInput( + title=title, + content=content, + owner_id=owner_id, + contact_id=contact_id, + company_id=company_id, + opportunity_id=opportunity_id, + lead_id=lead_id, + active=active, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +947,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +1025,44 @@ async def update_async( self, *, id: str, - note: Union[models.NoteInput, models.NoteInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + title: OptionalNullable[str] = UNSET, + content: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + opportunity_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + active: OptionalNullable[bool] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmNotesUpdateResponse: r"""Update note Update note :param id: ID of the record you are acting upon. - :param note: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param title: The title of the note + :param content: The content of the note. + :param owner_id: The user that owns the note. + :param contact_id: The contact that is related to the note. + :param company_id: The company that is related to the note. + :param opportunity_id: The opportunity that is related to the note. + :param lead_id: The lead that is related to the note. + :param active: Whether the Note is active or not. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1076,19 @@ async def update_async( id=id, service_id=service_id, raw=raw, - note=utils.get_pydantic_model(note, models.NoteInput), + note=models.NoteInput( + title=title, + content=content, + owner_id=owner_id, + contact_id=contact_id, + company_id=company_id, + opportunity_id=opportunity_id, + lead_id=lead_id, + active=active, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1102,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1185,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmNotesDeleteResponse: r"""Delete note @@ -973,6 +1197,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1224,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1304,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmNotesDeleteResponse: r"""Delete note @@ -1089,6 +1316,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1343,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmNotesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/opportunities.py b/src/apideck_unify/opportunities.py index afb17658..e1a2085e 100644 --- a/src/apideck_unify/opportunities.py +++ b/src/apideck_unify/opportunities.py @@ -3,31 +3,50 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date, datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Opportunities(BaseSDK): def list( self, *, - request: Union[ - models.CrmOpportunitiesAllRequest, - models.CrmOpportunitiesAllRequestTypedDict, - ] = models.CrmOpportunitiesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.OpportunitiesFilter, models.OpportunitiesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.OpportunitiesSort, models.OpportunitiesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmOpportunitiesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmOpportunitiesAllResponse]: r"""List opportunities List opportunities - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +56,18 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmOpportunitiesAllRequest) - request = cast(models.CrmOpportunitiesAllRequest, request) + request = models.CrmOpportunitiesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.OpportunitiesFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.OpportunitiesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +80,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +114,34 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmOpportunitiesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetOpportunitiesResponse) + return models.CrmOpportunitiesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetOpportunitiesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +165,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmOpportunitiesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +184,39 @@ def list( async def list_async( self, *, - request: Union[ - models.CrmOpportunitiesAllRequest, - models.CrmOpportunitiesAllRequestTypedDict, - ] = models.CrmOpportunitiesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.OpportunitiesFilter, models.OpportunitiesFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.OpportunitiesSort, models.OpportunitiesSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmOpportunitiesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmOpportunitiesAllResponse]: r"""List opportunities List opportunities - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +226,18 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmOpportunitiesAllRequest) - request = cast(models.CrmOpportunitiesAllRequest, request) + request = models.CrmOpportunitiesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.OpportunitiesFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.OpportunitiesSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +250,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +284,34 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmOpportunitiesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetOpportunitiesResponse) + return models.CrmOpportunitiesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetOpportunitiesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +335,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmOpportunitiesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +354,85 @@ async def list_async( def create( self, *, - opportunity: Union[models.OpportunityInput, models.OpportunityInputTypedDict], + title: str, + primary_contact_id: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + description: OptionalNullable[str] = UNSET, + type_: OptionalNullable[str] = UNSET, + monetary_amount: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + win_probability: OptionalNullable[float] = UNSET, + close_date: OptionalNullable[date] = UNSET, + loss_reason_id: OptionalNullable[str] = UNSET, + loss_reason: OptionalNullable[str] = UNSET, + won_reason_id: OptionalNullable[str] = UNSET, + won_reason: OptionalNullable[str] = UNSET, + pipeline_id: OptionalNullable[str] = UNSET, + pipeline_stage_id: OptionalNullable[str] = UNSET, + source_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + contact_ids: Optional[List[str]] = None, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + priority: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + status_id: OptionalNullable[str] = UNSET, + tags: OptionalNullable[List[str]] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + stage_last_changed_at: OptionalNullable[datetime] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmOpportunitiesAddResponse: r"""Create opportunity Create opportunity - :param opportunity: + :param title: The title or name of the opportunity. + :param primary_contact_id: The unique identifier of the primary contact associated with the opportunity. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param description: A description of the opportunity. + :param type: The type of the opportunity + :param monetary_amount: The monetary value associated with the opportunity + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param win_probability: The probability of winning the opportunity, expressed as a percentage. + :param close_date: The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. + :param loss_reason_id: The unique identifier of the reason why the opportunity was lost. + :param loss_reason: The reason why the opportunity was lost. + :param won_reason_id: The unique identifier of the reason why the opportunity was won. + :param won_reason: The reason why the opportunity was won. + :param pipeline_id: The unique identifier of the pipeline associated with the opportunity + :param pipeline_stage_id: The unique identifier of the stage in the pipeline associated with the opportunity. + :param source_id: The unique identifier of the source of the opportunity. + :param lead_id: The unique identifier of the lead associated with the opportunity. + :param lead_source: The source of the lead associated with the opportunity. + :param contact_id: The unique identifier of the contact associated with the opportunity. + :param contact_ids: An array of unique identifiers of all contacts associated with the opportunity. + :param company_id: The unique identifier of the company associated with the opportunity. + :param company_name: The name of the company associated with the opportunity. + :param owner_id: The unique identifier of the user who owns the opportunity. + :param priority: The priority level of the opportunity. + :param status: The current status of the opportunity. + :param status_id: The unique identifier of the current status of the opportunity. + :param tags: + :param custom_fields: + :param stage_last_changed_at: The date and time when the stage of the opportunity was last changed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +445,41 @@ def create( request = models.CrmOpportunitiesAddRequest( raw=raw, service_id=service_id, - opportunity=utils.get_pydantic_model(opportunity, models.OpportunityInput), + opportunity=models.OpportunityInput( + title=title, + primary_contact_id=primary_contact_id, + description=description, + type=type_, + monetary_amount=monetary_amount, + currency=currency, + win_probability=win_probability, + close_date=close_date, + loss_reason_id=loss_reason_id, + loss_reason=loss_reason, + won_reason_id=won_reason_id, + won_reason=won_reason, + pipeline_id=pipeline_id, + pipeline_stage_id=pipeline_stage_id, + source_id=source_id, + lead_id=lead_id, + lead_source=lead_source, + contact_id=contact_id, + contact_ids=contact_ids, + company_id=company_id, + company_name=company_name, + owner_id=owner_id, + priority=priority, + status=status, + status_id=status_id, + tags=tags, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + stage_last_changed_at=stage_last_changed_at, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +493,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +570,85 @@ def create( async def create_async( self, *, - opportunity: Union[models.OpportunityInput, models.OpportunityInputTypedDict], + title: str, + primary_contact_id: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + description: OptionalNullable[str] = UNSET, + type_: OptionalNullable[str] = UNSET, + monetary_amount: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + win_probability: OptionalNullable[float] = UNSET, + close_date: OptionalNullable[date] = UNSET, + loss_reason_id: OptionalNullable[str] = UNSET, + loss_reason: OptionalNullable[str] = UNSET, + won_reason_id: OptionalNullable[str] = UNSET, + won_reason: OptionalNullable[str] = UNSET, + pipeline_id: OptionalNullable[str] = UNSET, + pipeline_stage_id: OptionalNullable[str] = UNSET, + source_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + contact_ids: Optional[List[str]] = None, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + priority: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + status_id: OptionalNullable[str] = UNSET, + tags: OptionalNullable[List[str]] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + stage_last_changed_at: OptionalNullable[datetime] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmOpportunitiesAddResponse: r"""Create opportunity Create opportunity - :param opportunity: + :param title: The title or name of the opportunity. + :param primary_contact_id: The unique identifier of the primary contact associated with the opportunity. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param description: A description of the opportunity. + :param type: The type of the opportunity + :param monetary_amount: The monetary value associated with the opportunity + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param win_probability: The probability of winning the opportunity, expressed as a percentage. + :param close_date: The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. + :param loss_reason_id: The unique identifier of the reason why the opportunity was lost. + :param loss_reason: The reason why the opportunity was lost. + :param won_reason_id: The unique identifier of the reason why the opportunity was won. + :param won_reason: The reason why the opportunity was won. + :param pipeline_id: The unique identifier of the pipeline associated with the opportunity + :param pipeline_stage_id: The unique identifier of the stage in the pipeline associated with the opportunity. + :param source_id: The unique identifier of the source of the opportunity. + :param lead_id: The unique identifier of the lead associated with the opportunity. + :param lead_source: The source of the lead associated with the opportunity. + :param contact_id: The unique identifier of the contact associated with the opportunity. + :param contact_ids: An array of unique identifiers of all contacts associated with the opportunity. + :param company_id: The unique identifier of the company associated with the opportunity. + :param company_name: The name of the company associated with the opportunity. + :param owner_id: The unique identifier of the user who owns the opportunity. + :param priority: The priority level of the opportunity. + :param status: The current status of the opportunity. + :param status_id: The unique identifier of the current status of the opportunity. + :param tags: + :param custom_fields: + :param stage_last_changed_at: The date and time when the stage of the opportunity was last changed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +661,41 @@ async def create_async( request = models.CrmOpportunitiesAddRequest( raw=raw, service_id=service_id, - opportunity=utils.get_pydantic_model(opportunity, models.OpportunityInput), + opportunity=models.OpportunityInput( + title=title, + primary_contact_id=primary_contact_id, + description=description, + type=type_, + monetary_amount=monetary_amount, + currency=currency, + win_probability=win_probability, + close_date=close_date, + loss_reason_id=loss_reason_id, + loss_reason=loss_reason, + won_reason_id=won_reason_id, + won_reason=won_reason, + pipeline_id=pipeline_id, + pipeline_stage_id=pipeline_stage_id, + source_id=source_id, + lead_id=lead_id, + lead_source=lead_source, + contact_id=contact_id, + contact_ids=contact_ids, + company_id=company_id, + company_name=company_name, + owner_id=owner_id, + priority=priority, + status=status, + status_id=status_id, + tags=tags, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + stage_last_changed_at=stage_last_changed_at, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +709,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +793,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmOpportunitiesOneResponse: r"""Get opportunity @@ -495,6 +806,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +834,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +915,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmOpportunitiesOneResponse: r"""Get opportunity @@ -614,6 +928,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +956,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +1031,86 @@ def update( self, *, id: str, - opportunity: Union[models.OpportunityInput, models.OpportunityInputTypedDict], + title: str, + primary_contact_id: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + description: OptionalNullable[str] = UNSET, + type_: OptionalNullable[str] = UNSET, + monetary_amount: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + win_probability: OptionalNullable[float] = UNSET, + close_date: OptionalNullable[date] = UNSET, + loss_reason_id: OptionalNullable[str] = UNSET, + loss_reason: OptionalNullable[str] = UNSET, + won_reason_id: OptionalNullable[str] = UNSET, + won_reason: OptionalNullable[str] = UNSET, + pipeline_id: OptionalNullable[str] = UNSET, + pipeline_stage_id: OptionalNullable[str] = UNSET, + source_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + contact_ids: Optional[List[str]] = None, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + priority: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + status_id: OptionalNullable[str] = UNSET, + tags: OptionalNullable[List[str]] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + stage_last_changed_at: OptionalNullable[datetime] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmOpportunitiesUpdateResponse: r"""Update opportunity Update opportunity :param id: ID of the record you are acting upon. - :param opportunity: + :param title: The title or name of the opportunity. + :param primary_contact_id: The unique identifier of the primary contact associated with the opportunity. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param description: A description of the opportunity. + :param type: The type of the opportunity + :param monetary_amount: The monetary value associated with the opportunity + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param win_probability: The probability of winning the opportunity, expressed as a percentage. + :param close_date: The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. + :param loss_reason_id: The unique identifier of the reason why the opportunity was lost. + :param loss_reason: The reason why the opportunity was lost. + :param won_reason_id: The unique identifier of the reason why the opportunity was won. + :param won_reason: The reason why the opportunity was won. + :param pipeline_id: The unique identifier of the pipeline associated with the opportunity + :param pipeline_stage_id: The unique identifier of the stage in the pipeline associated with the opportunity. + :param source_id: The unique identifier of the source of the opportunity. + :param lead_id: The unique identifier of the lead associated with the opportunity. + :param lead_source: The source of the lead associated with the opportunity. + :param contact_id: The unique identifier of the contact associated with the opportunity. + :param contact_ids: An array of unique identifiers of all contacts associated with the opportunity. + :param company_id: The unique identifier of the company associated with the opportunity. + :param company_name: The name of the company associated with the opportunity. + :param owner_id: The unique identifier of the user who owns the opportunity. + :param priority: The priority level of the opportunity. + :param status: The current status of the opportunity. + :param status_id: The unique identifier of the current status of the opportunity. + :param tags: + :param custom_fields: + :param stage_last_changed_at: The date and time when the stage of the opportunity was last changed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +1124,41 @@ def update( id=id, service_id=service_id, raw=raw, - opportunity=utils.get_pydantic_model(opportunity, models.OpportunityInput), + opportunity=models.OpportunityInput( + title=title, + primary_contact_id=primary_contact_id, + description=description, + type=type_, + monetary_amount=monetary_amount, + currency=currency, + win_probability=win_probability, + close_date=close_date, + loss_reason_id=loss_reason_id, + loss_reason=loss_reason, + won_reason_id=won_reason_id, + won_reason=won_reason, + pipeline_id=pipeline_id, + pipeline_stage_id=pipeline_stage_id, + source_id=source_id, + lead_id=lead_id, + lead_source=lead_source, + contact_id=contact_id, + contact_ids=contact_ids, + company_id=company_id, + company_name=company_name, + owner_id=owner_id, + priority=priority, + status=status, + status_id=status_id, + tags=tags, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + stage_last_changed_at=stage_last_changed_at, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +1172,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +1250,86 @@ async def update_async( self, *, id: str, - opportunity: Union[models.OpportunityInput, models.OpportunityInputTypedDict], + title: str, + primary_contact_id: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + description: OptionalNullable[str] = UNSET, + type_: OptionalNullable[str] = UNSET, + monetary_amount: OptionalNullable[float] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + win_probability: OptionalNullable[float] = UNSET, + close_date: OptionalNullable[date] = UNSET, + loss_reason_id: OptionalNullable[str] = UNSET, + loss_reason: OptionalNullable[str] = UNSET, + won_reason_id: OptionalNullable[str] = UNSET, + won_reason: OptionalNullable[str] = UNSET, + pipeline_id: OptionalNullable[str] = UNSET, + pipeline_stage_id: OptionalNullable[str] = UNSET, + source_id: OptionalNullable[str] = UNSET, + lead_id: OptionalNullable[str] = UNSET, + lead_source: OptionalNullable[str] = UNSET, + contact_id: OptionalNullable[str] = UNSET, + contact_ids: Optional[List[str]] = None, + company_id: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + owner_id: OptionalNullable[str] = UNSET, + priority: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + status_id: OptionalNullable[str] = UNSET, + tags: OptionalNullable[List[str]] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + stage_last_changed_at: OptionalNullable[datetime] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmOpportunitiesUpdateResponse: r"""Update opportunity Update opportunity :param id: ID of the record you are acting upon. - :param opportunity: + :param title: The title or name of the opportunity. + :param primary_contact_id: The unique identifier of the primary contact associated with the opportunity. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param description: A description of the opportunity. + :param type: The type of the opportunity + :param monetary_amount: The monetary value associated with the opportunity + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param win_probability: The probability of winning the opportunity, expressed as a percentage. + :param close_date: The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. + :param loss_reason_id: The unique identifier of the reason why the opportunity was lost. + :param loss_reason: The reason why the opportunity was lost. + :param won_reason_id: The unique identifier of the reason why the opportunity was won. + :param won_reason: The reason why the opportunity was won. + :param pipeline_id: The unique identifier of the pipeline associated with the opportunity + :param pipeline_stage_id: The unique identifier of the stage in the pipeline associated with the opportunity. + :param source_id: The unique identifier of the source of the opportunity. + :param lead_id: The unique identifier of the lead associated with the opportunity. + :param lead_source: The source of the lead associated with the opportunity. + :param contact_id: The unique identifier of the contact associated with the opportunity. + :param contact_ids: An array of unique identifiers of all contacts associated with the opportunity. + :param company_id: The unique identifier of the company associated with the opportunity. + :param company_name: The name of the company associated with the opportunity. + :param owner_id: The unique identifier of the user who owns the opportunity. + :param priority: The priority level of the opportunity. + :param status: The current status of the opportunity. + :param status_id: The unique identifier of the current status of the opportunity. + :param tags: + :param custom_fields: + :param stage_last_changed_at: The date and time when the stage of the opportunity was last changed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1343,41 @@ async def update_async( id=id, service_id=service_id, raw=raw, - opportunity=utils.get_pydantic_model(opportunity, models.OpportunityInput), + opportunity=models.OpportunityInput( + title=title, + primary_contact_id=primary_contact_id, + description=description, + type=type_, + monetary_amount=monetary_amount, + currency=currency, + win_probability=win_probability, + close_date=close_date, + loss_reason_id=loss_reason_id, + loss_reason=loss_reason, + won_reason_id=won_reason_id, + won_reason=won_reason, + pipeline_id=pipeline_id, + pipeline_stage_id=pipeline_stage_id, + source_id=source_id, + lead_id=lead_id, + lead_source=lead_source, + contact_id=contact_id, + contact_ids=contact_ids, + company_id=company_id, + company_name=company_name, + owner_id=owner_id, + priority=priority, + status=status, + status_id=status_id, + tags=tags, + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + stage_last_changed_at=stage_last_changed_at, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1391,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1474,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmOpportunitiesDeleteResponse: r"""Delete opportunity @@ -975,6 +1486,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1513,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1593,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmOpportunitiesDeleteResponse: r"""Delete opportunity @@ -1091,6 +1605,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1632,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmOpportunitiesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/orders.py b/src/apideck_unify/orders.py index aefdb3c3..a64f63c4 100644 --- a/src/apideck_unify/orders.py +++ b/src/apideck_unify/orders.py @@ -3,30 +3,47 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional, Union class Orders(BaseSDK): def list( self, *, - request: Union[ - models.EcommerceOrdersAllRequest, models.EcommerceOrdersAllRequestTypedDict - ] = models.EcommerceOrdersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.EcommerceOrdersFilter, models.EcommerceOrdersFilterTypedDict] + ] = None, + sort: Optional[Union[models.OrdersSort, models.OrdersSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.EcommerceOrdersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.EcommerceOrdersAllResponse]: r"""List Orders List Orders - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +53,18 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.EcommerceOrdersAllRequest) - request = cast(models.EcommerceOrdersAllRequest, request) + request = models.EcommerceOrdersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.EcommerceOrdersFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.OrdersSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +77,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceOrdersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,10 +111,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.EcommerceOrdersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetEcommerceOrdersResponse + return models.EcommerceOrdersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetEcommerceOrdersResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -112,7 +162,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.EcommerceOrdersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -126,21 +181,37 @@ def list( async def list_async( self, *, - request: Union[ - models.EcommerceOrdersAllRequest, models.EcommerceOrdersAllRequestTypedDict - ] = models.EcommerceOrdersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.EcommerceOrdersFilter, models.EcommerceOrdersFilterTypedDict] + ] = None, + sort: Optional[Union[models.OrdersSort, models.OrdersSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.EcommerceOrdersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.EcommerceOrdersAllResponse]: r"""List Orders List Orders - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +221,18 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.EcommerceOrdersAllRequest) - request = cast(models.EcommerceOrdersAllRequest, request) + request = models.EcommerceOrdersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.EcommerceOrdersFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.OrdersSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +245,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceOrdersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,10 +279,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.EcommerceOrdersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetEcommerceOrdersResponse + return models.EcommerceOrdersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetEcommerceOrdersResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -226,7 +330,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.EcommerceOrdersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -247,6 +356,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.EcommerceOrdersOneResponse: r"""Get Order @@ -259,6 +369,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -286,6 +397,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceOrdersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -366,6 +478,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.EcommerceOrdersOneResponse: r"""Get Order @@ -378,6 +491,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -405,6 +519,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceOrdersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/payments.py b/src/apideck_unify/payments.py index ab191e74..e4f434d2 100644 --- a/src/apideck_unify/payments.py +++ b/src/apideck_unify/payments.py @@ -3,31 +3,48 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Payments(BaseSDK): def list( self, *, - request: Union[ - models.AccountingPaymentsAllRequest, - models.AccountingPaymentsAllRequestTypedDict, - ] = models.AccountingPaymentsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.PaymentsFilter, models.PaymentsFilterTypedDict] + ] = None, + sort: Optional[Union[models.PaymentsSort, models.PaymentsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingPaymentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingPaymentsAllResponse]: r"""List Payments List Payments - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +54,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingPaymentsAllRequest) - request = cast(models.AccountingPaymentsAllRequest, request) + request = models.AccountingPaymentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.PaymentsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.PaymentsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +76,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +110,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingPaymentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetPaymentsResponse) + return models.AccountingPaymentsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetPaymentsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +159,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingPaymentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +178,37 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingPaymentsAllRequest, - models.AccountingPaymentsAllRequestTypedDict, - ] = models.AccountingPaymentsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.PaymentsFilter, models.PaymentsFilterTypedDict] + ] = None, + sort: Optional[Union[models.PaymentsSort, models.PaymentsSortTypedDict]] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingPaymentsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingPaymentsAllResponse]: r"""List Payments List Payments - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +218,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingPaymentsAllRequest) - request = cast(models.AccountingPaymentsAllRequest, request) + request = models.AccountingPaymentsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.PaymentsFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.PaymentsSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +240,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +274,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingPaymentsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetPaymentsResponse) + return models.AccountingPaymentsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetPaymentsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +323,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingPaymentsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +342,96 @@ async def list_async( def create( self, *, - payment: Union[models.PaymentInput, models.PaymentInputTypedDict], + total_amount: Nullable[float], + transaction_date: Nullable[datetime], raw: Optional[bool] = False, service_id: Optional[str] = None, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + reference: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + accounts_receivable_account_type: OptionalNullable[str] = UNSET, + accounts_receivable_account_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + supplier: OptionalNullable[ + Union[ + models.DeprecatedLinkedSupplierInput, + models.DeprecatedLinkedSupplierInputTypedDict, + ] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + reconciled: OptionalNullable[bool] = UNSET, + status: Optional[models.PaymentStatus] = None, + type_: Optional[models.PaymentType] = None, + allocations: Optional[ + Union[List[models.AllocationInput], List[models.AllocationInputTypedDict]] + ] = None, + note: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + display_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPaymentsAddResponse: r"""Create Payment Create Payment - :param payment: + :param total_amount: The total amount of the transaction + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param reference: Optional transaction reference message ie: Debit remittance detail. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param payment_method_reference: Optional reference message returned by payment method on processing + :param payment_method_id: A unique identifier for an object. + :param accounts_receivable_account_type: Type of accounts receivable account. + :param accounts_receivable_account_id: Unique identifier for the account to allocate payment to. + :param account: + :param customer: The customer this entity is linked to. + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param reconciled: Indicates if the transaction has been reconciled. + :param status: Status of payment + :param type: Type of payment + :param allocations: + :param note: Note associated with the transaction + :param number: Number associated with the transaction + :param tracking_categories: A list of linked tracking categories. + :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. + :param display_id: Id to be displayed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +444,48 @@ def create( request = models.AccountingPaymentsAddRequest( raw=raw, service_id=service_id, - payment=utils.get_pydantic_model(payment, models.PaymentInput), + payment=models.PaymentInput( + currency=currency, + currency_rate=currency_rate, + total_amount=total_amount, + reference=reference, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + accounts_receivable_account_type=accounts_receivable_account_type, + accounts_receivable_account_id=accounts_receivable_account_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + transaction_date=transaction_date, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.DeprecatedLinkedSupplierInput] + ), + company_id=company_id, + reconciled=reconciled, + status=status, + type=type_, + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.AllocationInput]] + ), + note=note, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + display_id=display_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +499,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +576,96 @@ def create( async def create_async( self, *, - payment: Union[models.PaymentInput, models.PaymentInputTypedDict], + total_amount: Nullable[float], + transaction_date: Nullable[datetime], raw: Optional[bool] = False, service_id: Optional[str] = None, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + reference: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + accounts_receivable_account_type: OptionalNullable[str] = UNSET, + accounts_receivable_account_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + supplier: OptionalNullable[ + Union[ + models.DeprecatedLinkedSupplierInput, + models.DeprecatedLinkedSupplierInputTypedDict, + ] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + reconciled: OptionalNullable[bool] = UNSET, + status: Optional[models.PaymentStatus] = None, + type_: Optional[models.PaymentType] = None, + allocations: Optional[ + Union[List[models.AllocationInput], List[models.AllocationInputTypedDict]] + ] = None, + note: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + display_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPaymentsAddResponse: r"""Create Payment Create Payment - :param payment: + :param total_amount: The total amount of the transaction + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param reference: Optional transaction reference message ie: Debit remittance detail. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param payment_method_reference: Optional reference message returned by payment method on processing + :param payment_method_id: A unique identifier for an object. + :param accounts_receivable_account_type: Type of accounts receivable account. + :param accounts_receivable_account_id: Unique identifier for the account to allocate payment to. + :param account: + :param customer: The customer this entity is linked to. + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param reconciled: Indicates if the transaction has been reconciled. + :param status: Status of payment + :param type: Type of payment + :param allocations: + :param note: Note associated with the transaction + :param number: Number associated with the transaction + :param tracking_categories: A list of linked tracking categories. + :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. + :param display_id: Id to be displayed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +678,48 @@ async def create_async( request = models.AccountingPaymentsAddRequest( raw=raw, service_id=service_id, - payment=utils.get_pydantic_model(payment, models.PaymentInput), + payment=models.PaymentInput( + currency=currency, + currency_rate=currency_rate, + total_amount=total_amount, + reference=reference, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + accounts_receivable_account_type=accounts_receivable_account_type, + accounts_receivable_account_id=accounts_receivable_account_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + transaction_date=transaction_date, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.DeprecatedLinkedSupplierInput] + ), + company_id=company_id, + reconciled=reconciled, + status=status, + type=type_, + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.AllocationInput]] + ), + note=note, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + display_id=display_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +733,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +817,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPaymentsOneResponse: r"""Get Payment @@ -495,6 +830,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +858,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +939,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPaymentsOneResponse: r"""Get Payment @@ -614,6 +952,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +980,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +1055,97 @@ def update( self, *, id: str, - payment: Union[models.PaymentInput, models.PaymentInputTypedDict], + total_amount: Nullable[float], + transaction_date: Nullable[datetime], service_id: Optional[str] = None, raw: Optional[bool] = False, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + reference: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + accounts_receivable_account_type: OptionalNullable[str] = UNSET, + accounts_receivable_account_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + supplier: OptionalNullable[ + Union[ + models.DeprecatedLinkedSupplierInput, + models.DeprecatedLinkedSupplierInputTypedDict, + ] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + reconciled: OptionalNullable[bool] = UNSET, + status: Optional[models.PaymentStatus] = None, + type_: Optional[models.PaymentType] = None, + allocations: Optional[ + Union[List[models.AllocationInput], List[models.AllocationInputTypedDict]] + ] = None, + note: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + display_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPaymentsUpdateResponse: r"""Update Payment Update Payment :param id: ID of the record you are acting upon. - :param payment: + :param total_amount: The total amount of the transaction + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param reference: Optional transaction reference message ie: Debit remittance detail. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param payment_method_reference: Optional reference message returned by payment method on processing + :param payment_method_id: A unique identifier for an object. + :param accounts_receivable_account_type: Type of accounts receivable account. + :param accounts_receivable_account_id: Unique identifier for the account to allocate payment to. + :param account: + :param customer: The customer this entity is linked to. + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param reconciled: Indicates if the transaction has been reconciled. + :param status: Status of payment + :param type: Type of payment + :param allocations: + :param note: Note associated with the transaction + :param number: Number associated with the transaction + :param tracking_categories: A list of linked tracking categories. + :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. + :param display_id: Id to be displayed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +1159,48 @@ def update( id=id, service_id=service_id, raw=raw, - payment=utils.get_pydantic_model(payment, models.PaymentInput), + payment=models.PaymentInput( + currency=currency, + currency_rate=currency_rate, + total_amount=total_amount, + reference=reference, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + accounts_receivable_account_type=accounts_receivable_account_type, + accounts_receivable_account_id=accounts_receivable_account_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + transaction_date=transaction_date, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.DeprecatedLinkedSupplierInput] + ), + company_id=company_id, + reconciled=reconciled, + status=status, + type=type_, + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.AllocationInput]] + ), + note=note, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + display_id=display_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +1214,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +1292,97 @@ async def update_async( self, *, id: str, - payment: Union[models.PaymentInput, models.PaymentInputTypedDict], + total_amount: Nullable[float], + transaction_date: Nullable[datetime], service_id: Optional[str] = None, raw: Optional[bool] = False, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + reference: OptionalNullable[str] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + accounts_receivable_account_type: OptionalNullable[str] = UNSET, + accounts_receivable_account_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = UNSET, + supplier: OptionalNullable[ + Union[ + models.DeprecatedLinkedSupplierInput, + models.DeprecatedLinkedSupplierInputTypedDict, + ] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + reconciled: OptionalNullable[bool] = UNSET, + status: Optional[models.PaymentStatus] = None, + type_: Optional[models.PaymentType] = None, + allocations: Optional[ + Union[List[models.AllocationInput], List[models.AllocationInputTypedDict]] + ] = None, + note: OptionalNullable[str] = UNSET, + number: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + custom_fields: Optional[ + Union[List[models.CustomField], List[models.CustomFieldTypedDict]] + ] = None, + row_version: OptionalNullable[str] = UNSET, + display_id: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPaymentsUpdateResponse: r"""Update Payment Update Payment :param id: ID of the record you are acting upon. - :param payment: + :param total_amount: The total amount of the transaction + :param transaction_date: The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param reference: Optional transaction reference message ie: Debit remittance detail. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param payment_method_reference: Optional reference message returned by payment method on processing + :param payment_method_id: A unique identifier for an object. + :param accounts_receivable_account_type: Type of accounts receivable account. + :param accounts_receivable_account_id: Unique identifier for the account to allocate payment to. + :param account: + :param customer: The customer this entity is linked to. + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param reconciled: Indicates if the transaction has been reconciled. + :param status: Status of payment + :param type: Type of payment + :param allocations: + :param note: Note associated with the transaction + :param number: Number associated with the transaction + :param tracking_categories: A list of linked tracking categories. + :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. + :param display_id: Id to be displayed. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1396,48 @@ async def update_async( id=id, service_id=service_id, raw=raw, - payment=utils.get_pydantic_model(payment, models.PaymentInput), + payment=models.PaymentInput( + currency=currency, + currency_rate=currency_rate, + total_amount=total_amount, + reference=reference, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + accounts_receivable_account_type=accounts_receivable_account_type, + accounts_receivable_account_id=accounts_receivable_account_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + transaction_date=transaction_date, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.DeprecatedLinkedSupplierInput] + ), + company_id=company_id, + reconciled=reconciled, + status=status, + type=type_, + allocations=utils.get_pydantic_model( + allocations, Optional[List[models.AllocationInput]] + ), + note=note, + number=number, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + custom_fields=utils.get_pydantic_model( + custom_fields, Optional[List[models.CustomField]] + ), + row_version=row_version, + display_id=display_id, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1451,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1534,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPaymentsDeleteResponse: r"""Delete Payment @@ -975,6 +1546,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1573,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1653,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPaymentsDeleteResponse: r"""Delete Payment @@ -1091,6 +1665,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1692,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPaymentsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/payrolls.py b/src/apideck_unify/payrolls.py index 71c3eb06..5714e7f2 100644 --- a/src/apideck_unify/payrolls.py +++ b/src/apideck_unify/payrolls.py @@ -3,30 +3,40 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from typing import Any, Dict, Mapping, Optional, Union class Payrolls(BaseSDK): def list( self, *, - request: Union[ - models.HrisPayrollsAllRequest, models.HrisPayrollsAllRequestTypedDict - ] = models.HrisPayrollsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.PayrollsFilter, models.PayrollsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisPayrollsAllResponse: r"""List Payroll List Payroll - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +46,13 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisPayrollsAllRequest) - request = cast(models.HrisPayrollsAllRequest, request) + request = models.HrisPayrollsAllRequest( + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model(filter_, Optional[models.PayrollsFilter]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +65,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisPayrollsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -124,21 +139,31 @@ def list( async def list_async( self, *, - request: Union[ - models.HrisPayrollsAllRequest, models.HrisPayrollsAllRequestTypedDict - ] = models.HrisPayrollsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.PayrollsFilter, models.PayrollsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisPayrollsAllResponse: r"""List Payroll List Payroll - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +173,13 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisPayrollsAllRequest) - request = cast(models.HrisPayrollsAllRequest, request) + request = models.HrisPayrollsAllRequest( + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model(filter_, Optional[models.PayrollsFilter]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +192,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisPayrollsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -243,6 +273,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisPayrollsOneResponse: r"""Get Payroll @@ -255,6 +286,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -282,6 +314,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisPayrollsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -362,6 +395,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisPayrollsOneResponse: r"""Get Payroll @@ -374,6 +408,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -401,6 +436,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisPayrollsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/pipelines.py b/src/apideck_unify/pipelines.py index 1eacd1f0..f426f11a 100644 --- a/src/apideck_unify/pipelines.py +++ b/src/apideck_unify/pipelines.py @@ -3,30 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Pipelines(BaseSDK): def list( self, *, - request: Union[ - models.CrmPipelinesAllRequest, models.CrmPipelinesAllRequestTypedDict - ] = models.CrmPipelinesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmPipelinesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmPipelinesAllResponse]: r"""List pipelines List pipelines - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmPipelinesAllRequest) - request = cast(models.CrmPipelinesAllRequest, request) + request = models.CrmPipelinesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +101,30 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmPipelinesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetPipelinesResponse) + return models.CrmPipelinesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetPipelinesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +148,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmPipelinesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +167,31 @@ def list( async def list_async( self, *, - request: Union[ - models.CrmPipelinesAllRequest, models.CrmPipelinesAllRequestTypedDict - ] = models.CrmPipelinesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmPipelinesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmPipelinesAllResponse]: r"""List pipelines List pipelines - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +201,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmPipelinesAllRequest) - request = cast(models.CrmPipelinesAllRequest, request) + request = models.CrmPipelinesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +221,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +255,30 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmPipelinesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetPipelinesResponse) + return models.CrmPipelinesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetPipelinesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +302,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmPipelinesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +321,45 @@ async def list_async( def create( self, *, - pipeline: Union[models.PipelineInput, models.PipelineInputTypedDict], + name: str, raw: Optional[bool] = False, service_id: Optional[str] = None, + id: Optional[str] = None, + currency: OptionalNullable[models.Currency] = UNSET, + archived: Optional[bool] = None, + active: Optional[bool] = None, + display_order: OptionalNullable[int] = UNSET, + win_probability_enabled: Optional[bool] = None, + stages: Optional[ + Union[List[models.PipelineStages], List[models.PipelineStagesTypedDict]] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmPipelinesAddResponse: r"""Create pipeline Create pipeline - :param pipeline: + :param name: The name of the Pipeline. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param id: The unique identifier of the Pipeline. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param archived: Whether the Pipeline is archived or not. + :param active: Whether the Pipeline is active or not. + :param display_order: The order in which the Pipeline is displayed in the UI. + :param win_probability_enabled: Whether the Pipeline has win probability enabled or not. + :param stages: The Pipeline Stages. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +372,21 @@ def create( request = models.CrmPipelinesAddRequest( raw=raw, service_id=service_id, - pipeline=utils.get_pydantic_model(pipeline, models.PipelineInput), + pipeline=models.PipelineInput( + id=id, + name=name, + currency=currency, + archived=archived, + active=active, + display_order=display_order, + win_probability_enabled=win_probability_enabled, + stages=utils.get_pydantic_model( + stages, Optional[List[models.PipelineStages]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +400,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +477,45 @@ def create( async def create_async( self, *, - pipeline: Union[models.PipelineInput, models.PipelineInputTypedDict], + name: str, raw: Optional[bool] = False, service_id: Optional[str] = None, + id: Optional[str] = None, + currency: OptionalNullable[models.Currency] = UNSET, + archived: Optional[bool] = None, + active: Optional[bool] = None, + display_order: OptionalNullable[int] = UNSET, + win_probability_enabled: Optional[bool] = None, + stages: Optional[ + Union[List[models.PipelineStages], List[models.PipelineStagesTypedDict]] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmPipelinesAddResponse: r"""Create pipeline Create pipeline - :param pipeline: + :param name: The name of the Pipeline. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param id: The unique identifier of the Pipeline. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param archived: Whether the Pipeline is archived or not. + :param active: Whether the Pipeline is active or not. + :param display_order: The order in which the Pipeline is displayed in the UI. + :param win_probability_enabled: Whether the Pipeline has win probability enabled or not. + :param stages: The Pipeline Stages. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +528,21 @@ async def create_async( request = models.CrmPipelinesAddRequest( raw=raw, service_id=service_id, - pipeline=utils.get_pydantic_model(pipeline, models.PipelineInput), + pipeline=models.PipelineInput( + id=id, + name=name, + currency=currency, + archived=archived, + active=active, + display_order=display_order, + win_probability_enabled=win_probability_enabled, + stages=utils.get_pydantic_model( + stages, Optional[List[models.PipelineStages]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +556,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +640,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmPipelinesOneResponse: r"""Get pipeline @@ -493,6 +653,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +681,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +762,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmPipelinesOneResponse: r"""Get pipeline @@ -612,6 +775,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +803,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -712,25 +877,47 @@ async def get_async( def update( self, *, - id: str, - pipeline: Union[models.PipelineInput, models.PipelineInputTypedDict], + id_param: str, + name: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + id: Optional[str] = None, + currency: OptionalNullable[models.Currency] = UNSET, + archived: Optional[bool] = None, + active: Optional[bool] = None, + display_order: OptionalNullable[int] = UNSET, + win_probability_enabled: Optional[bool] = None, + stages: Optional[ + Union[List[models.PipelineStages], List[models.PipelineStagesTypedDict]] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmPipelinesUpdateResponse: r"""Update pipeline Update pipeline - :param id: ID of the record you are acting upon. - :param pipeline: + :param id_param: ID of the record you are acting upon. + :param name: The name of the Pipeline. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param id: The unique identifier of the Pipeline. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param archived: Whether the Pipeline is archived or not. + :param active: Whether the Pipeline is active or not. + :param display_order: The order in which the Pipeline is displayed in the UI. + :param win_probability_enabled: Whether the Pipeline has win probability enabled or not. + :param stages: The Pipeline Stages. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -741,10 +928,24 @@ def update( base_url = server_url request = models.CrmPipelinesUpdateRequest( - id=id, + id_param=id_param, service_id=service_id, raw=raw, - pipeline=utils.get_pydantic_model(pipeline, models.PipelineInput), + pipeline=models.PipelineInput( + id=id, + name=name, + currency=currency, + archived=archived, + active=active, + display_order=display_order, + win_probability_enabled=win_probability_enabled, + stages=utils.get_pydantic_model( + stages, Optional[List[models.PipelineStages]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +959,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -834,25 +1036,47 @@ def update( async def update_async( self, *, - id: str, - pipeline: Union[models.PipelineInput, models.PipelineInputTypedDict], + id_param: str, + name: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + id: Optional[str] = None, + currency: OptionalNullable[models.Currency] = UNSET, + archived: Optional[bool] = None, + active: Optional[bool] = None, + display_order: OptionalNullable[int] = UNSET, + win_probability_enabled: Optional[bool] = None, + stages: Optional[ + Union[List[models.PipelineStages], List[models.PipelineStagesTypedDict]] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmPipelinesUpdateResponse: r"""Update pipeline Update pipeline - :param id: ID of the record you are acting upon. - :param pipeline: + :param id_param: ID of the record you are acting upon. + :param name: The name of the Pipeline. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param id: The unique identifier of the Pipeline. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param archived: Whether the Pipeline is archived or not. + :param active: Whether the Pipeline is active or not. + :param display_order: The order in which the Pipeline is displayed in the UI. + :param win_probability_enabled: Whether the Pipeline has win probability enabled or not. + :param stages: The Pipeline Stages. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -863,10 +1087,24 @@ async def update_async( base_url = server_url request = models.CrmPipelinesUpdateRequest( - id=id, + id_param=id_param, service_id=service_id, raw=raw, - pipeline=utils.get_pydantic_model(pipeline, models.PipelineInput), + pipeline=models.PipelineInput( + id=id, + name=name, + currency=currency, + archived=archived, + active=active, + display_order=display_order, + win_probability_enabled=win_probability_enabled, + stages=utils.get_pydantic_model( + stages, Optional[List[models.PipelineStages]] + ), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1118,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1201,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmPipelinesDeleteResponse: r"""Delete pipeline @@ -973,6 +1213,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1240,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1320,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmPipelinesDeleteResponse: r"""Delete pipeline @@ -1089,6 +1332,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1359,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmPipelinesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/products.py b/src/apideck_unify/products.py index f9a6c529..878bb1bc 100644 --- a/src/apideck_unify/products.py +++ b/src/apideck_unify/products.py @@ -3,31 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, Mapping, Optional class Products(BaseSDK): def list( self, *, - request: Union[ - models.EcommerceProductsAllRequest, - models.EcommerceProductsAllRequestTypedDict, - ] = models.EcommerceProductsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.EcommerceProductsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.EcommerceProductsAllResponse]: r"""List Products List Products - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.EcommerceProductsAllRequest) - request = cast(models.EcommerceProductsAllRequest, request) + request = models.EcommerceProductsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceProductsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +101,30 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.EcommerceProductsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetProductsResponse) + return models.EcommerceProductsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetProductsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +148,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.EcommerceProductsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +167,31 @@ def list( async def list_async( self, *, - request: Union[ - models.EcommerceProductsAllRequest, - models.EcommerceProductsAllRequestTypedDict, - ] = models.EcommerceProductsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.EcommerceProductsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.EcommerceProductsAllResponse]: r"""List Products List Products - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +201,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.EcommerceProductsAllRequest) - request = cast(models.EcommerceProductsAllRequest, request) + request = models.EcommerceProductsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +221,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceProductsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +255,30 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.EcommerceProductsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetProductsResponse) + return models.EcommerceProductsAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetProductsResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +302,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.EcommerceProductsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -245,6 +328,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.EcommerceProductsOneResponse: r"""Get Product @@ -257,6 +341,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -284,6 +369,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceProductsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -364,6 +450,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.EcommerceProductsOneResponse: r"""Get Product @@ -376,6 +463,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -403,6 +491,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceProductsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/profitandloss_sdk.py b/src/apideck_unify/profitandloss_sdk.py index 02b1bd3a..ed89b15f 100644 --- a/src/apideck_unify/profitandloss_sdk.py +++ b/src/apideck_unify/profitandloss_sdk.py @@ -3,31 +3,40 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from typing import Any, Dict, Mapping, Optional, Union class ProfitAndLossSDK(BaseSDK): def get( self, *, - request: Union[ - models.AccountingProfitAndLossOneRequest, - models.AccountingProfitAndLossOneRequestTypedDict, - ] = models.AccountingProfitAndLossOneRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.ProfitAndLossFilter, models.ProfitAndLossFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingProfitAndLossOneResponse: r"""Get Profit and Loss Get Profit and Loss - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +46,15 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingProfitAndLossOneRequest) - request = cast(models.AccountingProfitAndLossOneRequest, request) + request = models.AccountingProfitAndLossOneRequest( + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model( + filter_, Optional[models.ProfitAndLossFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +67,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingProfitAndLossOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -125,22 +141,31 @@ def get( async def get_async( self, *, - request: Union[ - models.AccountingProfitAndLossOneRequest, - models.AccountingProfitAndLossOneRequestTypedDict, - ] = models.AccountingProfitAndLossOneRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + filter_: Optional[ + Union[models.ProfitAndLossFilter, models.ProfitAndLossFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingProfitAndLossOneResponse: r"""Get Profit and Loss Get Profit and Loss - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +175,15 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingProfitAndLossOneRequest) - request = cast(models.AccountingProfitAndLossOneRequest, request) + request = models.AccountingProfitAndLossOneRequest( + raw=raw, + service_id=service_id, + filter_=utils.get_pydantic_model( + filter_, Optional[models.ProfitAndLossFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +196,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingProfitAndLossOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/purchaseorders.py b/src/apideck_unify/purchaseorders.py index 1482074e..3c1913d1 100644 --- a/src/apideck_unify/purchaseorders.py +++ b/src/apideck_unify/purchaseorders.py @@ -3,31 +3,48 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from datetime import date +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class PurchaseOrders(BaseSDK): def list( self, *, - request: Union[ - models.AccountingPurchaseOrdersAllRequest, - models.AccountingPurchaseOrdersAllRequestTypedDict, - ] = models.AccountingPurchaseOrdersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + pass_through: Optional[Dict[str, Any]] = None, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.PurchaseOrdersFilter, models.PurchaseOrdersFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.PurchaseOrdersSort, models.PurchaseOrdersSortTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingPurchaseOrdersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingPurchaseOrdersAllResponse]: r"""List Purchase Orders List Purchase Orders - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +54,17 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingPurchaseOrdersAllRequest - ) - request = cast(models.AccountingPurchaseOrdersAllRequest, request) + request = models.AccountingPurchaseOrdersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + pass_through=pass_through, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.PurchaseOrdersFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.PurchaseOrdersSort]), + ) req = self.build_request( method="GET", @@ -54,6 +77,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,9 +111,33 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingPurchaseOrdersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + pass_through=pass_through, + limit=limit, + filter_=filter_, + sort=sort, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetPurchaseOrdersResponse) + return models.AccountingPurchaseOrdersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetPurchaseOrdersResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -113,7 +161,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingPurchaseOrdersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +180,37 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingPurchaseOrdersAllRequest, - models.AccountingPurchaseOrdersAllRequestTypedDict, - ] = models.AccountingPurchaseOrdersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + pass_through: Optional[Dict[str, Any]] = None, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.PurchaseOrdersFilter, models.PurchaseOrdersFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.PurchaseOrdersSort, models.PurchaseOrdersSortTypedDict] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingPurchaseOrdersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingPurchaseOrdersAllResponse]: r"""List Purchase Orders List Purchase Orders - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,11 +220,17 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingPurchaseOrdersAllRequest - ) - request = cast(models.AccountingPurchaseOrdersAllRequest, request) + request = models.AccountingPurchaseOrdersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + pass_through=pass_through, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.PurchaseOrdersFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.PurchaseOrdersSort]), + ) req = self.build_request_async( method="GET", @@ -169,6 +243,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -202,9 +277,33 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingPurchaseOrdersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + pass_through=pass_through, + limit=limit, + filter_=filter_, + sort=sort, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetPurchaseOrdersResponse) + return models.AccountingPurchaseOrdersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetPurchaseOrdersResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -228,7 +327,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingPurchaseOrdersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -242,25 +346,104 @@ async def list_async( def create( self, *, - purchase_order: Union[ - models.PurchaseOrderInput, models.PurchaseOrderInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.PurchaseOrderStatus] = UNSET, + issued_date: OptionalNullable[date] = UNSET, + delivery_date: OptionalNullable[date] = UNSET, + expected_arrival_date: OptionalNullable[date] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + template_id: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + accounting_by_row: OptionalNullable[bool] = UNSET, + due_date: Optional[date] = None, + payment_method: OptionalNullable[str] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + memo: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPurchaseOrdersAddResponse: r"""Create Purchase Order Create Purchase Order - :param purchase_order: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param po_number: A PO Number uniquely identifies a purchase order and is generally defined by the buyer. + :param reference: Optional purchase order reference. + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param status: + :param issued_date: Date purchase order was issued - YYYY-MM-DD. + :param delivery_date: The date on which the purchase order is to be delivered - YYYY-MM-DD. + :param expected_arrival_date: The date on which the order is expected to arrive - YYYY-MM-DD. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param total: Total amount of invoice, including tax. + :param tax_inclusive: Amounts are including tax + :param line_items: + :param shipping_address: + :param ledger_account: + :param template_id: Optional purchase order template + :param discount_percentage: Discount percentage applied to this transaction. + :param bank_account: + :param accounting_by_row: 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. + :param due_date: The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param channel: The channel through which the transaction is processed. + :param memo: Message for the supplier. This text appears on the Purchase Order. + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -273,8 +456,51 @@ def create( request = models.AccountingPurchaseOrdersAddRequest( raw=raw, service_id=service_id, - purchase_order=utils.get_pydantic_model( - purchase_order, models.PurchaseOrderInput + purchase_order=models.PurchaseOrderInput( + po_number=po_number, + reference=reference, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + status=status, + issued_date=issued_date, + delivery_date=delivery_date, + expected_arrival_date=expected_arrival_date, + currency=currency, + currency_rate=currency_rate, + sub_total=sub_total, + total_tax=total_tax, + total=total, + tax_inclusive=tax_inclusive, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + template_id=template_id, + discount_percentage=discount_percentage, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + accounting_by_row=accounting_by_row, + due_date=due_date, + payment_method=payment_method, + tax_code=tax_code, + channel=channel, + memo=memo, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -289,6 +515,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -367,25 +594,104 @@ def create( async def create_async( self, *, - purchase_order: Union[ - models.PurchaseOrderInput, models.PurchaseOrderInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.PurchaseOrderStatus] = UNSET, + issued_date: OptionalNullable[date] = UNSET, + delivery_date: OptionalNullable[date] = UNSET, + expected_arrival_date: OptionalNullable[date] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + template_id: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + accounting_by_row: OptionalNullable[bool] = UNSET, + due_date: Optional[date] = None, + payment_method: OptionalNullable[str] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + memo: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPurchaseOrdersAddResponse: r"""Create Purchase Order Create Purchase Order - :param purchase_order: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param po_number: A PO Number uniquely identifies a purchase order and is generally defined by the buyer. + :param reference: Optional purchase order reference. + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param status: + :param issued_date: Date purchase order was issued - YYYY-MM-DD. + :param delivery_date: The date on which the purchase order is to be delivered - YYYY-MM-DD. + :param expected_arrival_date: The date on which the order is expected to arrive - YYYY-MM-DD. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param total: Total amount of invoice, including tax. + :param tax_inclusive: Amounts are including tax + :param line_items: + :param shipping_address: + :param ledger_account: + :param template_id: Optional purchase order template + :param discount_percentage: Discount percentage applied to this transaction. + :param bank_account: + :param accounting_by_row: 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. + :param due_date: The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param channel: The channel through which the transaction is processed. + :param memo: Message for the supplier. This text appears on the Purchase Order. + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -398,8 +704,51 @@ async def create_async( request = models.AccountingPurchaseOrdersAddRequest( raw=raw, service_id=service_id, - purchase_order=utils.get_pydantic_model( - purchase_order, models.PurchaseOrderInput + purchase_order=models.PurchaseOrderInput( + po_number=po_number, + reference=reference, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + status=status, + issued_date=issued_date, + delivery_date=delivery_date, + expected_arrival_date=expected_arrival_date, + currency=currency, + currency_rate=currency_rate, + sub_total=sub_total, + total_tax=total_tax, + total=total, + tax_inclusive=tax_inclusive, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + template_id=template_id, + discount_percentage=discount_percentage, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + accounting_by_row=accounting_by_row, + due_date=due_date, + payment_method=payment_method, + tax_code=tax_code, + channel=channel, + memo=memo, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -414,6 +763,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -498,6 +848,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPurchaseOrdersOneResponse: r"""Get Purchase Order @@ -509,6 +860,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -535,6 +887,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -614,6 +967,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPurchaseOrdersOneResponse: r"""Get Purchase Order @@ -625,6 +979,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -651,6 +1006,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -725,26 +1081,105 @@ def update( self, *, id: str, - purchase_order: Union[ - models.PurchaseOrderInput, models.PurchaseOrderInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.PurchaseOrderStatus] = UNSET, + issued_date: OptionalNullable[date] = UNSET, + delivery_date: OptionalNullable[date] = UNSET, + expected_arrival_date: OptionalNullable[date] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + template_id: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + accounting_by_row: OptionalNullable[bool] = UNSET, + due_date: Optional[date] = None, + payment_method: OptionalNullable[str] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + memo: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPurchaseOrdersUpdateResponse: r"""Update Purchase Order Update Purchase Order :param id: ID of the record you are acting upon. - :param purchase_order: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param po_number: A PO Number uniquely identifies a purchase order and is generally defined by the buyer. + :param reference: Optional purchase order reference. + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param status: + :param issued_date: Date purchase order was issued - YYYY-MM-DD. + :param delivery_date: The date on which the purchase order is to be delivered - YYYY-MM-DD. + :param expected_arrival_date: The date on which the order is expected to arrive - YYYY-MM-DD. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param total: Total amount of invoice, including tax. + :param tax_inclusive: Amounts are including tax + :param line_items: + :param shipping_address: + :param ledger_account: + :param template_id: Optional purchase order template + :param discount_percentage: Discount percentage applied to this transaction. + :param bank_account: + :param accounting_by_row: 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. + :param due_date: The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param channel: The channel through which the transaction is processed. + :param memo: Message for the supplier. This text appears on the Purchase Order. + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -758,8 +1193,51 @@ def update( id=id, service_id=service_id, raw=raw, - purchase_order=utils.get_pydantic_model( - purchase_order, models.PurchaseOrderInput + purchase_order=models.PurchaseOrderInput( + po_number=po_number, + reference=reference, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + status=status, + issued_date=issued_date, + delivery_date=delivery_date, + expected_arrival_date=expected_arrival_date, + currency=currency, + currency_rate=currency_rate, + sub_total=sub_total, + total_tax=total_tax, + total=total, + tax_inclusive=tax_inclusive, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + template_id=template_id, + discount_percentage=discount_percentage, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + accounting_by_row=accounting_by_row, + due_date=due_date, + payment_method=payment_method, + tax_code=tax_code, + channel=channel, + memo=memo, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -774,6 +1252,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -853,26 +1332,105 @@ async def update_async( self, *, id: str, - purchase_order: Union[ - models.PurchaseOrderInput, models.PurchaseOrderInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + po_number: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + supplier: OptionalNullable[ + Union[models.LinkedSupplierInput, models.LinkedSupplierInputTypedDict] + ] = UNSET, + company_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.PurchaseOrderStatus] = UNSET, + issued_date: OptionalNullable[date] = UNSET, + delivery_date: OptionalNullable[date] = UNSET, + expected_arrival_date: OptionalNullable[date] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + currency_rate: OptionalNullable[float] = UNSET, + sub_total: OptionalNullable[float] = UNSET, + total_tax: OptionalNullable[float] = UNSET, + total: OptionalNullable[float] = UNSET, + tax_inclusive: OptionalNullable[bool] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + ledger_account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + template_id: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + bank_account: Optional[ + Union[models.BankAccount, models.BankAccountTypedDict] + ] = None, + accounting_by_row: OptionalNullable[bool] = UNSET, + due_date: Optional[date] = None, + payment_method: OptionalNullable[str] = UNSET, + tax_code: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + memo: OptionalNullable[str] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[models.LinkedTrackingCategory], + List[models.LinkedTrackingCategoryTypedDict], + ] + ] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPurchaseOrdersUpdateResponse: r"""Update Purchase Order Update Purchase Order :param id: ID of the record you are acting upon. - :param purchase_order: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param po_number: A PO Number uniquely identifies a purchase order and is generally defined by the buyer. + :param reference: Optional purchase order reference. + :param supplier: The supplier this entity is linked to. + :param company_id: The company or subsidiary id the transaction belongs to + :param status: + :param issued_date: Date purchase order was issued - YYYY-MM-DD. + :param delivery_date: The date on which the purchase order is to be delivered - YYYY-MM-DD. + :param expected_arrival_date: The date on which the order is expected to arrive - YYYY-MM-DD. + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :param currency_rate: Currency Exchange Rate at the time entity was recorded/generated. + :param sub_total: Sub-total amount, normally before tax. + :param total_tax: Total tax amount applied to this invoice. + :param total: Total amount of invoice, including tax. + :param tax_inclusive: Amounts are including tax + :param line_items: + :param shipping_address: + :param ledger_account: + :param template_id: Optional purchase order template + :param discount_percentage: Discount percentage applied to this transaction. + :param bank_account: + :param accounting_by_row: 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. + :param due_date: The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. + :param payment_method: Payment method used for the transaction, such as cash, credit card, bank transfer, or check + :param tax_code: Applicable tax id/code override if tax is not supplied on a line item basis. + :param channel: The channel through which the transaction is processed. + :param memo: Message for the supplier. This text appears on the Purchase Order. + :param tracking_categories: A list of linked tracking categories. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -886,8 +1444,51 @@ async def update_async( id=id, service_id=service_id, raw=raw, - purchase_order=utils.get_pydantic_model( - purchase_order, models.PurchaseOrderInput + purchase_order=models.PurchaseOrderInput( + po_number=po_number, + reference=reference, + supplier=utils.get_pydantic_model( + supplier, OptionalNullable[models.LinkedSupplierInput] + ), + company_id=company_id, + status=status, + issued_date=issued_date, + delivery_date=delivery_date, + expected_arrival_date=expected_arrival_date, + currency=currency, + currency_rate=currency_rate, + sub_total=sub_total, + total_tax=total_tax, + total=total, + tax_inclusive=tax_inclusive, + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + ledger_account=utils.get_pydantic_model( + ledger_account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + template_id=template_id, + discount_percentage=discount_percentage, + bank_account=utils.get_pydantic_model( + bank_account, Optional[models.BankAccount] + ), + accounting_by_row=accounting_by_row, + due_date=due_date, + payment_method=payment_method, + tax_code=tax_code, + channel=channel, + memo=memo, + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[models.LinkedTrackingCategory]], + ), + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -902,6 +1503,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -986,6 +1588,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPurchaseOrdersDeleteResponse: r"""Delete Purchase Order @@ -997,6 +1600,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1023,6 +1627,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1104,6 +1709,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingPurchaseOrdersDeleteResponse: r"""Delete Purchase Order @@ -1115,6 +1721,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1141,6 +1748,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingPurchaseOrdersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/sdkconfiguration.py b/src/apideck_unify/sdkconfiguration.py index 7d349c4c..d9aa4df1 100644 --- a/src/apideck_unify/sdkconfiguration.py +++ b/src/apideck_unify/sdkconfiguration.py @@ -27,10 +27,10 @@ class SDKConfiguration: server_url: Optional[str] = "" server_idx: Optional[int] = 0 language: str = "python" - openapi_doc_version: str = "10.8.3" - sdk_version: str = "0.1.7" - gen_version: str = "2.474.15" - user_agent: str = "speakeasy-sdk/python 0.1.7 2.474.15 10.8.3 apideck-unify" + openapi_doc_version: str = "10.9.0" + sdk_version: str = "0.2.0" + gen_version: str = "2.480.1" + user_agent: str = "speakeasy-sdk/python 0.2.0 2.480.1 10.9.0 apideck-unify" retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None diff --git a/src/apideck_unify/sessions.py b/src/apideck_unify/sessions.py index 10872ba3..efa07b99 100644 --- a/src/apideck_unify/sessions.py +++ b/src/apideck_unify/sessions.py @@ -3,9 +3,9 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import OptionalNullable, UNSET +from apideck_unify.types import BaseModel, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union +from typing import Any, Mapping, Optional, Union, cast class Sessions(BaseSDK): @@ -16,6 +16,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultSessionsCreateResponse: r"""Create Session @@ -29,6 +30,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -38,9 +40,9 @@ def create( if server_url is not None: base_url = server_url - request = models.Session( - request=utils.get_pydantic_model(request, Optional[models.Session]), - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[models.Session]) + request = cast(Optional[models.Session], request) req = self.build_request( method="POST", @@ -53,6 +55,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultSessionsCreateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -133,6 +136,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultSessionsCreateResponse: r"""Create Session @@ -146,6 +150,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -155,9 +160,9 @@ async def create_async( if server_url is not None: base_url = server_url - request = models.Session( - request=utils.get_pydantic_model(request, Optional[models.Session]), - ) + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[models.Session]) + request = cast(Optional[models.Session], request) req = self.build_request_async( method="POST", @@ -170,6 +175,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultSessionsCreateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/sharedlinks.py b/src/apideck_unify/sharedlinks.py index f88b8078..ac9f9381 100644 --- a/src/apideck_unify/sharedlinks.py +++ b/src/apideck_unify/sharedlinks.py @@ -3,31 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class SharedLinks(BaseSDK): def list( self, *, - request: Union[ - models.FileStorageSharedLinksAllRequest, - models.FileStorageSharedLinksAllRequestTypedDict, - ] = models.FileStorageSharedLinksAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.FileStorageSharedLinksAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.FileStorageSharedLinksAllResponse]: r"""List SharedLinks List SharedLinks - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageSharedLinksAllRequest) - request = cast(models.FileStorageSharedLinksAllRequest, request) + request = models.FileStorageSharedLinksAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +101,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.FileStorageSharedLinksAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetSharedLinksResponse) + return models.FileStorageSharedLinksAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetSharedLinksResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +150,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.FileStorageSharedLinksAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +169,31 @@ def list( async def list_async( self, *, - request: Union[ - models.FileStorageSharedLinksAllRequest, - models.FileStorageSharedLinksAllRequestTypedDict, - ] = models.FileStorageSharedLinksAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.FileStorageSharedLinksAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.FileStorageSharedLinksAllResponse]: r"""List SharedLinks List SharedLinks - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +203,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.FileStorageSharedLinksAllRequest) - request = cast(models.FileStorageSharedLinksAllRequest, request) + request = models.FileStorageSharedLinksAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +223,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +257,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.FileStorageSharedLinksAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetSharedLinksResponse) + return models.FileStorageSharedLinksAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetSharedLinksResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +306,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.FileStorageSharedLinksAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +325,35 @@ async def list_async( def create( self, *, - shared_link: Union[models.SharedLinkInput, models.SharedLinkInputTypedDict], + target_id: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + download_url: OptionalNullable[str] = UNSET, + scope: OptionalNullable[models.Scope] = UNSET, + password: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageSharedLinksAddResponse: r"""Create Shared Link Create Shared Link - :param shared_link: + :param target_id: The ID of the file or folder to link. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param download_url: The URL that can be used to download the file. + :param scope: The scope of the shared link. + :param password: Optional password for the shared link. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +366,15 @@ def create( request = models.FileStorageSharedLinksAddRequest( raw=raw, service_id=service_id, - shared_link=utils.get_pydantic_model(shared_link, models.SharedLinkInput), + shared_link=models.SharedLinkInput( + download_url=download_url, + target_id=target_id, + scope=scope, + password=password, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +388,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +465,35 @@ def create( async def create_async( self, *, - shared_link: Union[models.SharedLinkInput, models.SharedLinkInputTypedDict], + target_id: Nullable[str], raw: Optional[bool] = False, service_id: Optional[str] = None, + download_url: OptionalNullable[str] = UNSET, + scope: OptionalNullable[models.Scope] = UNSET, + password: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageSharedLinksAddResponse: r"""Create Shared Link Create Shared Link - :param shared_link: + :param target_id: The ID of the file or folder to link. :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param download_url: The URL that can be used to download the file. + :param scope: The scope of the shared link. + :param password: Optional password for the shared link. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +506,15 @@ async def create_async( request = models.FileStorageSharedLinksAddRequest( raw=raw, service_id=service_id, - shared_link=utils.get_pydantic_model(shared_link, models.SharedLinkInput), + shared_link=models.SharedLinkInput( + download_url=download_url, + target_id=target_id, + scope=scope, + password=password, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +528,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +612,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageSharedLinksOneResponse: r"""Get Shared Link @@ -495,6 +625,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +653,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +734,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageSharedLinksOneResponse: r"""Get Shared Link @@ -614,6 +747,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +775,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +850,36 @@ def update( self, *, id: str, - shared_link: Union[models.SharedLinkInput, models.SharedLinkInputTypedDict], + target_id: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + download_url: OptionalNullable[str] = UNSET, + scope: OptionalNullable[models.Scope] = UNSET, + password: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageSharedLinksUpdateResponse: r"""Update Shared Link Update Shared Link :param id: ID of the record you are acting upon. - :param shared_link: + :param target_id: The ID of the file or folder to link. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param download_url: The URL that can be used to download the file. + :param scope: The scope of the shared link. + :param password: Optional password for the shared link. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +893,15 @@ def update( id=id, service_id=service_id, raw=raw, - shared_link=utils.get_pydantic_model(shared_link, models.SharedLinkInput), + shared_link=models.SharedLinkInput( + download_url=download_url, + target_id=target_id, + scope=scope, + password=password, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +915,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +993,36 @@ async def update_async( self, *, id: str, - shared_link: Union[models.SharedLinkInput, models.SharedLinkInputTypedDict], + target_id: Nullable[str], service_id: Optional[str] = None, raw: Optional[bool] = False, + download_url: OptionalNullable[str] = UNSET, + scope: OptionalNullable[models.Scope] = UNSET, + password: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageSharedLinksUpdateResponse: r"""Update Shared Link Update Shared Link :param id: ID of the record you are acting upon. - :param shared_link: + :param target_id: The ID of the file or folder to link. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param download_url: The URL that can be used to download the file. + :param scope: The scope of the shared link. + :param password: Optional password for the shared link. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1036,15 @@ async def update_async( id=id, service_id=service_id, raw=raw, - shared_link=utils.get_pydantic_model(shared_link, models.SharedLinkInput), + shared_link=models.SharedLinkInput( + download_url=download_url, + target_id=target_id, + scope=scope, + password=password, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1058,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1141,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageSharedLinksDeleteResponse: r"""Delete Shared Link @@ -975,6 +1153,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1180,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1260,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageSharedLinksDeleteResponse: r"""Delete Shared Link @@ -1091,6 +1272,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1299,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageSharedLinksDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/stores.py b/src/apideck_unify/stores.py index a0254264..85e60186 100644 --- a/src/apideck_unify/stores.py +++ b/src/apideck_unify/stores.py @@ -5,7 +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 typing import Any, Optional +from typing import Any, Mapping, Optional class Stores(BaseSDK): @@ -18,6 +18,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.EcommerceStoresOneResponse: r"""Get Store @@ -29,6 +30,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -55,6 +57,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceStoresOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -134,6 +137,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.EcommerceStoresOneResponse: r"""Get Store @@ -145,6 +149,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -171,6 +176,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.EcommerceStoresOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/subsidiaries.py b/src/apideck_unify/subsidiaries.py index 3712481e..3271649a 100644 --- a/src/apideck_unify/subsidiaries.py +++ b/src/apideck_unify/subsidiaries.py @@ -3,31 +3,39 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Subsidiaries(BaseSDK): def list( self, *, - request: Union[ - models.AccountingSubsidiariesAllRequest, - models.AccountingSubsidiariesAllRequestTypedDict, - ] = models.AccountingSubsidiariesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingSubsidiariesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingSubsidiariesAllResponse]: r"""List Subsidiaries List Subsidiaries - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +45,13 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingSubsidiariesAllRequest) - request = cast(models.AccountingSubsidiariesAllRequest, request) + request = models.AccountingSubsidiariesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +64,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +98,31 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingSubsidiariesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetSubsidiariesResponse) + return models.AccountingSubsidiariesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetSubsidiariesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +146,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingSubsidiariesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +165,29 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingSubsidiariesAllRequest, - models.AccountingSubsidiariesAllRequestTypedDict, - ] = models.AccountingSubsidiariesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingSubsidiariesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingSubsidiariesAllResponse]: r"""List Subsidiaries List Subsidiaries - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +197,13 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingSubsidiariesAllRequest) - request = cast(models.AccountingSubsidiariesAllRequest, request) + request = models.AccountingSubsidiariesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +216,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +250,31 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingSubsidiariesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetSubsidiariesResponse) + return models.AccountingSubsidiariesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetSubsidiariesResponse + ), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +298,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingSubsidiariesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +317,35 @@ async def list_async( def create( self, *, - subsidiary: Union[models.SubsidiaryInput, models.SubsidiaryInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + status: Optional[models.SubsidiaryStatus] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSubsidiariesAddResponse: r"""Create Subsidiary Create Subsidiary - :param subsidiary: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: A unique identifier for an object. + :param name: The name of the company. + :param status: Based on the status some functionality is enabled or disabled. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +358,15 @@ def create( request = models.AccountingSubsidiariesAddRequest( raw=raw, service_id=service_id, - subsidiary=utils.get_pydantic_model(subsidiary, models.SubsidiaryInput), + subsidiary=models.SubsidiaryInput( + parent_id=parent_id, + name=name, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -281,6 +380,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +457,35 @@ def create( async def create_async( self, *, - subsidiary: Union[models.SubsidiaryInput, models.SubsidiaryInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + status: Optional[models.SubsidiaryStatus] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSubsidiariesAddResponse: r"""Create Subsidiary Create Subsidiary - :param subsidiary: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: A unique identifier for an object. + :param name: The name of the company. + :param status: Based on the status some functionality is enabled or disabled. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +498,15 @@ async def create_async( request = models.AccountingSubsidiariesAddRequest( raw=raw, service_id=service_id, - subsidiary=utils.get_pydantic_model(subsidiary, models.SubsidiaryInput), + subsidiary=models.SubsidiaryInput( + parent_id=parent_id, + name=name, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -400,6 +520,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +604,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSubsidiariesOneResponse: r"""Get Subsidiary @@ -495,6 +617,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +645,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +726,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSubsidiariesOneResponse: r"""Get Subsidiary @@ -614,6 +739,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +767,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +842,36 @@ def update( self, *, id: str, - subsidiary: Union[models.SubsidiaryInput, models.SubsidiaryInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + status: Optional[models.SubsidiaryStatus] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSubsidiariesUpdateResponse: r"""Update Subsidiary Update Subsidiary :param id: ID of the record you are acting upon. - :param subsidiary: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: A unique identifier for an object. + :param name: The name of the company. + :param status: Based on the status some functionality is enabled or disabled. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +885,15 @@ def update( id=id, service_id=service_id, raw=raw, - subsidiary=utils.get_pydantic_model(subsidiary, models.SubsidiaryInput), + subsidiary=models.SubsidiaryInput( + parent_id=parent_id, + name=name, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -760,6 +907,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +985,36 @@ async def update_async( self, *, id: str, - subsidiary: Union[models.SubsidiaryInput, models.SubsidiaryInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + name: OptionalNullable[str] = UNSET, + status: Optional[models.SubsidiaryStatus] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSubsidiariesUpdateResponse: r"""Update Subsidiary Update Subsidiary :param id: ID of the record you are acting upon. - :param subsidiary: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: A unique identifier for an object. + :param name: The name of the company. + :param status: Based on the status some functionality is enabled or disabled. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1028,15 @@ async def update_async( id=id, service_id=service_id, raw=raw, - subsidiary=utils.get_pydantic_model(subsidiary, models.SubsidiaryInput), + subsidiary=models.SubsidiaryInput( + parent_id=parent_id, + name=name, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -882,6 +1050,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1133,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSubsidiariesDeleteResponse: r"""Delete Subsidiary @@ -975,6 +1145,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1172,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1252,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSubsidiariesDeleteResponse: r"""Delete Subsidiary @@ -1091,6 +1264,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1291,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSubsidiariesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/suppliers.py b/src/apideck_unify/suppliers.py index 304ee2ea..5ddd079d 100644 --- a/src/apideck_unify/suppliers.py +++ b/src/apideck_unify/suppliers.py @@ -3,31 +3,49 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Suppliers(BaseSDK): def list( self, *, - request: Union[ - models.AccountingSuppliersAllRequest, - models.AccountingSuppliersAllRequestTypedDict, - ] = models.AccountingSuppliersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.SuppliersFilter, models.SuppliersFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.SuppliersSort, models.SuppliersSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingSuppliersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingSuppliersAllResponse]: r"""List Suppliers List Suppliers - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +55,16 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingSuppliersAllRequest) - request = cast(models.AccountingSuppliersAllRequest, request) + request = models.AccountingSuppliersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.SuppliersFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.SuppliersSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +77,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,9 +111,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingSuppliersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetSuppliersResponse) + return models.AccountingSuppliersAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetSuppliersResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -111,7 +160,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingSuppliersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -125,22 +179,39 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingSuppliersAllRequest, - models.AccountingSuppliersAllRequestTypedDict, - ] = models.AccountingSuppliersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.SuppliersFilter, models.SuppliersFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.SuppliersSort, models.SuppliersSortTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingSuppliersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingSuppliersAllResponse]: r"""List Suppliers List Suppliers - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param sort: Apply sorting + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -150,9 +221,16 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingSuppliersAllRequest) - request = cast(models.AccountingSuppliersAllRequest, request) + request = models.AccountingSuppliersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.SuppliersFilter]), + sort=utils.get_pydantic_model(sort, Optional[models.SuppliersSort]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -165,6 +243,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -198,9 +277,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingSuppliersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetSuppliersResponse) + return models.AccountingSuppliersAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetSuppliersResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -224,7 +326,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingSuppliersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -238,23 +345,92 @@ async def list_async( def create( self, *, - supplier: Union[models.SupplierInput, models.SupplierInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + display_id: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + individual: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + notes: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + tax_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + status: OptionalNullable[models.SupplierStatus] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiary_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSuppliersAddResponse: r"""Create Supplier Create Supplier - :param supplier: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_id: Display ID + :param display_name: Display name + :param company_name: The name of the company. + :param company_id: The company or subsidiary id the transaction belongs to + :param title: The job title of the person. + :param first_name: The first name of the person. + :param middle_name: Middle name of the person. + :param last_name: The last name of the person. + :param suffix: + :param individual: Is this an individual or business supplier + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param bank_accounts: + :param notes: Some notes about this supplier + :param tax_rate: + :param tax_number: + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :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 channel: The channel through which the transaction is processed. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiary_id: The subsidiary the supplier belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -267,7 +443,48 @@ def create( request = models.AccountingSuppliersAddRequest( raw=raw, service_id=service_id, - supplier=utils.get_pydantic_model(supplier, models.SupplierInput), + supplier=models.SupplierInput( + display_id=display_id, + display_name=display_name, + company_name=company_name, + company_id=company_id, + title=title, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + suffix=suffix, + individual=individual, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + notes=notes, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + tax_number=tax_number, + currency=currency, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + status=status, + payment_method=payment_method, + channel=channel, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiary_id=subsidiary_id, + ), ) req = self.build_request( @@ -281,6 +498,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -357,23 +575,92 @@ def create( async def create_async( self, *, - supplier: Union[models.SupplierInput, models.SupplierInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + display_id: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + individual: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + notes: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + tax_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + status: OptionalNullable[models.SupplierStatus] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiary_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSuppliersAddResponse: r"""Create Supplier Create Supplier - :param supplier: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param display_id: Display ID + :param display_name: Display name + :param company_name: The name of the company. + :param company_id: The company or subsidiary id the transaction belongs to + :param title: The job title of the person. + :param first_name: The first name of the person. + :param middle_name: Middle name of the person. + :param last_name: The last name of the person. + :param suffix: + :param individual: Is this an individual or business supplier + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param bank_accounts: + :param notes: Some notes about this supplier + :param tax_rate: + :param tax_number: + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :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 channel: The channel through which the transaction is processed. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiary_id: The subsidiary the supplier belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -386,7 +673,48 @@ async def create_async( request = models.AccountingSuppliersAddRequest( raw=raw, service_id=service_id, - supplier=utils.get_pydantic_model(supplier, models.SupplierInput), + supplier=models.SupplierInput( + display_id=display_id, + display_name=display_name, + company_name=company_name, + company_id=company_id, + title=title, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + suffix=suffix, + individual=individual, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + notes=notes, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + tax_number=tax_number, + currency=currency, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + status=status, + payment_method=payment_method, + channel=channel, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiary_id=subsidiary_id, + ), ) req = self.build_request_async( @@ -400,6 +728,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -483,6 +812,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSuppliersOneResponse: r"""Get Supplier @@ -495,6 +825,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -522,6 +853,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -602,6 +934,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSuppliersOneResponse: r"""Get Supplier @@ -614,6 +947,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,6 +975,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -715,24 +1050,93 @@ def update( self, *, id: str, - supplier: Union[models.SupplierInput, models.SupplierInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + display_id: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + individual: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + notes: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + tax_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + status: OptionalNullable[models.SupplierStatus] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiary_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSuppliersUpdateResponse: r"""Update Supplier Update Supplier :param id: ID of the record you are acting upon. - :param supplier: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_id: Display ID + :param display_name: Display name + :param company_name: The name of the company. + :param company_id: The company or subsidiary id the transaction belongs to + :param title: The job title of the person. + :param first_name: The first name of the person. + :param middle_name: Middle name of the person. + :param last_name: The last name of the person. + :param suffix: + :param individual: Is this an individual or business supplier + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param bank_accounts: + :param notes: Some notes about this supplier + :param tax_rate: + :param tax_number: + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :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 channel: The channel through which the transaction is processed. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiary_id: The subsidiary the supplier belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -746,7 +1150,48 @@ def update( id=id, service_id=service_id, raw=raw, - supplier=utils.get_pydantic_model(supplier, models.SupplierInput), + supplier=models.SupplierInput( + display_id=display_id, + display_name=display_name, + company_name=company_name, + company_id=company_id, + title=title, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + suffix=suffix, + individual=individual, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + notes=notes, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + tax_number=tax_number, + currency=currency, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + status=status, + payment_method=payment_method, + channel=channel, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiary_id=subsidiary_id, + ), ) req = self.build_request( @@ -760,6 +1205,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -837,24 +1283,93 @@ async def update_async( self, *, id: str, - supplier: Union[models.SupplierInput, models.SupplierInputTypedDict], service_id: Optional[str] = None, raw: Optional[bool] = False, + display_id: OptionalNullable[str] = UNSET, + display_name: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + company_id: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + middle_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + suffix: OptionalNullable[str] = UNSET, + individual: OptionalNullable[bool] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + emails: Optional[Union[List[models.Email], List[models.EmailTypedDict]]] = None, + websites: Optional[ + Union[List[models.Website], List[models.WebsiteTypedDict]] + ] = None, + bank_accounts: Optional[ + Union[List[models.BankAccount], List[models.BankAccountTypedDict]] + ] = None, + notes: OptionalNullable[str] = UNSET, + tax_rate: Optional[ + Union[models.LinkedTaxRateInput, models.LinkedTaxRateInputTypedDict] + ] = None, + tax_number: OptionalNullable[str] = UNSET, + currency: OptionalNullable[models.Currency] = UNSET, + account: OptionalNullable[ + Union[ + models.LinkedLedgerAccountInput, + models.LinkedLedgerAccountInputTypedDict, + ] + ] = UNSET, + status: OptionalNullable[models.SupplierStatus] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + channel: OptionalNullable[str] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiary_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSuppliersUpdateResponse: r"""Update Supplier Update Supplier :param id: ID of the record you are acting upon. - :param supplier: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param display_id: Display ID + :param display_name: Display name + :param company_name: The name of the company. + :param company_id: The company or subsidiary id the transaction belongs to + :param title: The job title of the person. + :param first_name: The first name of the person. + :param middle_name: Middle name of the person. + :param last_name: The last name of the person. + :param suffix: + :param individual: Is this an individual or business supplier + :param addresses: + :param phone_numbers: + :param emails: + :param websites: + :param bank_accounts: + :param notes: Some notes about this supplier + :param tax_rate: + :param tax_number: + :param currency: Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). + :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 channel: The channel through which the transaction is processed. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiary_id: The subsidiary the supplier belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -868,7 +1383,48 @@ async def update_async( id=id, service_id=service_id, raw=raw, - supplier=utils.get_pydantic_model(supplier, models.SupplierInput), + supplier=models.SupplierInput( + display_id=display_id, + display_name=display_name, + company_name=company_name, + company_id=company_id, + title=title, + first_name=first_name, + middle_name=middle_name, + last_name=last_name, + suffix=suffix, + individual=individual, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, Optional[List[models.Email]]), + websites=utils.get_pydantic_model( + websites, Optional[List[models.Website]] + ), + bank_accounts=utils.get_pydantic_model( + bank_accounts, Optional[List[models.BankAccount]] + ), + notes=notes, + tax_rate=utils.get_pydantic_model( + tax_rate, Optional[models.LinkedTaxRateInput] + ), + tax_number=tax_number, + currency=currency, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccountInput] + ), + status=status, + payment_method=payment_method, + channel=channel, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiary_id=subsidiary_id, + ), ) req = self.build_request_async( @@ -882,6 +1438,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -964,6 +1521,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSuppliersDeleteResponse: r"""Delete Supplier @@ -975,6 +1533,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1001,6 +1560,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1080,6 +1640,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingSuppliersDeleteResponse: r"""Delete Supplier @@ -1091,6 +1652,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1117,6 +1679,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingSuppliersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/taxrates.py b/src/apideck_unify/taxrates.py index 992ee007..31d2d32e 100644 --- a/src/apideck_unify/taxrates.py +++ b/src/apideck_unify/taxrates.py @@ -3,32 +3,46 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class TaxRates(BaseSDK): def list( self, *, - request: Union[ - models.AccountingTaxRatesAllRequest, - models.AccountingTaxRatesAllRequestTypedDict, - ] = models.AccountingTaxRatesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.TaxRatesFilter, models.TaxRatesFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingTaxRatesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingTaxRatesAllResponse]: r"""List Tax Rates List Tax Rates. Note: Not all connectors return the actual rate/percentage value. In this case, only the tax code or reference is returned. Connectors Affected: Quickbooks - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -38,9 +52,15 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingTaxRatesAllRequest) - request = cast(models.AccountingTaxRatesAllRequest, request) + request = models.AccountingTaxRatesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.TaxRatesFilter]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -53,6 +73,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -86,9 +107,31 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingTaxRatesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetTaxRatesResponse) + return models.AccountingTaxRatesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetTaxRatesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -112,7 +155,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingTaxRatesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -126,23 +174,36 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingTaxRatesAllRequest, - models.AccountingTaxRatesAllRequestTypedDict, - ] = models.AccountingTaxRatesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.TaxRatesFilter, models.TaxRatesFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingTaxRatesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingTaxRatesAllResponse]: r"""List Tax Rates List Tax Rates. Note: Not all connectors return the actual rate/percentage value. In this case, only the tax code or reference is returned. Connectors Affected: Quickbooks - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,9 +213,15 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.AccountingTaxRatesAllRequest) - request = cast(models.AccountingTaxRatesAllRequest, request) + request = models.AccountingTaxRatesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model(filter_, Optional[models.TaxRatesFilter]), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -167,6 +234,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -200,9 +268,31 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingTaxRatesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetTaxRatesResponse) + return models.AccountingTaxRatesAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetTaxRatesResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -226,7 +316,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingTaxRatesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -240,23 +335,63 @@ async def list_async( def create( self, *, - tax_rate: Union[models.TaxRateInput, models.TaxRateInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + id: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + code: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + effective_tax_rate: OptionalNullable[float] = UNSET, + total_tax_rate: OptionalNullable[float] = UNSET, + tax_payable_account_id: OptionalNullable[str] = UNSET, + tax_remitted_account_id: OptionalNullable[str] = UNSET, + components: OptionalNullable[ + Union[List[models.Components], List[models.ComponentsTypedDict]] + ] = UNSET, + type_: OptionalNullable[str] = UNSET, + report_tax_type: OptionalNullable[str] = UNSET, + original_tax_rate_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.TaxRateStatus] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiariesModel], List[models.SubsidiariesModelTypedDict] + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTaxRatesAddResponse: r"""Create Tax Rate Create Tax Rate - :param tax_rate: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param id: ID assigned to identify this tax rate. + :param name: Name assigned to identify this tax rate. + :param code: Tax code assigned to identify this tax rate. + :param description: Description of tax rate + :param effective_tax_rate: Effective tax rate + :param total_tax_rate: Not compounded sum of the components of a tax rate + :param tax_payable_account_id: Unique identifier for the account for tax collected. + :param tax_remitted_account_id: Unique identifier for the account for tax remitted. + :param components: + :param type: Tax type used to indicate the source of tax collected or paid + :param report_tax_type: Report Tax type to aggregate tax collected or paid for reporting purposes + :param original_tax_rate_id: ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. + :param status: Tax rate status + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiaries: The subsidiaries this belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -269,7 +404,30 @@ def create( request = models.AccountingTaxRatesAddRequest( raw=raw, service_id=service_id, - tax_rate=utils.get_pydantic_model(tax_rate, models.TaxRateInput), + tax_rate=models.TaxRateInput( + id=id, + name=name, + code=code, + description=description, + effective_tax_rate=effective_tax_rate, + total_tax_rate=total_tax_rate, + tax_payable_account_id=tax_payable_account_id, + tax_remitted_account_id=tax_remitted_account_id, + components=utils.get_pydantic_model( + components, OptionalNullable[List[models.Components]] + ), + type=type_, + report_tax_type=report_tax_type, + original_tax_rate_id=original_tax_rate_id, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiariesModel]] + ), + ), ) req = self.build_request( @@ -283,6 +441,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -359,23 +518,63 @@ def create( async def create_async( self, *, - tax_rate: Union[models.TaxRateInput, models.TaxRateInputTypedDict], raw: Optional[bool] = False, service_id: Optional[str] = None, + id: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + code: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + effective_tax_rate: OptionalNullable[float] = UNSET, + total_tax_rate: OptionalNullable[float] = UNSET, + tax_payable_account_id: OptionalNullable[str] = UNSET, + tax_remitted_account_id: OptionalNullable[str] = UNSET, + components: OptionalNullable[ + Union[List[models.Components], List[models.ComponentsTypedDict]] + ] = UNSET, + type_: OptionalNullable[str] = UNSET, + report_tax_type: OptionalNullable[str] = UNSET, + original_tax_rate_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.TaxRateStatus] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiariesModel], List[models.SubsidiariesModelTypedDict] + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTaxRatesAddResponse: r"""Create Tax Rate Create Tax Rate - :param tax_rate: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param id: ID assigned to identify this tax rate. + :param name: Name assigned to identify this tax rate. + :param code: Tax code assigned to identify this tax rate. + :param description: Description of tax rate + :param effective_tax_rate: Effective tax rate + :param total_tax_rate: Not compounded sum of the components of a tax rate + :param tax_payable_account_id: Unique identifier for the account for tax collected. + :param tax_remitted_account_id: Unique identifier for the account for tax remitted. + :param components: + :param type: Tax type used to indicate the source of tax collected or paid + :param report_tax_type: Report Tax type to aggregate tax collected or paid for reporting purposes + :param original_tax_rate_id: ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. + :param status: Tax rate status + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiaries: The subsidiaries this belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -388,7 +587,30 @@ async def create_async( request = models.AccountingTaxRatesAddRequest( raw=raw, service_id=service_id, - tax_rate=utils.get_pydantic_model(tax_rate, models.TaxRateInput), + tax_rate=models.TaxRateInput( + id=id, + name=name, + code=code, + description=description, + effective_tax_rate=effective_tax_rate, + total_tax_rate=total_tax_rate, + tax_payable_account_id=tax_payable_account_id, + tax_remitted_account_id=tax_remitted_account_id, + components=utils.get_pydantic_model( + components, OptionalNullable[List[models.Components]] + ), + type=type_, + report_tax_type=report_tax_type, + original_tax_rate_id=original_tax_rate_id, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiariesModel]] + ), + ), ) req = self.build_request_async( @@ -402,6 +624,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -485,6 +708,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTaxRatesOneResponse: r"""Get Tax Rate @@ -498,6 +722,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -525,6 +750,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -605,6 +831,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTaxRatesOneResponse: r"""Get Tax Rate @@ -618,6 +845,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -645,6 +873,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -718,25 +947,65 @@ async def get_async( def update( self, *, - id: str, - tax_rate: Union[models.TaxRateInput, models.TaxRateInputTypedDict], + id_param: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + id: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + code: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + effective_tax_rate: OptionalNullable[float] = UNSET, + total_tax_rate: OptionalNullable[float] = UNSET, + tax_payable_account_id: OptionalNullable[str] = UNSET, + tax_remitted_account_id: OptionalNullable[str] = UNSET, + components: OptionalNullable[ + Union[List[models.Components], List[models.ComponentsTypedDict]] + ] = UNSET, + type_: OptionalNullable[str] = UNSET, + report_tax_type: OptionalNullable[str] = UNSET, + original_tax_rate_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.TaxRateStatus] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiariesModel], List[models.SubsidiariesModelTypedDict] + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTaxRatesUpdateResponse: r"""Update Tax Rate Update Tax Rate - :param id: ID of the record you are acting upon. - :param tax_rate: + :param id_param: ID of the record you are acting upon. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param id: ID assigned to identify this tax rate. + :param name: Name assigned to identify this tax rate. + :param code: Tax code assigned to identify this tax rate. + :param description: Description of tax rate + :param effective_tax_rate: Effective tax rate + :param total_tax_rate: Not compounded sum of the components of a tax rate + :param tax_payable_account_id: Unique identifier for the account for tax collected. + :param tax_remitted_account_id: Unique identifier for the account for tax remitted. + :param components: + :param type: Tax type used to indicate the source of tax collected or paid + :param report_tax_type: Report Tax type to aggregate tax collected or paid for reporting purposes + :param original_tax_rate_id: ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. + :param status: Tax rate status + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiaries: The subsidiaries this belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -747,10 +1016,33 @@ def update( base_url = server_url request = models.AccountingTaxRatesUpdateRequest( - id=id, + id_param=id_param, service_id=service_id, raw=raw, - tax_rate=utils.get_pydantic_model(tax_rate, models.TaxRateInput), + tax_rate=models.TaxRateInput( + id=id, + name=name, + code=code, + description=description, + effective_tax_rate=effective_tax_rate, + total_tax_rate=total_tax_rate, + tax_payable_account_id=tax_payable_account_id, + tax_remitted_account_id=tax_remitted_account_id, + components=utils.get_pydantic_model( + components, OptionalNullable[List[models.Components]] + ), + type=type_, + report_tax_type=report_tax_type, + original_tax_rate_id=original_tax_rate_id, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiariesModel]] + ), + ), ) req = self.build_request( @@ -764,6 +1056,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -840,25 +1133,65 @@ def update( async def update_async( self, *, - id: str, - tax_rate: Union[models.TaxRateInput, models.TaxRateInputTypedDict], + id_param: str, service_id: Optional[str] = None, raw: Optional[bool] = False, + id: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + code: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + effective_tax_rate: OptionalNullable[float] = UNSET, + total_tax_rate: OptionalNullable[float] = UNSET, + tax_payable_account_id: OptionalNullable[str] = UNSET, + tax_remitted_account_id: OptionalNullable[str] = UNSET, + components: OptionalNullable[ + Union[List[models.Components], List[models.ComponentsTypedDict]] + ] = UNSET, + type_: OptionalNullable[str] = UNSET, + report_tax_type: OptionalNullable[str] = UNSET, + original_tax_rate_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.TaxRateStatus] = UNSET, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.SubsidiariesModel], List[models.SubsidiariesModelTypedDict] + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTaxRatesUpdateResponse: r"""Update Tax Rate Update Tax Rate - :param id: ID of the record you are acting upon. - :param tax_rate: + :param id_param: ID of the record you are acting upon. :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param id: ID assigned to identify this tax rate. + :param name: Name assigned to identify this tax rate. + :param code: Tax code assigned to identify this tax rate. + :param description: Description of tax rate + :param effective_tax_rate: Effective tax rate + :param total_tax_rate: Not compounded sum of the components of a tax rate + :param tax_payable_account_id: Unique identifier for the account for tax collected. + :param tax_remitted_account_id: Unique identifier for the account for tax remitted. + :param components: + :param type: Tax type used to indicate the source of tax collected or paid + :param report_tax_type: Report Tax type to aggregate tax collected or paid for reporting purposes + :param original_tax_rate_id: ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. + :param status: Tax rate status + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiaries: The subsidiaries this belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -869,10 +1202,33 @@ async def update_async( base_url = server_url request = models.AccountingTaxRatesUpdateRequest( - id=id, + id_param=id_param, service_id=service_id, raw=raw, - tax_rate=utils.get_pydantic_model(tax_rate, models.TaxRateInput), + tax_rate=models.TaxRateInput( + id=id, + name=name, + code=code, + description=description, + effective_tax_rate=effective_tax_rate, + total_tax_rate=total_tax_rate, + tax_payable_account_id=tax_payable_account_id, + tax_remitted_account_id=tax_remitted_account_id, + components=utils.get_pydantic_model( + components, OptionalNullable[List[models.Components]] + ), + type=type_, + report_tax_type=report_tax_type, + original_tax_rate_id=original_tax_rate_id, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.SubsidiariesModel]] + ), + ), ) req = self.build_request_async( @@ -886,6 +1242,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -968,6 +1325,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTaxRatesDeleteResponse: r"""Delete Tax Rate @@ -979,6 +1337,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1005,6 +1364,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1084,6 +1444,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTaxRatesDeleteResponse: r"""Delete Tax Rate @@ -1095,6 +1456,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1121,6 +1483,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTaxRatesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/timeoffrequests.py b/src/apideck_unify/timeoffrequests.py index 9313b2e0..6aaafeae 100644 --- a/src/apideck_unify/timeoffrequests.py +++ b/src/apideck_unify/timeoffrequests.py @@ -3,31 +3,45 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class TimeOffRequests(BaseSDK): def list( self, *, - request: Union[ - models.HrisTimeOffRequestsAllRequest, - models.HrisTimeOffRequestsAllRequestTypedDict, - ] = models.HrisTimeOffRequestsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.TimeOffRequestsFilter, models.TimeOffRequestsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.HrisTimeOffRequestsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.HrisTimeOffRequestsAllResponse]: r"""List Time Off Requests List Time Off Requests - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,9 +51,17 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisTimeOffRequestsAllRequest) - request = cast(models.HrisTimeOffRequestsAllRequest, request) + request = models.HrisTimeOffRequestsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.TimeOffRequestsFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -52,6 +74,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -85,10 +108,32 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.HrisTimeOffRequestsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetTimeOffRequestsResponse + return models.HrisTimeOffRequestsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetTimeOffRequestsResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -113,7 +158,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.HrisTimeOffRequestsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -127,22 +177,35 @@ def list( async def list_async( self, *, - request: Union[ - models.HrisTimeOffRequestsAllRequest, - models.HrisTimeOffRequestsAllRequestTypedDict, - ] = models.HrisTimeOffRequestsAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.TimeOffRequestsFilter, models.TimeOffRequestsFilterTypedDict] + ] = None, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.HrisTimeOffRequestsAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.HrisTimeOffRequestsAllResponse]: r"""List Time Off Requests List Time Off Requests - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param filter_: Apply filters + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -152,9 +215,17 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisTimeOffRequestsAllRequest) - request = cast(models.HrisTimeOffRequestsAllRequest, request) + request = models.HrisTimeOffRequestsAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.TimeOffRequestsFilter] + ), + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -167,6 +238,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -200,10 +272,32 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.HrisTimeOffRequestsAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetTimeOffRequestsResponse + return models.HrisTimeOffRequestsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetTimeOffRequestsResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -228,7 +322,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.HrisTimeOffRequestsAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -242,25 +341,55 @@ async def list_async( def create( self, *, - time_off_request: Union[ - models.TimeOffRequestInput, models.TimeOffRequestInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + employee_id: OptionalNullable[str] = UNSET, + policy_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.TimeOffRequestStatusStatus] = UNSET, + description: OptionalNullable[str] = UNSET, + start_date: OptionalNullable[str] = UNSET, + end_date: OptionalNullable[str] = UNSET, + request_date: OptionalNullable[str] = UNSET, + request_type: OptionalNullable[models.RequestType] = UNSET, + approval_date: OptionalNullable[str] = UNSET, + units: OptionalNullable[models.Units] = UNSET, + amount: OptionalNullable[float] = UNSET, + day_part: OptionalNullable[str] = UNSET, + notes: Optional[Union[models.NotesModel, models.NotesModelTypedDict]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + policy_type: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisTimeOffRequestsAddResponse: r"""Create Time Off Request Create Time Off Request - :param time_off_request: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param employee_id: ID of the employee + :param policy_id: ID of the policy + :param status: The status of the time off request. + :param description: Description of the time off request. + :param start_date: The start date of the time off request. + :param end_date: The end date of the time off request. + :param request_date: The date the request was made. + :param request_type: The type of request + :param approval_date: The date the request was approved + :param units: The unit of time off requested. Possible values include: `hours`, `days`, or `other`. + :param amount: The amount of time off requested. + :param day_part: The day part of the time off request. + :param notes: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param policy_type: The policy type of the time off request :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -273,8 +402,24 @@ def create( request = models.HrisTimeOffRequestsAddRequest( raw=raw, service_id=service_id, - time_off_request=utils.get_pydantic_model( - time_off_request, models.TimeOffRequestInput + time_off_request=models.TimeOffRequestInput( + employee_id=employee_id, + policy_id=policy_id, + status=status, + description=description, + start_date=start_date, + end_date=end_date, + request_date=request_date, + request_type=request_type, + approval_date=approval_date, + units=units, + amount=amount, + day_part=day_part, + notes=utils.get_pydantic_model(notes, Optional[models.NotesModel]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + policy_type=policy_type, ), ) @@ -289,6 +434,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -371,25 +517,55 @@ def create( async def create_async( self, *, - time_off_request: Union[ - models.TimeOffRequestInput, models.TimeOffRequestInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + employee_id: OptionalNullable[str] = UNSET, + policy_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.TimeOffRequestStatusStatus] = UNSET, + description: OptionalNullable[str] = UNSET, + start_date: OptionalNullable[str] = UNSET, + end_date: OptionalNullable[str] = UNSET, + request_date: OptionalNullable[str] = UNSET, + request_type: OptionalNullable[models.RequestType] = UNSET, + approval_date: OptionalNullable[str] = UNSET, + units: OptionalNullable[models.Units] = UNSET, + amount: OptionalNullable[float] = UNSET, + day_part: OptionalNullable[str] = UNSET, + notes: Optional[Union[models.NotesModel, models.NotesModelTypedDict]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + policy_type: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisTimeOffRequestsAddResponse: r"""Create Time Off Request Create Time Off Request - :param time_off_request: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param employee_id: ID of the employee + :param policy_id: ID of the policy + :param status: The status of the time off request. + :param description: Description of the time off request. + :param start_date: The start date of the time off request. + :param end_date: The end date of the time off request. + :param request_date: The date the request was made. + :param request_type: The type of request + :param approval_date: The date the request was approved + :param units: The unit of time off requested. Possible values include: `hours`, `days`, or `other`. + :param amount: The amount of time off requested. + :param day_part: The day part of the time off request. + :param notes: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param policy_type: The policy type of the time off request :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -402,8 +578,24 @@ async def create_async( request = models.HrisTimeOffRequestsAddRequest( raw=raw, service_id=service_id, - time_off_request=utils.get_pydantic_model( - time_off_request, models.TimeOffRequestInput + time_off_request=models.TimeOffRequestInput( + employee_id=employee_id, + policy_id=policy_id, + status=status, + description=description, + start_date=start_date, + end_date=end_date, + request_date=request_date, + request_type=request_type, + approval_date=approval_date, + units=units, + amount=amount, + day_part=day_part, + notes=utils.get_pydantic_model(notes, Optional[models.NotesModel]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + policy_type=policy_type, ), ) @@ -418,6 +610,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -500,22 +693,29 @@ async def create_async( def get( self, *, - request: Union[ - models.HrisTimeOffRequestsOneRequest, - models.HrisTimeOffRequestsOneRequestTypedDict, - ], + id: str, + employee_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisTimeOffRequestsOneResponse: r"""Get Time Off Request Get Time Off Request - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param employee_id: ID of the employee you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -525,9 +725,13 @@ def get( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisTimeOffRequestsOneRequest) - request = cast(models.HrisTimeOffRequestsOneRequest, request) + request = models.HrisTimeOffRequestsOneRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + employee_id=employee_id, + ) req = self.build_request( method="GET", @@ -540,6 +744,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -613,22 +818,29 @@ def get( async def get_async( self, *, - request: Union[ - models.HrisTimeOffRequestsOneRequest, - models.HrisTimeOffRequestsOneRequestTypedDict, - ], + id: str, + employee_id: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisTimeOffRequestsOneResponse: r"""Get Time Off Request Get Time Off Request - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param employee_id: ID of the employee you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -638,9 +850,13 @@ async def get_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisTimeOffRequestsOneRequest) - request = cast(models.HrisTimeOffRequestsOneRequest, request) + request = models.HrisTimeOffRequestsOneRequest( + id=id, + service_id=service_id, + raw=raw, + fields=fields, + employee_id=employee_id, + ) req = self.build_request_async( method="GET", @@ -653,6 +869,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -726,22 +943,59 @@ async def get_async( def update( self, *, - request: Union[ - models.HrisTimeOffRequestsUpdateRequest, - models.HrisTimeOffRequestsUpdateRequestTypedDict, - ], + id: str, + employee_id_param: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + employee_id: OptionalNullable[str] = UNSET, + policy_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.TimeOffRequestStatusStatus] = UNSET, + description: OptionalNullable[str] = UNSET, + start_date: OptionalNullable[str] = UNSET, + end_date: OptionalNullable[str] = UNSET, + request_date: OptionalNullable[str] = UNSET, + request_type: OptionalNullable[models.RequestType] = UNSET, + approval_date: OptionalNullable[str] = UNSET, + units: OptionalNullable[models.Units] = UNSET, + amount: OptionalNullable[float] = UNSET, + day_part: OptionalNullable[str] = UNSET, + notes: Optional[Union[models.NotesModel, models.NotesModelTypedDict]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + policy_type: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisTimeOffRequestsUpdateResponse: r"""Update Time Off Request Update Time Off Request - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param employee_id_param: ID of the employee you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param employee_id: ID of the employee + :param policy_id: ID of the policy + :param status: The status of the time off request. + :param description: Description of the time off request. + :param start_date: The start date of the time off request. + :param end_date: The end date of the time off request. + :param request_date: The date the request was made. + :param request_type: The type of request + :param approval_date: The date the request was approved + :param units: The unit of time off requested. Possible values include: `hours`, `days`, or `other`. + :param amount: The amount of time off requested. + :param day_part: The day part of the time off request. + :param notes: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param policy_type: The policy type of the time off request :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -751,9 +1005,31 @@ def update( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisTimeOffRequestsUpdateRequest) - request = cast(models.HrisTimeOffRequestsUpdateRequest, request) + request = models.HrisTimeOffRequestsUpdateRequest( + id=id, + service_id=service_id, + raw=raw, + employee_id_param=employee_id_param, + time_off_request=models.TimeOffRequestInput( + employee_id=employee_id, + policy_id=policy_id, + status=status, + description=description, + start_date=start_date, + end_date=end_date, + request_date=request_date, + request_type=request_type, + approval_date=approval_date, + units=units, + amount=amount, + day_part=day_part, + notes=utils.get_pydantic_model(notes, Optional[models.NotesModel]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + policy_type=policy_type, + ), + ) req = self.build_request( method="PATCH", @@ -766,6 +1042,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -848,22 +1125,59 @@ def update( async def update_async( self, *, - request: Union[ - models.HrisTimeOffRequestsUpdateRequest, - models.HrisTimeOffRequestsUpdateRequestTypedDict, - ], + id: str, + employee_id_param: str, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + employee_id: OptionalNullable[str] = UNSET, + policy_id: OptionalNullable[str] = UNSET, + status: OptionalNullable[models.TimeOffRequestStatusStatus] = UNSET, + description: OptionalNullable[str] = UNSET, + start_date: OptionalNullable[str] = UNSET, + end_date: OptionalNullable[str] = UNSET, + request_date: OptionalNullable[str] = UNSET, + request_type: OptionalNullable[models.RequestType] = UNSET, + approval_date: OptionalNullable[str] = UNSET, + units: OptionalNullable[models.Units] = UNSET, + amount: OptionalNullable[float] = UNSET, + day_part: OptionalNullable[str] = UNSET, + notes: Optional[Union[models.NotesModel, models.NotesModelTypedDict]] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + policy_type: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisTimeOffRequestsUpdateResponse: r"""Update Time Off Request Update Time Off Request - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param employee_id_param: ID of the employee you are acting upon. + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param raw: Include raw response. Mostly used for debugging purposes + :param employee_id: ID of the employee + :param policy_id: ID of the policy + :param status: The status of the time off request. + :param description: Description of the time off request. + :param start_date: The start date of the time off request. + :param end_date: The end date of the time off request. + :param request_date: The date the request was made. + :param request_type: The type of request + :param approval_date: The date the request was approved + :param units: The unit of time off requested. Possible values include: `hours`, `days`, or `other`. + :param amount: The amount of time off requested. + :param day_part: The day part of the time off request. + :param notes: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param policy_type: The policy type of the time off request :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -873,9 +1187,31 @@ async def update_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.HrisTimeOffRequestsUpdateRequest) - request = cast(models.HrisTimeOffRequestsUpdateRequest, request) + request = models.HrisTimeOffRequestsUpdateRequest( + id=id, + service_id=service_id, + raw=raw, + employee_id_param=employee_id_param, + time_off_request=models.TimeOffRequestInput( + employee_id=employee_id, + policy_id=policy_id, + status=status, + description=description, + start_date=start_date, + end_date=end_date, + request_date=request_date, + request_type=request_type, + approval_date=approval_date, + units=units, + amount=amount, + day_part=day_part, + notes=utils.get_pydantic_model(notes, Optional[models.NotesModel]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + policy_type=policy_type, + ), + ) req = self.build_request_async( method="PATCH", @@ -888,6 +1224,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -977,6 +1314,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisTimeOffRequestsDeleteResponse: r"""Delete Time Off Request @@ -989,6 +1327,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1016,6 +1355,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1098,6 +1438,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.HrisTimeOffRequestsDeleteResponse: r"""Delete Time Off Request @@ -1110,6 +1451,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1137,6 +1479,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.HrisTimeOffRequestsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/trackingcategories.py b/src/apideck_unify/trackingcategories.py index 67f398d7..09565cf2 100644 --- a/src/apideck_unify/trackingcategories.py +++ b/src/apideck_unify/trackingcategories.py @@ -3,31 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class TrackingCategories(BaseSDK): def list( self, *, - request: Union[ - models.AccountingTrackingCategoriesAllRequest, - models.AccountingTrackingCategoriesAllRequestTypedDict, - ] = models.AccountingTrackingCategoriesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingTrackingCategoriesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingTrackingCategoriesAllResponse]: r"""List Tracking Categories List Tracking Categories - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,11 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingTrackingCategoriesAllRequest - ) - request = cast(models.AccountingTrackingCategoriesAllRequest, request) + request = models.AccountingTrackingCategoriesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -54,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -87,10 +101,31 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingTrackingCategoriesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetTrackingCategoriesResponse + return models.AccountingTrackingCategoriesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetTrackingCategoriesResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -115,7 +150,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingTrackingCategoriesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -129,22 +169,31 @@ def list( async def list_async( self, *, - request: Union[ - models.AccountingTrackingCategoriesAllRequest, - models.AccountingTrackingCategoriesAllRequestTypedDict, - ] = models.AccountingTrackingCategoriesAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.AccountingTrackingCategoriesAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.AccountingTrackingCategoriesAllResponse]: r"""List Tracking Categories List Tracking Categories - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -154,11 +203,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.AccountingTrackingCategoriesAllRequest - ) - request = cast(models.AccountingTrackingCategoriesAllRequest, request) + request = models.AccountingTrackingCategoriesAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -171,6 +223,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -204,10 +257,31 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.AccountingTrackingCategoriesAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json( - http_res.text, models.GetTrackingCategoriesResponse + return models.AccountingTrackingCategoriesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.GetTrackingCategoriesResponse + ), + next=next_func, ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) @@ -232,7 +306,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.AccountingTrackingCategoriesAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -246,25 +325,44 @@ async def list_async( def create( self, *, - tracking_category: Union[ - models.TrackingCategoryInput, models.TrackingCategoryInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + code: OptionalNullable[str] = UNSET, + status: Optional[models.TrackingCategoryStatus] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.TrackingCategorySubsidiaries], + List[models.TrackingCategorySubsidiariesTypedDict], + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTrackingCategoriesAddResponse: r"""Create Tracking Category Create Tracking Category - :param tracking_category: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: A unique identifier for an object. + :param name: The name of the tracking category. + :param code: The code of the tracking category. + :param status: Based on the status some functionality is enabled or disabled. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiaries: The subsidiaries the account belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -277,8 +375,18 @@ def create( request = models.AccountingTrackingCategoriesAddRequest( raw=raw, service_id=service_id, - tracking_category=utils.get_pydantic_model( - tracking_category, models.TrackingCategoryInput + tracking_category=models.TrackingCategoryInput( + parent_id=parent_id, + name=name, + code=code, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.TrackingCategorySubsidiaries]] + ), ), ) @@ -293,6 +401,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -375,25 +484,44 @@ def create( async def create_async( self, *, - tracking_category: Union[ - models.TrackingCategoryInput, models.TrackingCategoryInputTypedDict - ], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + code: OptionalNullable[str] = UNSET, + status: Optional[models.TrackingCategoryStatus] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.TrackingCategorySubsidiaries], + List[models.TrackingCategorySubsidiariesTypedDict], + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTrackingCategoriesAddResponse: r"""Create Tracking Category Create Tracking Category - :param tracking_category: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: A unique identifier for an object. + :param name: The name of the tracking category. + :param code: The code of the tracking category. + :param status: Based on the status some functionality is enabled or disabled. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiaries: The subsidiaries the account belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -406,8 +534,18 @@ async def create_async( request = models.AccountingTrackingCategoriesAddRequest( raw=raw, service_id=service_id, - tracking_category=utils.get_pydantic_model( - tracking_category, models.TrackingCategoryInput + tracking_category=models.TrackingCategoryInput( + parent_id=parent_id, + name=name, + code=code, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.TrackingCategorySubsidiaries]] + ), ), ) @@ -422,6 +560,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -511,6 +650,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTrackingCategoriesOneResponse: r"""Get Tracking Category @@ -523,6 +663,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -550,6 +691,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -632,6 +774,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTrackingCategoriesOneResponse: r"""Get Tracking Category @@ -644,6 +787,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -671,6 +815,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -747,26 +892,45 @@ def update( self, *, id: str, - tracking_category: Union[ - models.TrackingCategoryInput, models.TrackingCategoryInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + code: OptionalNullable[str] = UNSET, + status: Optional[models.TrackingCategoryStatus] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.TrackingCategorySubsidiaries], + List[models.TrackingCategorySubsidiariesTypedDict], + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTrackingCategoriesUpdateResponse: r"""Update Tracking Category Update Tracking Category :param id: ID of the record you are acting upon. - :param tracking_category: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: A unique identifier for an object. + :param name: The name of the tracking category. + :param code: The code of the tracking category. + :param status: Based on the status some functionality is enabled or disabled. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiaries: The subsidiaries the account belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -780,8 +944,18 @@ def update( id=id, service_id=service_id, raw=raw, - tracking_category=utils.get_pydantic_model( - tracking_category, models.TrackingCategoryInput + tracking_category=models.TrackingCategoryInput( + parent_id=parent_id, + name=name, + code=code, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.TrackingCategorySubsidiaries]] + ), ), ) @@ -796,6 +970,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -879,26 +1054,45 @@ async def update_async( self, *, id: str, - tracking_category: Union[ - models.TrackingCategoryInput, models.TrackingCategoryInputTypedDict - ], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + name: Optional[str] = None, + code: OptionalNullable[str] = UNSET, + status: Optional[models.TrackingCategoryStatus] = None, + row_version: OptionalNullable[str] = UNSET, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, + subsidiaries: Optional[ + Union[ + List[models.TrackingCategorySubsidiaries], + List[models.TrackingCategorySubsidiariesTypedDict], + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTrackingCategoriesUpdateResponse: r"""Update Tracking Category Update Tracking Category :param id: ID of the record you are acting upon. - :param tracking_category: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: A unique identifier for an object. + :param name: The name of the tracking category. + :param code: The code of the tracking category. + :param status: Based on the status some functionality is enabled or disabled. + :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. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + :param subsidiaries: The subsidiaries the account belongs to. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -912,8 +1106,18 @@ async def update_async( id=id, service_id=service_id, raw=raw, - tracking_category=utils.get_pydantic_model( - tracking_category, models.TrackingCategoryInput + tracking_category=models.TrackingCategoryInput( + parent_id=parent_id, + name=name, + code=code, + status=status, + row_version=row_version, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + subsidiaries=utils.get_pydantic_model( + subsidiaries, Optional[List[models.TrackingCategorySubsidiaries]] + ), ), ) @@ -928,6 +1132,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1016,6 +1221,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTrackingCategoriesDeleteResponse: r"""Delete Tracking Category @@ -1027,6 +1233,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1053,6 +1260,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1134,6 +1342,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.AccountingTrackingCategoriesDeleteResponse: r"""Delete Tracking Category @@ -1145,6 +1354,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1171,6 +1381,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.AccountingTrackingCategoriesDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/uploadsessions.py b/src/apideck_unify/uploadsessions.py index 956b2296..7a92d524 100644 --- a/src/apideck_unify/uploadsessions.py +++ b/src/apideck_unify/uploadsessions.py @@ -3,35 +3,44 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import Nullable, OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from typing import Any, List, Mapping, Optional, Union class UploadSessions(BaseSDK): def create( self, *, - create_upload_session_request: Union[ - models.CreateUploadSessionRequest, - models.CreateUploadSessionRequestTypedDict, - ], + name: str, + parent_folder_id: str, + size: Nullable[int], raw: Optional[bool] = False, service_id: Optional[str] = None, + drive_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageUploadSessionsAddResponse: r"""Start Upload Session Start an Upload Session. Upload sessions are used to upload large files, use the [Upload File](#operation/filesUpload) endpoint to upload smaller files (up to 100MB). Note that the base URL is upload.apideck.com instead of unify.apideck.com. For more information on uploads, refer to the [file upload guide](/guides/file-upload). - :param create_upload_session_request: + :param name: The name of the file. + :param parent_folder_id: 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. + :param size: The size of the file in bytes :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param drive_id: ID of the drive to upload to. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -46,8 +55,14 @@ def create( request = models.FileStorageUploadSessionsAddRequest( raw=raw, service_id=service_id, - create_upload_session_request=utils.get_pydantic_model( - create_upload_session_request, models.CreateUploadSessionRequest + create_upload_session_request=models.CreateUploadSessionRequest( + name=name, + parent_folder_id=parent_folder_id, + drive_id=drive_id, + size=size, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -62,6 +77,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageUploadSessionsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -144,26 +160,35 @@ def create( async def create_async( self, *, - create_upload_session_request: Union[ - models.CreateUploadSessionRequest, - models.CreateUploadSessionRequestTypedDict, - ], + name: str, + parent_folder_id: str, + size: Nullable[int], raw: Optional[bool] = False, service_id: Optional[str] = None, + drive_id: Optional[str] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageUploadSessionsAddResponse: r"""Start Upload Session Start an Upload Session. Upload sessions are used to upload large files, use the [Upload File](#operation/filesUpload) endpoint to upload smaller files (up to 100MB). Note that the base URL is upload.apideck.com instead of unify.apideck.com. For more information on uploads, refer to the [file upload guide](/guides/file-upload). - :param create_upload_session_request: + :param name: The name of the file. + :param parent_folder_id: 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. + :param size: The size of the file in bytes :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param drive_id: ID of the drive to upload to. + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -178,8 +203,14 @@ async def create_async( request = models.FileStorageUploadSessionsAddRequest( raw=raw, service_id=service_id, - create_upload_session_request=utils.get_pydantic_model( - create_upload_session_request, models.CreateUploadSessionRequest + create_upload_session_request=models.CreateUploadSessionRequest( + name=name, + parent_folder_id=parent_folder_id, + drive_id=drive_id, + size=size, + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), ), ) @@ -194,6 +225,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageUploadSessionsAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -283,6 +315,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageUploadSessionsOneResponse: r"""Get Upload Session @@ -295,6 +328,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -324,6 +358,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageUploadSessionsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -404,6 +439,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageUploadSessionsOneResponse: r"""Get Upload Session @@ -416,6 +452,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -445,6 +482,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageUploadSessionsOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -524,6 +562,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageUploadSessionsDeleteResponse: r"""Abort Upload Session @@ -535,6 +574,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -561,6 +601,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageUploadSessionsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -642,6 +683,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageUploadSessionsDeleteResponse: r"""Abort Upload Session @@ -653,6 +695,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -679,6 +722,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageUploadSessionsDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -754,22 +798,34 @@ async def delete_async( def finish( self, *, - request: Union[ - models.FileStorageUploadSessionsFinishRequest, - models.FileStorageUploadSessionsFinishRequestTypedDict, - ], + id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + digest: Optional[str] = None, + request_body: Optional[ + Union[ + models.FileStorageUploadSessionsFinishRequestBody, + models.FileStorageUploadSessionsFinishRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageUploadSessionsFinishResponse: r"""Finish Upload Session Finish Upload Session. Only call this endpoint after all File parts have been uploaded to [Upload part of File](#operation/uploadSessionsUpload). Note that the base URL is upload.apideck.com instead of unify.apideck.com. For more information on uploads, refer to the [file upload guide](/guides/file-upload). - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param digest: 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) + :param request_body: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -781,11 +837,16 @@ def finish( else: base_url = models.FILE_STORAGE_UPLOAD_SESSIONS_FINISH_OP_SERVERS[0] - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.FileStorageUploadSessionsFinishRequest - ) - request = cast(models.FileStorageUploadSessionsFinishRequest, request) + request = models.FileStorageUploadSessionsFinishRequest( + id=id, + raw=raw, + service_id=service_id, + digest=digest, + request_body=utils.get_pydantic_model( + request_body, + Optional[models.FileStorageUploadSessionsFinishRequestBody], + ), + ) req = self.build_request( method="POST", @@ -798,6 +859,7 @@ def finish( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageUploadSessionsFinishGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -878,22 +940,34 @@ def finish( async def finish_async( self, *, - request: Union[ - models.FileStorageUploadSessionsFinishRequest, - models.FileStorageUploadSessionsFinishRequestTypedDict, - ], + id: str, + raw: Optional[bool] = False, + service_id: Optional[str] = None, + digest: Optional[str] = None, + request_body: Optional[ + Union[ + models.FileStorageUploadSessionsFinishRequestBody, + models.FileStorageUploadSessionsFinishRequestBodyTypedDict, + ] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.FileStorageUploadSessionsFinishResponse: r"""Finish Upload Session Finish Upload Session. Only call this endpoint after all File parts have been uploaded to [Upload part of File](#operation/uploadSessionsUpload). Note that the base URL is upload.apideck.com instead of unify.apideck.com. For more information on uploads, refer to the [file upload guide](/guides/file-upload). - :param request: The request object to send. + :param id: ID of the record you are acting upon. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param digest: 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) + :param request_body: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -905,11 +979,16 @@ async def finish_async( else: base_url = models.FILE_STORAGE_UPLOAD_SESSIONS_FINISH_OP_SERVERS[0] - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, models.FileStorageUploadSessionsFinishRequest - ) - request = cast(models.FileStorageUploadSessionsFinishRequest, request) + request = models.FileStorageUploadSessionsFinishRequest( + id=id, + raw=raw, + service_id=service_id, + digest=digest, + request_body=utils.get_pydantic_model( + request_body, + Optional[models.FileStorageUploadSessionsFinishRequestBody], + ), + ) req = self.build_request_async( method="POST", @@ -922,6 +1001,7 @@ async def finish_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.FileStorageUploadSessionsFinishGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/users.py b/src/apideck_unify/users.py index da7f7c56..f9bde8cd 100644 --- a/src/apideck_unify/users.py +++ b/src/apideck_unify/users.py @@ -3,30 +3,41 @@ from .basesdk import BaseSDK from apideck_unify import models, utils from apideck_unify._hooks import HookContext -from apideck_unify.types import BaseModel, OptionalNullable, UNSET +from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union, cast +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union class Users(BaseSDK): def list( self, *, - request: Union[ - models.CrmUsersAllRequest, models.CrmUsersAllRequestTypedDict - ] = models.CrmUsersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmUsersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmUsersAllResponse]: r"""List users List users - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -36,9 +47,14 @@ def list( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmUsersAllRequest) - request = cast(models.CrmUsersAllRequest, request) + request = models.CrmUsersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request( method="GET", @@ -51,6 +67,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -84,9 +101,30 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmUsersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetUsersResponse) + return models.CrmUsersAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetUsersResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +148,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmUsersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -124,21 +167,31 @@ def list( async def list_async( self, *, - request: Union[ - models.CrmUsersAllRequest, models.CrmUsersAllRequestTypedDict - ] = models.CrmUsersAllRequest(), + raw: Optional[bool] = False, + service_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + pass_through: Optional[Dict[str, Any]] = None, + fields: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.CrmUsersAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.CrmUsersAllResponse]: r"""List users List users - :param request: The request object to send. + :param raw: Include raw response. Mostly used for debugging purposes + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param cursor: Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. + :param limit: Number of results to return. Minimum 1, Maximum 200, Default 20 + :param pass_through: Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads + :param fields: 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. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -148,9 +201,14 @@ async def list_async( if server_url is not None: base_url = server_url - if not isinstance(request, BaseModel): - request = utils.unmarshal(request, models.CrmUsersAllRequest) - request = cast(models.CrmUsersAllRequest, request) + request = models.CrmUsersAllRequest( + raw=raw, + service_id=service_id, + cursor=cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + ) req = self.build_request_async( method="GET", @@ -163,6 +221,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersAllGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -196,9 +255,30 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.CrmUsersAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + raw=raw, + service_id=service_id, + cursor=next_cursor, + limit=limit, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetUsersResponse) + return models.CrmUsersAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetUsersResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +302,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.CrmUsersAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,23 +321,65 @@ async def list_async( def create( self, *, - user: Union[models.UserInput, models.UserInputTypedDict], + emails: Union[List[models.Email], List[models.EmailTypedDict]], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + username: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + division: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + employee_number: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + password: OptionalNullable[str] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmUsersAddResponse: r"""Create user Create user - :param user: + :param emails: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: The parent user id + :param username: The username of the user + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param title: The job title of the person. + :param division: The division the person is currently in. Usually a collection of departments or teams or regions. + :param department: The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. + :param company_name: The name of the company. + :param employee_number: An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. + :param description: A description of the object. + :param image: The URL of the user's avatar + :param language: language code according to ISO 639-1. For the United States - EN + :param status: The status of the user + :param password: The password of the user + :param addresses: + :param phone_numbers: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -265,7 +392,32 @@ def create( request = models.CrmUsersAddRequest( raw=raw, service_id=service_id, - user=utils.get_pydantic_model(user, models.UserInput), + user=models.UserInput( + parent_id=parent_id, + username=username, + first_name=first_name, + last_name=last_name, + title=title, + division=division, + department=department, + company_name=company_name, + employee_number=employee_number, + description=description, + image=image, + language=language, + status=status, + password=password, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, List[models.Email]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -279,6 +431,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -355,23 +508,65 @@ def create( async def create_async( self, *, - user: Union[models.UserInput, models.UserInputTypedDict], + emails: Union[List[models.Email], List[models.EmailTypedDict]], raw: Optional[bool] = False, service_id: Optional[str] = None, + parent_id: OptionalNullable[str] = UNSET, + username: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + division: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + employee_number: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + password: OptionalNullable[str] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmUsersAddResponse: r"""Create user Create user - :param user: + :param emails: :param raw: Include raw response. Mostly used for debugging purposes :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param parent_id: The parent user id + :param username: The username of the user + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param title: The job title of the person. + :param division: The division the person is currently in. Usually a collection of departments or teams or regions. + :param department: The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. + :param company_name: The name of the company. + :param employee_number: An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. + :param description: A description of the object. + :param image: The URL of the user's avatar + :param language: language code according to ISO 639-1. For the United States - EN + :param status: The status of the user + :param password: The password of the user + :param addresses: + :param phone_numbers: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -384,7 +579,32 @@ async def create_async( request = models.CrmUsersAddRequest( raw=raw, service_id=service_id, - user=utils.get_pydantic_model(user, models.UserInput), + user=models.UserInput( + parent_id=parent_id, + username=username, + first_name=first_name, + last_name=last_name, + title=title, + division=division, + department=department, + company_name=company_name, + employee_number=employee_number, + description=description, + image=image, + language=language, + status=status, + password=password, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, List[models.Email]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -398,6 +618,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersAddGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -481,6 +702,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmUsersOneResponse: r"""Get user @@ -493,6 +715,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -520,6 +743,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -600,6 +824,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmUsersOneResponse: r"""Get user @@ -612,6 +837,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -639,6 +865,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersOneGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -713,24 +940,66 @@ def update( self, *, id: str, - user: Union[models.UserInput, models.UserInputTypedDict], + emails: Union[List[models.Email], List[models.EmailTypedDict]], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + username: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + division: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + employee_number: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + password: OptionalNullable[str] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmUsersUpdateResponse: r"""Update user Update user :param id: ID of the record you are acting upon. - :param user: + :param emails: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: The parent user id + :param username: The username of the user + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param title: The job title of the person. + :param division: The division the person is currently in. Usually a collection of departments or teams or regions. + :param department: The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. + :param company_name: The name of the company. + :param employee_number: An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. + :param description: A description of the object. + :param image: The URL of the user's avatar + :param language: language code according to ISO 639-1. For the United States - EN + :param status: The status of the user + :param password: The password of the user + :param addresses: + :param phone_numbers: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -744,7 +1013,32 @@ def update( id=id, service_id=service_id, raw=raw, - user=utils.get_pydantic_model(user, models.UserInput), + user=models.UserInput( + parent_id=parent_id, + username=username, + first_name=first_name, + last_name=last_name, + title=title, + division=division, + department=department, + company_name=company_name, + employee_number=employee_number, + description=description, + image=image, + language=language, + status=status, + password=password, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, List[models.Email]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request( @@ -758,6 +1052,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -835,24 +1130,66 @@ async def update_async( self, *, id: str, - user: Union[models.UserInput, models.UserInputTypedDict], + emails: Union[List[models.Email], List[models.EmailTypedDict]], service_id: Optional[str] = None, raw: Optional[bool] = False, + parent_id: OptionalNullable[str] = UNSET, + username: OptionalNullable[str] = UNSET, + first_name: OptionalNullable[str] = UNSET, + last_name: OptionalNullable[str] = UNSET, + title: OptionalNullable[str] = UNSET, + division: OptionalNullable[str] = UNSET, + department: OptionalNullable[str] = UNSET, + company_name: OptionalNullable[str] = UNSET, + employee_number: OptionalNullable[str] = UNSET, + description: OptionalNullable[str] = UNSET, + image: OptionalNullable[str] = UNSET, + language: OptionalNullable[str] = UNSET, + status: OptionalNullable[str] = UNSET, + password: OptionalNullable[str] = UNSET, + addresses: Optional[ + Union[List[models.Address], List[models.AddressTypedDict]] + ] = None, + phone_numbers: Optional[ + Union[List[models.PhoneNumber], List[models.PhoneNumberTypedDict]] + ] = None, + pass_through: Optional[ + Union[List[models.PassThroughBody], List[models.PassThroughBodyTypedDict]] + ] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmUsersUpdateResponse: r"""Update user Update user :param id: ID of the record you are acting upon. - :param user: + :param emails: :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. :param raw: Include raw response. Mostly used for debugging purposes + :param parent_id: The parent user id + :param username: The username of the user + :param first_name: The first name of the person. + :param last_name: The last name of the person. + :param title: The job title of the person. + :param division: The division the person is currently in. Usually a collection of departments or teams or regions. + :param department: The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. + :param company_name: The name of the company. + :param employee_number: An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. + :param description: A description of the object. + :param image: The URL of the user's avatar + :param language: language code according to ISO 639-1. For the United States - EN + :param status: The status of the user + :param password: The password of the user + :param addresses: + :param phone_numbers: + :param pass_through: The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -866,7 +1203,32 @@ async def update_async( id=id, service_id=service_id, raw=raw, - user=utils.get_pydantic_model(user, models.UserInput), + user=models.UserInput( + parent_id=parent_id, + username=username, + first_name=first_name, + last_name=last_name, + title=title, + division=division, + department=department, + company_name=company_name, + employee_number=employee_number, + description=description, + image=image, + language=language, + status=status, + password=password, + addresses=utils.get_pydantic_model( + addresses, Optional[List[models.Address]] + ), + phone_numbers=utils.get_pydantic_model( + phone_numbers, Optional[List[models.PhoneNumber]] + ), + emails=utils.get_pydantic_model(emails, List[models.Email]), + pass_through=utils.get_pydantic_model( + pass_through, Optional[List[models.PassThroughBody]] + ), + ), ) req = self.build_request_async( @@ -880,6 +1242,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersUpdateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -962,6 +1325,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmUsersDeleteResponse: r"""Delete user @@ -973,6 +1337,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -999,6 +1364,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -1078,6 +1444,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.CrmUsersDeleteResponse: r"""Delete user @@ -1089,6 +1456,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1115,6 +1483,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.CrmUsersDeleteGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/utils/forms.py b/src/apideck_unify/utils/forms.py index 9f5a731e..0472aba8 100644 --- a/src/apideck_unify/utils/forms.py +++ b/src/apideck_unify/utils/forms.py @@ -109,13 +109,12 @@ def serialize_multipart_form( if not field_metadata: continue - f_name = field.alias if field.alias is not None else name + f_name = field.alias if field.alias else name if field_metadata.file: file_fields: Dict[str, FieldInfo] = val.__class__.model_fields file_name = "" - field_name = "" content = None content_type = None @@ -131,20 +130,15 @@ def serialize_multipart_form( elif file_field_name == "content_type": content_type = getattr(val, file_field_name, None) else: - field_name = ( - file_field.alias - if file_field.alias is not None - else file_field_name - ) file_name = getattr(val, file_field_name) - if field_name == "" or file_name == "" or content is None: + if file_name == "" or content is None: raise ValueError("invalid multipart/form-data file") if content_type is not None: - files[field_name] = (file_name, content, content_type) + files[f_name] = (file_name, content, content_type) else: - files[field_name] = (file_name, content) + files[f_name] = (file_name, content) elif field_metadata.json: files[f_name] = ( None, diff --git a/src/apideck_unify/validateconnection.py b/src/apideck_unify/validateconnection.py index d7d07707..bb08592c 100644 --- a/src/apideck_unify/validateconnection.py +++ b/src/apideck_unify/validateconnection.py @@ -5,7 +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 typing import Any, Optional, Union +from typing import Any, Mapping, Optional, Union class ValidateConnection(BaseSDK): @@ -23,6 +23,7 @@ def state( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultValidateConnectionStateResponse: r"""Validate Connection State @@ -40,6 +41,7 @@ def state( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -68,6 +70,7 @@ def state( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultValidateConnectionStateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, @@ -161,6 +164,7 @@ async def state_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.VaultValidateConnectionStateResponse: r"""Validate Connection State @@ -178,6 +182,7 @@ async def state_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -206,6 +211,7 @@ async def state_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.VaultValidateConnectionStateGlobals( consumer_id=self.sdk_configuration.globals.consumer_id, app_id=self.sdk_configuration.globals.app_id, diff --git a/src/apideck_unify/webhooks.py b/src/apideck_unify/webhooks.py index 392f1b0b..d435ffbb 100644 --- a/src/apideck_unify/webhooks.py +++ b/src/apideck_unify/webhooks.py @@ -5,7 +5,8 @@ from apideck_unify._hooks import HookContext from apideck_unify.types import OptionalNullable, UNSET from apideck_unify.utils import get_security_from_env -from typing import Any, Optional, Union +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional class Webhooks(BaseSDK): @@ -17,7 +18,8 @@ def list( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.WebhookWebhooksAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.WebhookWebhooksAllResponse]: r"""List webhook subscriptions List all webhook subscriptions @@ -27,6 +29,7 @@ def list( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -52,6 +55,7 @@ def list( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -84,9 +88,26 @@ def list( retry_config=retry_config, ) + def next_func() -> Optional[models.WebhookWebhooksAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetWebhooksResponse) + return models.WebhookWebhooksAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetWebhooksResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -110,7 +131,12 @@ def list( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.WebhookWebhooksAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = utils.stream_to_text(http_res) @@ -129,7 +155,8 @@ async def list_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, - ) -> models.WebhookWebhooksAllResponse: + http_headers: Optional[Mapping[str, str]] = None, + ) -> Optional[models.WebhookWebhooksAllResponse]: r"""List webhook subscriptions List all webhook subscriptions @@ -139,6 +166,7 @@ async def list_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -164,6 +192,7 @@ async def list_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksAllGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -196,9 +225,26 @@ async def list_async( retry_config=retry_config, ) + def next_func() -> Optional[models.WebhookWebhooksAllResponse]: + body = utils.unmarshal_json(http_res.text, Dict[Any, Any]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + next_cursor = next_cursor[0] + + return self.list( + cursor=next_cursor, + limit=limit, + retries=retries, + ) + data: Any = None if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.GetWebhooksResponse) + return models.WebhookWebhooksAllResponse( + result=utils.unmarshal_json(http_res.text, models.GetWebhooksResponse), + next=next_func, + ) if utils.match_response(http_res, "400", "application/json"): data = utils.unmarshal_json(http_res.text, models.BadRequestResponseData) raise models.BadRequestResponse(data=data) @@ -222,7 +268,12 @@ async def list_async( "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): - return utils.unmarshal_json(http_res.text, models.UnexpectedErrorResponse) + return models.WebhookWebhooksAllResponse( + result=utils.unmarshal_json( + http_res.text, models.UnexpectedErrorResponse + ), + next=next_func, + ) content_type = http_res.headers.get("Content-Type") http_res_text = await utils.stream_to_text_async(http_res) @@ -236,21 +287,29 @@ async def list_async( def create( self, *, - request: Union[ - models.CreateWebhookRequest, models.CreateWebhookRequestTypedDict - ], + unified_api: models.UnifiedAPIID, + status: models.Status, + delivery_url: str, + events: List[models.WebhookEventType], + description: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.WebhookWebhooksAddResponse: r"""Create webhook subscription Create a webhook subscription to receive events - :param request: The request object to send. + :param unified_api: Name of Apideck Unified API + :param status: The status of the webhook. + :param delivery_url: The delivery url of the webhook endpoint. + :param events: The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. + :param description: A description of the object. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -261,7 +320,11 @@ def create( base_url = server_url request = models.CreateWebhookRequest( - request=utils.get_pydantic_model(request, models.CreateWebhookRequest), + description=description, + unified_api=unified_api, + status=status, + delivery_url=delivery_url, + events=events, ) req = self.build_request( @@ -275,6 +338,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksAddGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -350,21 +414,29 @@ def create( async def create_async( self, *, - request: Union[ - models.CreateWebhookRequest, models.CreateWebhookRequestTypedDict - ], + unified_api: models.UnifiedAPIID, + status: models.Status, + delivery_url: str, + events: List[models.WebhookEventType], + description: OptionalNullable[str] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.WebhookWebhooksAddResponse: r"""Create webhook subscription Create a webhook subscription to receive events - :param request: The request object to send. + :param unified_api: Name of Apideck Unified API + :param status: The status of the webhook. + :param delivery_url: The delivery url of the webhook endpoint. + :param events: The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. + :param description: A description of the object. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -375,7 +447,11 @@ async def create_async( base_url = server_url request = models.CreateWebhookRequest( - request=utils.get_pydantic_model(request, models.CreateWebhookRequest), + description=description, + unified_api=unified_api, + status=status, + delivery_url=delivery_url, + events=events, ) req = self.build_request_async( @@ -389,6 +465,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksAddGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -468,6 +545,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.WebhookWebhooksOneResponse: r"""Get webhook subscription @@ -477,6 +555,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -501,6 +580,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -577,6 +657,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.WebhookWebhooksOneResponse: r"""Get webhook subscription @@ -586,6 +667,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -610,6 +692,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksOneGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -683,22 +766,28 @@ def update( self, *, id: str, - update_webhook_request: Union[ - models.UpdateWebhookRequest, models.UpdateWebhookRequestTypedDict - ], + description: OptionalNullable[str] = UNSET, + status: Optional[models.Status] = None, + delivery_url: Optional[str] = None, + events: Optional[List[models.WebhookEventType]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.WebhookWebhooksUpdateResponse: r"""Update webhook subscription Update a webhook subscription :param id: JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. - :param update_webhook_request: + :param description: A description of the object. + :param status: The status of the webhook. + :param delivery_url: The delivery url of the webhook endpoint. + :param events: The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -710,8 +799,11 @@ def update( request = models.WebhookWebhooksUpdateRequest( id=id, - update_webhook_request=utils.get_pydantic_model( - update_webhook_request, models.UpdateWebhookRequest + update_webhook_request=models.UpdateWebhookRequest( + description=description, + status=status, + delivery_url=delivery_url, + events=events, ), ) @@ -726,6 +818,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksUpdateGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -806,22 +899,28 @@ async def update_async( self, *, id: str, - update_webhook_request: Union[ - models.UpdateWebhookRequest, models.UpdateWebhookRequestTypedDict - ], + description: OptionalNullable[str] = UNSET, + status: Optional[models.Status] = None, + delivery_url: Optional[str] = None, + events: Optional[List[models.WebhookEventType]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.WebhookWebhooksUpdateResponse: r"""Update webhook subscription Update a webhook subscription :param id: JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. - :param update_webhook_request: + :param description: A description of the object. + :param status: The status of the webhook. + :param delivery_url: The delivery url of the webhook endpoint. + :param events: The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -833,8 +932,11 @@ async def update_async( request = models.WebhookWebhooksUpdateRequest( id=id, - update_webhook_request=utils.get_pydantic_model( - update_webhook_request, models.UpdateWebhookRequest + update_webhook_request=models.UpdateWebhookRequest( + description=description, + status=status, + delivery_url=delivery_url, + events=events, ), ) @@ -849,6 +951,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksUpdateGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -932,6 +1035,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.WebhookWebhooksDeleteResponse: r"""Delete webhook subscription @@ -941,6 +1045,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -965,6 +1070,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksDeleteGlobals( app_id=self.sdk_configuration.globals.app_id, ), @@ -1041,6 +1147,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> models.WebhookWebhooksDeleteResponse: r"""Delete webhook subscription @@ -1050,6 +1157,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1074,6 +1182,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, _globals=models.WebhookWebhooksDeleteGlobals( app_id=self.sdk_configuration.globals.app_id, ),