diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 1443b016..3439ddf4 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: fca0ac3a-5f4e-452c-bbc7-2311afa8da40 management: - docChecksum: 9f3555dd6bfbb134dd1c354d722d51cd - docVersion: 10.32.0 + docChecksum: 6fdf7373f856d44671ea5ee9e0032aa3 + docVersion: 10.34.0 speakeasyVersion: 1.656.1 generationVersion: 2.753.1 - releaseVersion: 0.36.0 - configChecksum: 1928e1a3a55bbe660fc9260c7d01431d + releaseVersion: 0.37.0 + configChecksum: 26e65832b6862f2be3dcdf586b138442 repoURL: https://github.com/apideck-libraries/sdk-python.git installationURL: https://github.com/apideck-libraries/sdk-python.git published: true @@ -446,6 +446,21 @@ generatedFiles: - docs/models/accountingrefundsupdateglobals.md - docs/models/accountingrefundsupdaterequest.md - docs/models/accountingrefundsupdateresponse.md + - docs/models/accountingsalesreceiptsaddglobals.md + - docs/models/accountingsalesreceiptsaddrequest.md + - docs/models/accountingsalesreceiptsaddresponse.md + - docs/models/accountingsalesreceiptsallglobals.md + - docs/models/accountingsalesreceiptsallrequest.md + - docs/models/accountingsalesreceiptsallresponse.md + - docs/models/accountingsalesreceiptsdeleteglobals.md + - docs/models/accountingsalesreceiptsdeleterequest.md + - docs/models/accountingsalesreceiptsdeleteresponse.md + - docs/models/accountingsalesreceiptsoneglobals.md + - docs/models/accountingsalesreceiptsonerequest.md + - docs/models/accountingsalesreceiptsoneresponse.md + - docs/models/accountingsalesreceiptsupdateglobals.md + - docs/models/accountingsalesreceiptsupdaterequest.md + - docs/models/accountingsalesreceiptsupdateresponse.md - docs/models/accountingsubsidiariesaddglobals.md - docs/models/accountingsubsidiariesaddrequest.md - docs/models/accountingsubsidiariesaddresponse.md @@ -790,6 +805,7 @@ generatedFiles: - docs/models/createpurchaseorderresponse.md - docs/models/createquoteresponse.md - docs/models/createrefundresponse.md + - docs/models/createsalesreceiptresponse.md - docs/models/createsessionresponse.md - docs/models/createsessionresponsedata.md - docs/models/createsharedlinkresponse.md @@ -1053,6 +1069,7 @@ generatedFiles: - docs/models/deletepurchaseorderresponse.md - docs/models/deletequoteresponse.md - docs/models/deleterefundresponse.md + - docs/models/deletesalesreceiptresponse.md - docs/models/deletesharedlinkresponse.md - docs/models/deletesubsidiaryresponse.md - docs/models/deletesupplierresponse.md @@ -1429,6 +1446,8 @@ generatedFiles: - docs/models/getquotesresponse.md - docs/models/getrefundresponse.md - docs/models/getrefundsresponse.md + - docs/models/getsalesreceiptresponse.md + - docs/models/getsalesreceiptsresponse.md - docs/models/getsharedlinkresponse.md - docs/models/getsharedlinksresponse.md - docs/models/getstoreresponse.md @@ -1820,6 +1839,11 @@ generatedFiles: - docs/models/responsibilitymatrix.md - docs/models/salary.md - docs/models/salesdetails.md + - docs/models/salesreceipt.md + - docs/models/salesreceiptinput.md + - docs/models/salesreceiptsfilter.md + - docs/models/salesreceiptssort.md + - docs/models/salesreceiptssortby.md - docs/models/schedule.md - docs/models/schedulestatus.md - docs/models/schema.md @@ -1973,6 +1997,7 @@ generatedFiles: - docs/models/updatepurchaseorderresponse.md - docs/models/updatequoteresponse.md - docs/models/updaterefundresponse.md + - docs/models/updatesalesreceiptresponse.md - docs/models/updatesharedlinkresponse.md - docs/models/updatesubsidiaryresponse.md - docs/models/updatesupplierresponse.md @@ -2185,6 +2210,7 @@ generatedFiles: - docs/sdks/purchaseorders/README.md - docs/sdks/quotes/README.md - docs/sdks/refunds/README.md + - docs/sdks/salesreceipts/README.md - docs/sdks/sessions/README.md - docs/sdks/sharedlinks/README.md - docs/sdks/stores/README.md @@ -2414,6 +2440,11 @@ generatedFiles: - src/apideck_unify/models/accounting_refundsdeleteop.py - src/apideck_unify/models/accounting_refundsoneop.py - src/apideck_unify/models/accounting_refundsupdateop.py + - src/apideck_unify/models/accounting_salesreceiptsaddop.py + - src/apideck_unify/models/accounting_salesreceiptsallop.py + - src/apideck_unify/models/accounting_salesreceiptsdeleteop.py + - src/apideck_unify/models/accounting_salesreceiptsoneop.py + - src/apideck_unify/models/accounting_salesreceiptsupdateop.py - src/apideck_unify/models/accounting_subsidiariesaddop.py - src/apideck_unify/models/accounting_subsidiariesallop.py - src/apideck_unify/models/accounting_subsidiariesdeleteop.py @@ -2600,6 +2631,7 @@ generatedFiles: - src/apideck_unify/models/createpurchaseorderresponse.py - src/apideck_unify/models/createquoteresponse.py - src/apideck_unify/models/createrefundresponse.py + - src/apideck_unify/models/createsalesreceiptresponse.py - src/apideck_unify/models/createsessionresponse.py - src/apideck_unify/models/createsharedlinkresponse.py - src/apideck_unify/models/createsubsidiaryresponse.py @@ -2728,6 +2760,7 @@ generatedFiles: - src/apideck_unify/models/deletepurchaseorderresponse.py - src/apideck_unify/models/deletequoteresponse.py - src/apideck_unify/models/deleterefundresponse.py + - src/apideck_unify/models/deletesalesreceiptresponse.py - src/apideck_unify/models/deletesharedlinkresponse.py - src/apideck_unify/models/deletesubsidiaryresponse.py - src/apideck_unify/models/deletesupplierresponse.py @@ -2964,6 +2997,8 @@ generatedFiles: - src/apideck_unify/models/getquotesresponse.py - src/apideck_unify/models/getrefundresponse.py - src/apideck_unify/models/getrefundsresponse.py + - src/apideck_unify/models/getsalesreceiptresponse.py + - src/apideck_unify/models/getsalesreceiptsresponse.py - src/apideck_unify/models/getsharedlinkresponse.py - src/apideck_unify/models/getsharedlinksresponse.py - src/apideck_unify/models/getstoreresponse.py @@ -3153,6 +3188,10 @@ generatedFiles: - src/apideck_unify/models/requestcountallocation.py - src/apideck_unify/models/resourcestatus.py - src/apideck_unify/models/responsevalidationerror.py + - src/apideck_unify/models/salesreceipt.py + - src/apideck_unify/models/salesreceipt_input.py + - src/apideck_unify/models/salesreceiptsfilter.py + - src/apideck_unify/models/salesreceiptssort.py - src/apideck_unify/models/schedule.py - src/apideck_unify/models/schemasupport.py - src/apideck_unify/models/security.py @@ -3242,6 +3281,7 @@ generatedFiles: - src/apideck_unify/models/updatepurchaseorderresponse.py - src/apideck_unify/models/updatequoteresponse.py - src/apideck_unify/models/updaterefundresponse.py + - src/apideck_unify/models/updatesalesreceiptresponse.py - src/apideck_unify/models/updatesharedlinkresponse.py - src/apideck_unify/models/updatesubsidiaryresponse.py - src/apideck_unify/models/updatesupplierresponse.py @@ -3309,6 +3349,7 @@ generatedFiles: - src/apideck_unify/py.typed - src/apideck_unify/quotes.py - src/apideck_unify/refunds.py + - src/apideck_unify/salesreceipts.py - src/apideck_unify/sdk.py - src/apideck_unify/sdkconfiguration.py - src/apideck_unify/sessions.py @@ -7472,7 +7513,7 @@ examples: x-apideck-company-id: "12345" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "payments", "operation": "one", "data": {"id": "12345", "display_id": "sample ID", "name": "sample.jpg", "mime_type": "image/jpeg", "size": 1810673, "reference": {"type": "invoice", "id": "12345"}, "description": "A sample image", "parent_folder_id": "123", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}, "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}, "total_count": 1, "warnings": [{"type": "downstream_request_failed", "status_code": 429, "operation": "getManager"}]}} + application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "payments", "operation": "one", "data": {"id": "12345", "display_id": "sample ID", "name": "sample.jpg", "mime_type": "image/jpeg", "size": 1810673, "reference": {"type": "invoice", "id": "12345"}, "description": "A sample image", "file_url": "https://example.com/files/sample.jpg", "parent_folder_id": "123", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}, "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}, "total_count": 1, "warnings": [{"type": "downstream_request_failed", "status_code": 429, "operation": "getManager"}]}} "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", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} "401": @@ -19917,11 +19958,158 @@ examples: application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} default: application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.salesReceiptsAll: + speakeasy-default-accounting-sales-receipts-all: + parameters: + query: + raw: false + limit: 20 + filter: {"updated_since": "2020-09-30T07:43:32.000Z", "customer_id": "123abc"} + sort: {"by": "updated_at", "direction": "desc"} + 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" + x-apideck-company-id: "12345" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "sales-receipts", "operation": "all", "data": [], "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}, "total_count": 1, "warnings": [{"type": "downstream_request_failed", "status_code": 429, "operation": "getManager"}]}, "links": {"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", "current": "https://unify.apideck.com/crm/companies", "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.salesReceiptsAdd: + speakeasy-default-accounting-sales-receipts-add: + parameters: + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + x-apideck-company-id: "12345" + requestBody: + application/json: {"number": "SR-00001", "customer": {"id": "12345", "display_name": "Windsurf Shop", "email": "boring@boring.com"}, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 250, "total_amount": 49.99, "total_tax": 25, "transaction_date": "2021-05-01T12:00:00.000Z", "payment_method": "cash", "payment_method_reference": "123456", "payment_method_id": "12345", "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "service_date": "2024-01-15", "category_id": "12345", "location_id": "12345", "department_id": "12345", "subsidiary_id": "12345", "shipping_id": "12345", "memo": "Some memo", "prepaid": true, "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_applicable_on": "Domestic_Purchase_of_Goods_and_Services", "tax_recoverability": "Fully_Recoverable", "tax_method": "Due_to_Supplier", "worktags": [{"id": "123456", "value": "New York"}], "tax_rate": {"id": "123456", "code": "N-T", "rate": 10}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "note": "Thank you for your purchase", "customer_memo": "Thank you for your business and have a great day!", "reference": "REF-123456", "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "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"}, "department": {"display_id": "123456", "name": "Acme Inc."}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + responses: + "201": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "sales-receipts", "operation": "add", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.salesReceiptsOne: + speakeasy-default-accounting-sales-receipts-one: + parameters: + path: + id: "" + query: + raw: false + fields: "id,updated_at" + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + x-apideck-company-id: "12345" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "sales-receipts", "operation": "one", "data": {"id": "123456", "number": "SR-00001", "customer": {"id": "12345", "display_id": "CUST00101", "display_name": "Windsurf Shop", "company_name": "The boring company", "email": "boring@boring.com"}, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 250, "total_amount": 49.99, "total_tax": 25, "transaction_date": "2021-05-01T12:00:00.000Z", "payment_method": "cash", "payment_method_reference": "123456", "payment_method_id": "12345", "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "service_date": "2024-01-15", "category_id": "12345", "location_id": "12345", "department_id": "12345", "subsidiary_id": "12345", "shipping_id": "12345", "memo": "Some memo", "prepaid": true, "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_applicable_on": "Domestic_Purchase_of_Goods_and_Services", "tax_recoverability": "Fully_Recoverable", "tax_method": "Due_to_Supplier", "worktags": [{"id": "123456", "value": "New York"}], "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": null}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "created_at": "2020-09-30T07:43:32.000Z", "updated_at": "2020-09-30T07:43:32.000Z"}], "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "note": "Thank you for your purchase", "customer_memo": "Thank you for your business and have a great day!", "reference": "REF-123456", "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "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"}, "department": {"id": "12345", "display_id": "123456", "name": "Acme Inc.", "downstream_id": "12345"}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}, "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}, "total_count": 1, "warnings": [{"type": "downstream_request_failed", "status_code": 429, "operation": "getManager"}]}} + "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", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.salesReceiptsUpdate: + speakeasy-default-accounting-sales-receipts-update: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + x-apideck-company-id: "12345" + requestBody: + application/json: {"number": "SR-00001", "customer": {"id": "12345", "display_name": "Windsurf Shop", "email": "boring@boring.com"}, "currency": "USD", "currency_rate": 0.69, "tax_inclusive": true, "sub_total": 250, "total_amount": 49.99, "total_tax": 25, "transaction_date": "2021-05-01T12:00:00.000Z", "payment_method": "cash", "payment_method_reference": "123456", "payment_method_id": "12345", "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "line_items": [{"id": "12345", "row_id": "12345", "code": "120-C", "line_number": 1, "description": "Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.", "type": "sales_item", "tax_amount": 27500, "total_amount": 27500, "quantity": 1, "unit_price": 27500.5, "unit_of_measure": "pc.", "discount_percentage": 0.01, "discount_amount": 19.99, "service_date": "2024-01-15", "category_id": "12345", "location_id": "12345", "department_id": "12345", "subsidiary_id": "12345", "shipping_id": "12345", "memo": "Some memo", "prepaid": true, "item": {"id": "12344", "code": "120-C", "name": "Model Y"}, "tax_applicable_on": "Domestic_Purchase_of_Goods_and_Services", "tax_recoverability": "Fully_Recoverable", "tax_method": "Due_to_Supplier", "worktags": [{"id": "123456", "value": "New York"}], "tax_rate": {"id": "123456", "code": "N-T", "rate": 10}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "ledger_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345"}], "tax_code": "1234", "discount_percentage": 5.5, "discount_amount": 25, "note": "Thank you for your purchase", "customer_memo": "Thank you for your business and have a great day!", "reference": "REF-123456", "billing_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}, "shipping_address": {"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "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"}, "department": {"display_id": "123456", "name": "Acme Inc."}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "sales-receipts", "operation": "update", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.salesReceiptsDelete: + speakeasy-default-accounting-sales-receipts-delete: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + x-apideck-company-id: "12345" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "sales-receipts", "operation": "delete", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} examplesVersion: 1.0.2 generatedTests: {} releaseNotes: | ## Python SDK Changes Detected: - * `apideck.crm.list_members.list()`: **Added** + * `apideck.accounting.sales_receipts.list()`: **Added** + * `apideck.accounting.sales_receipts.create()`: **Added** + * `apideck.accounting.sales_receipts.get()`: **Added** + * `apideck.accounting.sales_receipts.update()`: **Added** + * `apideck.accounting.sales_receipts.delete()`: **Added** + * `apideck.accounting.attachments.list()`: `response.data.[].file_url` **Added** + * `apideck.accounting.attachments.get()`: `response.data.file_url` **Added** trackedFiles: .devcontainer/README.md: last_write_checksum: sha1:07adb0c0c051a9be4d479ea06461f3a9b3bbeb2f @@ -20721,6 +20909,36 @@ trackedFiles: last_write_checksum: sha1:712ad48af3b704b5749f357dd2992d5c762ec573 docs/models/accountingrefundsupdateresponse.md: last_write_checksum: sha1:678f3673a94cde429faa5179b81b7765caa6649e + docs/models/accountingsalesreceiptsaddglobals.md: + last_write_checksum: sha1:e1b41ca9e0c29986cf6eebc137dd415b5d1e0eba + docs/models/accountingsalesreceiptsaddrequest.md: + last_write_checksum: sha1:244b40f29b36cc40a5980ee336777003df2e0046 + docs/models/accountingsalesreceiptsaddresponse.md: + last_write_checksum: sha1:a23078b1487a9b80f092fa8e8cd519834cd9c3ee + docs/models/accountingsalesreceiptsallglobals.md: + last_write_checksum: sha1:743e89ab29d42103367febe76bea435448273953 + docs/models/accountingsalesreceiptsallrequest.md: + last_write_checksum: sha1:6ca28ba09472cb9a029a6c12526b853ec712933b + docs/models/accountingsalesreceiptsallresponse.md: + last_write_checksum: sha1:2d6bcae5e6c6e7d43e0c9a5b02ee58a28cb1fc26 + docs/models/accountingsalesreceiptsdeleteglobals.md: + last_write_checksum: sha1:899490360e0bbc21d797a5bc15fa049ed4c7bf0b + docs/models/accountingsalesreceiptsdeleterequest.md: + last_write_checksum: sha1:019b833934d7935d40bd946ce7e10426ee70a367 + docs/models/accountingsalesreceiptsdeleteresponse.md: + last_write_checksum: sha1:d5ba5bb97f0788ef033ecec639b1be46d98274e2 + docs/models/accountingsalesreceiptsoneglobals.md: + last_write_checksum: sha1:166144bde5b11f58e753138e0bfca307adef6ca4 + docs/models/accountingsalesreceiptsonerequest.md: + last_write_checksum: sha1:b1e36ea453388bb4ab6d3dade32ff52e4f58bc17 + docs/models/accountingsalesreceiptsoneresponse.md: + last_write_checksum: sha1:bf86504ec9233d8bd68967890fb894aa14911245 + docs/models/accountingsalesreceiptsupdateglobals.md: + last_write_checksum: sha1:1cf2b38c4a242a6de9fdcc30aac72e165f3800f4 + docs/models/accountingsalesreceiptsupdaterequest.md: + last_write_checksum: sha1:bc7918fc286e44e742d01fc6338ade15988785c0 + docs/models/accountingsalesreceiptsupdateresponse.md: + last_write_checksum: sha1:8c0a8a3ed70d751d5f06d8b78638765f722bc50a docs/models/accountingsubsidiariesaddglobals.md: last_write_checksum: sha1:f6227d13ae58a33377d04e533945cdf374da6522 docs/models/accountingsubsidiariesaddrequest.md: @@ -21010,7 +21228,7 @@ trackedFiles: docs/models/atsjobsupdateresponse.md: last_write_checksum: sha1:463c65790680826784ddc337e6b35687615e08f3 docs/models/attachment.md: - last_write_checksum: sha1:73960c48c78ce8693bb7b33aa476cfedf7e24769 + last_write_checksum: sha1:ed365ee747c0824917f6ea95226cd6b7ad9552eb docs/models/attachmentreference.md: last_write_checksum: sha1:e1309515117268d54df56cf96fcd22651a6b174e docs/models/attachmentreferencetype.md: @@ -21409,6 +21627,8 @@ trackedFiles: last_write_checksum: sha1:36b0622ca557b64b7a7d537287b9959e21698e49 docs/models/createrefundresponse.md: last_write_checksum: sha1:629f87a8047b6774ebcb11af139b4d1e7b2a1864 + docs/models/createsalesreceiptresponse.md: + last_write_checksum: sha1:7c8592e8feb5c28f64df5eeee1c1eb1f32cde51a docs/models/createsessionresponse.md: last_write_checksum: sha1:dd34ea11c50835083f9b4c7012908fc593810920 docs/models/createsessionresponsedata.md: @@ -21935,6 +22155,8 @@ trackedFiles: last_write_checksum: sha1:b1e3023de49c59bd25ae8fdcec06ab1e81de34ad docs/models/deleterefundresponse.md: last_write_checksum: sha1:832fe9fcb47ea00658f46531f008ef8c8735caeb + docs/models/deletesalesreceiptresponse.md: + last_write_checksum: sha1:a874b7a4d1b2bea483a65fc346b0d8e064707037 docs/models/deletesharedlinkresponse.md: last_write_checksum: sha1:6935c7d9958068a8193e4c8daa7bdff8578f2e4a docs/models/deletesubsidiaryresponse.md: @@ -22687,6 +22909,10 @@ trackedFiles: last_write_checksum: sha1:df8bc68cdc6ba445a4184a9394ceeec526c618ae docs/models/getrefundsresponse.md: last_write_checksum: sha1:d89cff97abbfe162bc94cb8aa112ef0424fe407c + docs/models/getsalesreceiptresponse.md: + last_write_checksum: sha1:c87ca786706d30ee5d973fa37213d82c5e30b1a0 + docs/models/getsalesreceiptsresponse.md: + last_write_checksum: sha1:beceda04a5219ba9f38df7dbf089129cb89d18d5 docs/models/getsharedlinkresponse.md: last_write_checksum: sha1:afe7af9bce4b50c193bb0ed284a170557622097d docs/models/getsharedlinksresponse.md: @@ -23469,6 +23695,16 @@ trackedFiles: last_write_checksum: sha1:145626e28eaec2cee61b2ec4135e9319fdd00418 docs/models/salesdetails.md: last_write_checksum: sha1:59e01428f27a08d8e73d5b7caf8ecbcadc454174 + docs/models/salesreceipt.md: + last_write_checksum: sha1:bd0399b86d707a0392a94f85480c427456ba4e39 + docs/models/salesreceiptinput.md: + last_write_checksum: sha1:49056d9f9c5b9dec265bbebf7034a7fe7a5f31c2 + docs/models/salesreceiptsfilter.md: + last_write_checksum: sha1:21faeceb0026b8150f11926d5852258aadab2ee4 + docs/models/salesreceiptssort.md: + last_write_checksum: sha1:cf8f276110d210ace9166cc204a54c73daf12d40 + docs/models/salesreceiptssortby.md: + last_write_checksum: sha1:3192727a3c47327233213105afde62ab98560689 docs/models/schedule.md: last_write_checksum: sha1:ccc6fd5f3721e9dbdaae3d1f47607f54d793652e docs/models/schedulestatus.md: @@ -23775,6 +24011,8 @@ trackedFiles: last_write_checksum: sha1:3b33d9c68bac0255ffc11185942448ec2b0b2153 docs/models/updaterefundresponse.md: last_write_checksum: sha1:51d4bb2d366b56f35c5bfbf3576395d550432f95 + docs/models/updatesalesreceiptresponse.md: + last_write_checksum: sha1:485412714051b8d632eb5a401057310a8963dce9 docs/models/updatesharedlinkresponse.md: last_write_checksum: sha1:ccd7d33d0d9005e8b36e9f09cda40dfa93ce222c docs/models/updatesubsidiaryresponse.md: @@ -24199,6 +24437,8 @@ trackedFiles: last_write_checksum: sha1:9419f691ddabb312b0a912a6f0a98da028a96ba1 docs/sdks/refunds/README.md: last_write_checksum: sha1:f02f4f6ba8629d448e1708c0a82e505f526c7079 + docs/sdks/salesreceipts/README.md: + last_write_checksum: sha1:78c1cda8d37dd121a8744e00b5229fb38c4272ec docs/sdks/sessions/README.md: last_write_checksum: sha1:d68c81526c32b02dadeaf7b116edf23931eec337 docs/sdks/sharedlinks/README.md: @@ -24230,7 +24470,7 @@ trackedFiles: pylintrc: last_write_checksum: sha1:ec6665a4862060890cf4c6ba61438d11decf5c3c pyproject.toml: - last_write_checksum: sha1:6ac4dade3f8fb20f441a81afe18c5bf2a68b8145 + last_write_checksum: sha1:bb13d309654b3239b54edd03be305401946d854a scripts/prepare_readme.py: last_write_checksum: sha1:798a05bafe4fbbfff5b67037866fa25efc52f11a scripts/publish.sh: @@ -24244,9 +24484,9 @@ trackedFiles: src/apideck_unify/_hooks/types.py: last_write_checksum: sha1:d57be38e644de01983a9224b9733ae0add898d43 src/apideck_unify/_version.py: - last_write_checksum: sha1:9cc39c32648dba7c105b813caab897829c618bfb + last_write_checksum: sha1:fa30e802cd4088f29015663cfcdf1984369d11ed src/apideck_unify/accounting.py: - last_write_checksum: sha1:63ea555e29266c0cbe993e2bddf21ffecd9b02b9 + last_write_checksum: sha1:97d7b254e152a935c6c525c5c6d223f7ce71a041 src/apideck_unify/activities.py: last_write_checksum: sha1:d0d893423acbd8366c1581b05f4f76efffc9ef23 src/apideck_unify/agedcreditors_sdk.py: @@ -24260,7 +24500,7 @@ trackedFiles: src/apideck_unify/apideck_departments.py: last_write_checksum: sha1:9c6e4af55297ccb825e8bf5bb5c4089e53e344b5 src/apideck_unify/apideck_employees.py: - last_write_checksum: sha1:16b462466cb92e469dd907c54aec6ecd7511c4fa + last_write_checksum: sha1:5e79c144d960f902d80f0b50194250cb870534ef src/apideck_unify/apideck_hris_companies.py: last_write_checksum: sha1:8b1eb48fe3ec7b1d4d84e283a19556d98160d3ca src/apideck_unify/apiresourcecoverage_sdk.py: @@ -24290,7 +24530,7 @@ trackedFiles: src/apideck_unify/billpayments.py: last_write_checksum: sha1:30e7111d4df64bff502a27733255ea1b8fbb0fe2 src/apideck_unify/bills.py: - last_write_checksum: sha1:d5c9b128cbb95da88e260a13a2b747edf9c476df + last_write_checksum: sha1:c6ccd57b8e7de6ad5a6cb161cf21d7c4d70b9717 src/apideck_unify/categories.py: last_write_checksum: sha1:e1ea6fe95dd3b5357c4b6dab95d0cf6e78f33750 src/apideck_unify/collections.py: @@ -24366,9 +24606,9 @@ trackedFiles: src/apideck_unify/expensecategories.py: last_write_checksum: sha1:544e423a166f01fc368728ce058e837803221af1 src/apideck_unify/expensereports.py: - last_write_checksum: sha1:1f9eb71ffb486d1833c4892429ccc851e910a4ba + last_write_checksum: sha1:a938b4097e0b40e40f1e2bc0055ce89ddc6d6861 src/apideck_unify/expenses.py: - last_write_checksum: sha1:5d11fcb901f3f2924210468457aa2ad1110c8fbc + last_write_checksum: sha1:9b35d7fc79b7707094169669ad79f3af3d806d91 src/apideck_unify/files.py: last_write_checksum: sha1:d2a613a636558499fec8b923c3aa0d46a7e7e9ad src/apideck_unify/filestorage.py: @@ -24406,7 +24646,7 @@ trackedFiles: src/apideck_unify/messages.py: last_write_checksum: sha1:8b1e180d3c7d2ae9916b1f645460caebf5281d7b src/apideck_unify/models/__init__.py: - last_write_checksum: sha1:6a069b237cc8036b23ce7f6153c2ad322985646d + last_write_checksum: sha1:5d76c1bf037d4622ca9b6a97d74223c2a4bfb902 src/apideck_unify/models/accounting_agedcreditorsoneop.py: last_write_checksum: sha1:7346d1ab1c21db21995aae34c5ba01549c2786c2 src/apideck_unify/models/accounting_ageddebtorsoneop.py: @@ -24657,6 +24897,16 @@ trackedFiles: last_write_checksum: sha1:92d7dd2501e3c6758162ceb906b0aa6083c0fab0 src/apideck_unify/models/accounting_refundsupdateop.py: last_write_checksum: sha1:8f5a05bba5934c0ae1b2532b718418200d616e0f + src/apideck_unify/models/accounting_salesreceiptsaddop.py: + last_write_checksum: sha1:5a3c20ef10911a61b5f552e2fb9d94a3ced5ff42 + src/apideck_unify/models/accounting_salesreceiptsallop.py: + last_write_checksum: sha1:a40e94796030d2151aa461e4c65cdbd4b6339513 + src/apideck_unify/models/accounting_salesreceiptsdeleteop.py: + last_write_checksum: sha1:e72785298e2ea416b4aa0f99aa464c4834ffde43 + src/apideck_unify/models/accounting_salesreceiptsoneop.py: + last_write_checksum: sha1:0996b3ef081847a53fe775901fd198b5bf093d54 + src/apideck_unify/models/accounting_salesreceiptsupdateop.py: + last_write_checksum: sha1:36a67d081c81f24b6bfbbabad193429dc6373b6c src/apideck_unify/models/accounting_subsidiariesaddop.py: last_write_checksum: sha1:396e8292bb237e13c803a0a58bee211194630d81 src/apideck_unify/models/accounting_subsidiariesallop.py: @@ -24786,7 +25036,7 @@ trackedFiles: src/apideck_unify/models/ats_jobsupdateop.py: last_write_checksum: sha1:183dcbc21546b00c90c982e1ff65386be066dc5b src/apideck_unify/models/attachment.py: - last_write_checksum: sha1:45053b3c1831b0fe98feaf28d3503903f7d71b9c + last_write_checksum: sha1:1644908e960296f9b386c5d8fe96fd7db8c86a23 src/apideck_unify/models/attachmentreference.py: last_write_checksum: sha1:b2f4588cec995080da804b500d30e69e64f204c4 src/apideck_unify/models/attachmentreferencetype.py: @@ -25029,6 +25279,8 @@ trackedFiles: last_write_checksum: sha1:da1f6a6b634a180dc91f524498275f5de36dfd2f src/apideck_unify/models/createrefundresponse.py: last_write_checksum: sha1:e3c4b2bfe1926c3f7bd72ab3ef9210fcca96fb6d + src/apideck_unify/models/createsalesreceiptresponse.py: + last_write_checksum: sha1:67850be6dce0cd8e39694e6b25d32ecaac4e6ac4 src/apideck_unify/models/createsessionresponse.py: last_write_checksum: sha1:79b234105a086a305dedb7769f4cf1cb562ba0b8 src/apideck_unify/models/createsharedlinkresponse.py: @@ -25285,6 +25537,8 @@ trackedFiles: last_write_checksum: sha1:492fce611527fcbc20ed23c20d9b57b8606f8534 src/apideck_unify/models/deleterefundresponse.py: last_write_checksum: sha1:dded5458010b54d509a45c21f93f6512259de19e + src/apideck_unify/models/deletesalesreceiptresponse.py: + last_write_checksum: sha1:3673da94f95af8f47a7ee516cffe555f03f84fc9 src/apideck_unify/models/deletesharedlinkresponse.py: last_write_checksum: sha1:99b6636f4e380bf3b8ba2f0d204bf82ed0a2b556 src/apideck_unify/models/deletesubsidiaryresponse.py: @@ -25757,6 +26011,10 @@ trackedFiles: last_write_checksum: sha1:8ec25bcdff7049612f11040bb238ce1cfb04bc28 src/apideck_unify/models/getrefundsresponse.py: last_write_checksum: sha1:fe80419e1785cb1c0a5d2c1584cbf308403708c4 + src/apideck_unify/models/getsalesreceiptresponse.py: + last_write_checksum: sha1:a7521a852e9f3d297f4e6758f1746bdb26245ef7 + src/apideck_unify/models/getsalesreceiptsresponse.py: + last_write_checksum: sha1:0d6b8ba78dd8cc8846569ba2e5ce52edf9ea36e7 src/apideck_unify/models/getsharedlinkresponse.py: last_write_checksum: sha1:18274c7450003b4c77e5abaa22b4529217fdeb1f src/apideck_unify/models/getsharedlinksresponse.py: @@ -26135,6 +26393,14 @@ trackedFiles: last_write_checksum: sha1:be7e15a7fa5d409dcacbae9c0cae874d710e1095 src/apideck_unify/models/responsevalidationerror.py: last_write_checksum: sha1:532f05168bca571541f925e27639d6953c628935 + src/apideck_unify/models/salesreceipt.py: + last_write_checksum: sha1:9607edfe841a2a9ed0cf94a0d34e8544b4d594e0 + src/apideck_unify/models/salesreceipt_input.py: + last_write_checksum: sha1:a66ef838af20bee629ba55bf035baf3c75b6f2dd + src/apideck_unify/models/salesreceiptsfilter.py: + last_write_checksum: sha1:0569e36b4dd3cba93fc460babb9dfe7371248269 + src/apideck_unify/models/salesreceiptssort.py: + last_write_checksum: sha1:19f2d84cf00aeb5c35525cc3b6c906b36f6e9b80 src/apideck_unify/models/schedule.py: last_write_checksum: sha1:1f6703c6c4b10af0039d282b7eef44b91dedfa14 src/apideck_unify/models/schemasupport.py: @@ -26313,6 +26579,8 @@ trackedFiles: last_write_checksum: sha1:c75631693dfd661213a5076d8b2be78db52ac87d src/apideck_unify/models/updaterefundresponse.py: last_write_checksum: sha1:d98c079de92745784866dbe79debf14feb10dde4 + src/apideck_unify/models/updatesalesreceiptresponse.py: + last_write_checksum: sha1:cc120004dc5fd52e88a7e387e9436b28b1b9548e src/apideck_unify/models/updatesharedlinkresponse.py: last_write_checksum: sha1:e150d958d67fccd2bd5e19994bd03906e069c86e src/apideck_unify/models/updatesubsidiaryresponse.py: @@ -26422,7 +26690,7 @@ trackedFiles: src/apideck_unify/notes.py: last_write_checksum: sha1:2835a9acd16ab47fdb69d556098865d91d2f1ef4 src/apideck_unify/opportunities.py: - last_write_checksum: sha1:52703136ab8c58db2b105a2c830a33e8f3050191 + last_write_checksum: sha1:93256b50e99311f6e9b6553d9d44fab71f532022 src/apideck_unify/orders.py: last_write_checksum: sha1:3b864ab4956ca88a67f699d9c18016e20b797871 src/apideck_unify/payments.py: @@ -26447,6 +26715,8 @@ trackedFiles: last_write_checksum: sha1:d7434c42b50b1be4f1e8d417ce22b7d61f8b97cf src/apideck_unify/refunds.py: last_write_checksum: sha1:8cb402fa74d6fdc5512561436174ac55e33fcc52 + src/apideck_unify/salesreceipts.py: + last_write_checksum: sha1:ee356b7ade5bf52c2b6f81ab68ce05131cf3c0d9 src/apideck_unify/sdk.py: last_write_checksum: sha1:c36fd87d8a9d1b51c46deeb198cc84a9761aedfb src/apideck_unify/sdkconfiguration.py: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e114690a..10caa599 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: persistentEdits: {} versioningStrategy: automatic python: - version: 0.36.0 + version: 0.37.0 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2666e55c..e41db44c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,20 +2,20 @@ speakeasyVersion: 1.656.1 sources: Apideck: sourceNamespace: apideck - sourceRevisionDigest: sha256:76683a9f95b9f0f17e568c32509b42f8258c05e93690eaf75bd29dde069d8e98 - sourceBlobDigest: sha256:627caaeba3ccaac43cdc59d8aed1dfefe8f9e14e5ec4301dc8d2147d625e988c + sourceRevisionDigest: sha256:81870849f1f55ca750084f43449f245a94e32198e39816d738fa6b13ce9ddfb2 + sourceBlobDigest: sha256:c33c848943024ff1f33c3b683468e1194fdb180a97e7ac9e293a5003548b76b0 tags: - latest - - speakeasy-sdk-regen-1786010008 - - 10.32.0 + - speakeasy-sdk-regen-1786072582 + - 10.34.0 targets: apideck: source: Apideck sourceNamespace: apideck - sourceRevisionDigest: sha256:76683a9f95b9f0f17e568c32509b42f8258c05e93690eaf75bd29dde069d8e98 - sourceBlobDigest: sha256:627caaeba3ccaac43cdc59d8aed1dfefe8f9e14e5ec4301dc8d2147d625e988c + sourceRevisionDigest: sha256:81870849f1f55ca750084f43449f245a94e32198e39816d738fa6b13ce9ddfb2 + sourceBlobDigest: sha256:c33c848943024ff1f33c3b683468e1194fdb180a97e7ac9e293a5003548b76b0 codeSamplesNamespace: apideck-python-code-samples - codeSamplesRevisionDigest: sha256:d198e0f3062e34870b64da3e077e725dcace0710f0b52e06481b673d27e81ceb + codeSamplesRevisionDigest: sha256:1cde0b4548ef8fe1fe06c4b23c88ea187e4accd32f8fd53daaf2906370f86a13 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 7cd807f9..ef951aa6 100644 --- a/README.md +++ b/README.md @@ -452,6 +452,14 @@ with Apideck( * [update](docs/sdks/refunds/README.md#update) - Update Refund * [delete](docs/sdks/refunds/README.md#delete) - Delete Refund +#### [accounting.sales_receipts](docs/sdks/salesreceipts/README.md) + +* [list](docs/sdks/salesreceipts/README.md#list) - List Sales Receipts +* [create](docs/sdks/salesreceipts/README.md#create) - Create Sales Receipt +* [get](docs/sdks/salesreceipts/README.md#get) - Get Sales Receipt +* [update](docs/sdks/salesreceipts/README.md#update) - Update Sales Receipt +* [delete](docs/sdks/salesreceipts/README.md#delete) - Delete Sales Receipt + #### [accounting.subsidiaries](docs/sdks/subsidiaries/README.md) * [list](docs/sdks/subsidiaries/README.md#list) - List Subsidiaries @@ -1082,8 +1090,8 @@ with Apideck( **Inherit from [`ApideckError`](./src/apideck_unify/models/apideckerror.py)**: -* [`Unauthorized`](./src/apideck_unify/models/unauthorized.py): Unauthorized. Status code `401`. Applicable to 6 of 341 methods.* -* [`ConflictResponse`](./src/apideck_unify/models/conflictresponse.py): Conflict — a connection already exists for the target connector. Status code `409`. Applicable to 1 of 341 methods.* +* [`Unauthorized`](./src/apideck_unify/models/unauthorized.py): Unauthorized. Status code `401`. Applicable to 6 of 346 methods.* +* [`ConflictResponse`](./src/apideck_unify/models/conflictresponse.py): Conflict — a connection already exists for the target connector. Status code `409`. Applicable to 1 of 346 methods.* * [`ResponseValidationError`](./src/apideck_unify/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute. diff --git a/RELEASES.md b/RELEASES.md index 4e44984d..2aae3ef6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1458,4 +1458,14 @@ Based on: ### Generated - [python v0.36.0] . ### Releases -- [PyPI v0.36.0] https://pypi.org/project/apideck-unify/0.36.0 - . \ No newline at end of file +- [PyPI v0.36.0] https://pypi.org/project/apideck-unify/0.36.0 - . + +## 2026-08-08 00:18:19 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.656.1 (2.753.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.37.0] . +### Releases +- [PyPI v0.37.0] https://pypi.org/project/apideck-unify/0.37.0 - . \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsaddglobals.md b/docs/models/accountingsalesreceiptsaddglobals.md new file mode 100644 index 00000000..0152bf84 --- /dev/null +++ b/docs/models/accountingsalesreceiptsaddglobals.md @@ -0,0 +1,9 @@ +# AccountingSalesReceiptsAddGlobals + + +## 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/accountingsalesreceiptsaddrequest.md b/docs/models/accountingsalesreceiptsaddrequest.md new file mode 100644 index 00000000..62aec4f7 --- /dev/null +++ b/docs/models/accountingsalesreceiptsaddrequest.md @@ -0,0 +1,13 @@ +# AccountingSalesReceiptsAddRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `sales_receipt` | [models.SalesReceiptInput](../models/salesreceiptinput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsaddresponse.md b/docs/models/accountingsalesreceiptsaddresponse.md new file mode 100644 index 00000000..56c27821 --- /dev/null +++ b/docs/models/accountingsalesreceiptsaddresponse.md @@ -0,0 +1,10 @@ +# AccountingSalesReceiptsAddResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `http_meta` | [models.HTTPMetadata](../models/httpmetadata.md) | :heavy_check_mark: | N/A | +| `create_sales_receipt_response` | [Optional[models.CreateSalesReceiptResponse]](../models/createsalesreceiptresponse.md) | :heavy_minus_sign: | SalesReceipt created | +| `unexpected_error_response` | [Optional[models.UnexpectedErrorResponse]](../models/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsallglobals.md b/docs/models/accountingsalesreceiptsallglobals.md new file mode 100644 index 00000000..61361a70 --- /dev/null +++ b/docs/models/accountingsalesreceiptsallglobals.md @@ -0,0 +1,9 @@ +# AccountingSalesReceiptsAllGlobals + + +## 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/accountingsalesreceiptsallrequest.md b/docs/models/accountingsalesreceiptsallrequest.md new file mode 100644 index 00000000..0a8e9b90 --- /dev/null +++ b/docs/models/accountingsalesreceiptsallrequest.md @@ -0,0 +1,18 @@ +# AccountingSalesReceiptsAllRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `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.SalesReceiptsFilter]](../models/salesreceiptsfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z",
"customer_id": "123abc"
} | +| `sort` | [Optional[models.SalesReceiptsSort]](../models/salesreceiptssort.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 | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsallresponse.md b/docs/models/accountingsalesreceiptsallresponse.md new file mode 100644 index 00000000..2d7f3b90 --- /dev/null +++ b/docs/models/accountingsalesreceiptsallresponse.md @@ -0,0 +1,10 @@ +# AccountingSalesReceiptsAllResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `http_meta` | [models.HTTPMetadata](../models/httpmetadata.md) | :heavy_check_mark: | N/A | +| `get_sales_receipts_response` | [Optional[models.GetSalesReceiptsResponse]](../models/getsalesreceiptsresponse.md) | :heavy_minus_sign: | SalesReceipts | +| `unexpected_error_response` | [Optional[models.UnexpectedErrorResponse]](../models/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsdeleteglobals.md b/docs/models/accountingsalesreceiptsdeleteglobals.md new file mode 100644 index 00000000..15452eba --- /dev/null +++ b/docs/models/accountingsalesreceiptsdeleteglobals.md @@ -0,0 +1,9 @@ +# AccountingSalesReceiptsDeleteGlobals + + +## 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/accountingsalesreceiptsdeleterequest.md b/docs/models/accountingsalesreceiptsdeleterequest.md new file mode 100644 index 00000000..2766fcb9 --- /dev/null +++ b/docs/models/accountingsalesreceiptsdeleterequest.md @@ -0,0 +1,13 @@ +# AccountingSalesReceiptsDeleteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsdeleteresponse.md b/docs/models/accountingsalesreceiptsdeleteresponse.md new file mode 100644 index 00000000..5fc36def --- /dev/null +++ b/docs/models/accountingsalesreceiptsdeleteresponse.md @@ -0,0 +1,10 @@ +# AccountingSalesReceiptsDeleteResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `http_meta` | [models.HTTPMetadata](../models/httpmetadata.md) | :heavy_check_mark: | N/A | +| `delete_sales_receipt_response` | [Optional[models.DeleteSalesReceiptResponse]](../models/deletesalesreceiptresponse.md) | :heavy_minus_sign: | SalesReceipt deleted | +| `unexpected_error_response` | [Optional[models.UnexpectedErrorResponse]](../models/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsoneglobals.md b/docs/models/accountingsalesreceiptsoneglobals.md new file mode 100644 index 00000000..89054c9b --- /dev/null +++ b/docs/models/accountingsalesreceiptsoneglobals.md @@ -0,0 +1,9 @@ +# AccountingSalesReceiptsOneGlobals + + +## 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/accountingsalesreceiptsonerequest.md b/docs/models/accountingsalesreceiptsonerequest.md new file mode 100644 index 00000000..fe85302f --- /dev/null +++ b/docs/models/accountingsalesreceiptsonerequest.md @@ -0,0 +1,14 @@ +# AccountingSalesReceiptsOneRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `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 | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsoneresponse.md b/docs/models/accountingsalesreceiptsoneresponse.md new file mode 100644 index 00000000..5d771879 --- /dev/null +++ b/docs/models/accountingsalesreceiptsoneresponse.md @@ -0,0 +1,10 @@ +# AccountingSalesReceiptsOneResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `http_meta` | [models.HTTPMetadata](../models/httpmetadata.md) | :heavy_check_mark: | N/A | +| `get_sales_receipt_response` | [Optional[models.GetSalesReceiptResponse]](../models/getsalesreceiptresponse.md) | :heavy_minus_sign: | SalesReceipt | +| `unexpected_error_response` | [Optional[models.UnexpectedErrorResponse]](../models/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsupdateglobals.md b/docs/models/accountingsalesreceiptsupdateglobals.md new file mode 100644 index 00000000..50cd91a9 --- /dev/null +++ b/docs/models/accountingsalesreceiptsupdateglobals.md @@ -0,0 +1,9 @@ +# AccountingSalesReceiptsUpdateGlobals + + +## 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/accountingsalesreceiptsupdaterequest.md b/docs/models/accountingsalesreceiptsupdaterequest.md new file mode 100644 index 00000000..361efdca --- /dev/null +++ b/docs/models/accountingsalesreceiptsupdaterequest.md @@ -0,0 +1,14 @@ +# AccountingSalesReceiptsUpdateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `sales_receipt` | [models.SalesReceiptInput](../models/salesreceiptinput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/accountingsalesreceiptsupdateresponse.md b/docs/models/accountingsalesreceiptsupdateresponse.md new file mode 100644 index 00000000..f4c4a552 --- /dev/null +++ b/docs/models/accountingsalesreceiptsupdateresponse.md @@ -0,0 +1,10 @@ +# AccountingSalesReceiptsUpdateResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `http_meta` | [models.HTTPMetadata](../models/httpmetadata.md) | :heavy_check_mark: | N/A | +| `update_sales_receipt_response` | [Optional[models.UpdateSalesReceiptResponse]](../models/updatesalesreceiptresponse.md) | :heavy_minus_sign: | SalesReceipt updated | +| `unexpected_error_response` | [Optional[models.UnexpectedErrorResponse]](../models/unexpectederrorresponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/attachment.md b/docs/models/attachment.md index e9255d60..fda4a199 100644 --- a/docs/models/attachment.md +++ b/docs/models/attachment.md @@ -12,6 +12,7 @@ | `size` | *OptionalNullable[int]* | :heavy_minus_sign: | The size of the file in bytes | 1810673 | | `reference` | [Optional[models.AttachmentReference]](../models/attachmentreference.md) | :heavy_minus_sign: | N/A | | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional description of the file | A sample image | +| `file_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL to download or preview the file | https://example.com/files/sample.jpg | | `parent_folder_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The folder id where this attachment belong to | 123 | | `updated_by` | *OptionalNullable[str]* | :heavy_minus_sign: | The user who last updated the object. | 12345 | | `created_by` | *OptionalNullable[str]* | :heavy_minus_sign: | The user who created the object. | 12345 | diff --git a/docs/models/createsalesreceiptresponse.md b/docs/models/createsalesreceiptresponse.md new file mode 100644 index 00000000..3433fcb2 --- /dev/null +++ b/docs/models/createsalesreceiptresponse.md @@ -0,0 +1,16 @@ +# CreateSalesReceiptResponse + +SalesReceipt created + + +## 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 | sales-receipts | +| `operation` | *str* | :heavy_check_mark: | Operation performed | add | +| `data` | [models.UnifiedID](../models/unifiedid.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Dict[str, *Any*] | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/deletesalesreceiptresponse.md b/docs/models/deletesalesreceiptresponse.md new file mode 100644 index 00000000..5aece1e8 --- /dev/null +++ b/docs/models/deletesalesreceiptresponse.md @@ -0,0 +1,16 @@ +# DeleteSalesReceiptResponse + +SalesReceipt deleted + + +## 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 | sales-receipts | +| `operation` | *str* | :heavy_check_mark: | Operation performed | delete | +| `data` | [models.UnifiedID](../models/unifiedid.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Dict[str, *Any*] | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/getsalesreceiptresponse.md b/docs/models/getsalesreceiptresponse.md new file mode 100644 index 00000000..811db98a --- /dev/null +++ b/docs/models/getsalesreceiptresponse.md @@ -0,0 +1,17 @@ +# GetSalesReceiptResponse + +SalesReceipt + + +## 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 | sales-receipts | +| `operation` | *str* | :heavy_check_mark: | Operation performed | one | +| `data` | [models.SalesReceipt](../models/salesreceipt.md) | :heavy_check_mark: | N/A | | +| `meta` | [Optional[models.Meta]](../models/meta.md) | :heavy_minus_sign: | Response metadata | | +| `raw` | Dict[str, *Any*] | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/getsalesreceiptsresponse.md b/docs/models/getsalesreceiptsresponse.md new file mode 100644 index 00000000..d4ae2352 --- /dev/null +++ b/docs/models/getsalesreceiptsresponse.md @@ -0,0 +1,18 @@ +# GetSalesReceiptsResponse + +SalesReceipts + + +## 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 | sales-receipts | +| `operation` | *str* | :heavy_check_mark: | Operation performed | all | +| `data` | List[[models.SalesReceipt](../models/salesreceipt.md)] | :heavy_check_mark: | N/A | | +| `meta` | [Optional[models.Meta]](../models/meta.md) | :heavy_minus_sign: | Response metadata | | +| `links` | [Optional[models.Links]](../models/links.md) | :heavy_minus_sign: | Links to navigate to previous or next pages through the API | | +| `raw` | Dict[str, *Any*] | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/salesreceipt.md b/docs/models/salesreceipt.md new file mode 100644 index 00000000..6d455940 --- /dev/null +++ b/docs/models/salesreceipt.md @@ -0,0 +1,40 @@ +# SalesReceipt + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier representing the sales receipt | 123456 | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference number for the sales receipt. | SR-00001 | +| `customer` | [OptionalNullable[models.LinkedCustomer]](../models/linkedcustomer.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `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: | Subtotal amount, normally before tax. | 250 | +| `total_amount` | *Nullable[float]* | :heavy_check_mark: | The total amount of the transaction or record | 49.99 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this transaction. | 25 | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `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.LinkedLedgerAccount]](../models/linkedledgeraccount.md) | :heavy_minus_sign: | N/A | | +| `line_items` | List[[models.InvoiceLineItem](../models/invoicelineitem.md)] | :heavy_minus_sign: | Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing. | | +| `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 sales receipt. | 5.5 | +| `discount_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount amount applied to this sales receipt. | 25 | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note to be associated with the sales receipt. | Thank you for your purchase | +| `customer_memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Customer memo | Thank you for your business and have a great day! | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message for the sales receipt. | REF-123456 | +| `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 | | +| `department` | [OptionalNullable[models.LinkedDepartment]](../models/linkeddepartment.md) | :heavy_minus_sign: | N/A | | +| `tracking_categories` | List[[Nullable[models.LinkedTrackingCategory]](../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `custom_mappings` | Dict[str, *Any*] | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | +| `custom_fields` | List[[models.CustomField](../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `row_version` | *OptionalNullable[str]* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | +| `updated_by` | *OptionalNullable[str]* | :heavy_minus_sign: | The user who last updated the object. | 12345 | +| `created_by` | *OptionalNullable[str]* | :heavy_minus_sign: | The user who created the object. | 12345 | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date and time when the object was last updated. | 2020-09-30T07:43:32.000Z | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date and time when the object was created. | 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. | | \ No newline at end of file diff --git a/docs/models/salesreceiptinput.md b/docs/models/salesreceiptinput.md new file mode 100644 index 00000000..78546bb8 --- /dev/null +++ b/docs/models/salesreceiptinput.md @@ -0,0 +1,34 @@ +# SalesReceiptInput + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference number for the sales receipt. | SR-00001 | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `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: | Subtotal amount, normally before tax. | 250 | +| `total_amount` | *Nullable[float]* | :heavy_check_mark: | The total amount of the transaction or record | 49.99 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this transaction. | 25 | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `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.LinkedLedgerAccount]](../models/linkedledgeraccount.md) | :heavy_minus_sign: | N/A | | +| `line_items` | List[[models.InvoiceLineItemInput](../models/invoicelineiteminput.md)] | :heavy_minus_sign: | Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing. | | +| `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 sales receipt. | 5.5 | +| `discount_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount amount applied to this sales receipt. | 25 | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note to be associated with the sales receipt. | Thank you for your purchase | +| `customer_memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Customer memo | Thank you for your business and have a great day! | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message for the sales receipt. | REF-123456 | +| `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 | | +| `department` | [OptionalNullable[models.LinkedDepartmentInput]](../models/linkeddepartmentinput.md) | :heavy_minus_sign: | N/A | | +| `tracking_categories` | List[[Nullable[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. | | \ No newline at end of file diff --git a/docs/models/salesreceiptsfilter.md b/docs/models/salesreceiptsfilter.md new file mode 100644 index 00000000..cf11fa53 --- /dev/null +++ b/docs/models/salesreceiptsfilter.md @@ -0,0 +1,9 @@ +# SalesReceiptsFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `updated_since` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | 2020-09-30T07:43:32.000Z | +| `customer_id` | *Optional[str]* | :heavy_minus_sign: | Filter by customer id | 123abc | \ No newline at end of file diff --git a/docs/models/salesreceiptssort.md b/docs/models/salesreceiptssort.md new file mode 100644 index 00000000..3275d359 --- /dev/null +++ b/docs/models/salesreceiptssort.md @@ -0,0 +1,9 @@ +# SalesReceiptsSort + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `by` | [Optional[models.SalesReceiptsSortBy]](../models/salesreceiptssortby.md) | :heavy_minus_sign: | The field on which to sort the Sales Receipts. | updated_at | +| `direction` | [Optional[models.SortDirection]](../models/sortdirection.md) | :heavy_minus_sign: | The direction in which to sort the results | | \ No newline at end of file diff --git a/docs/models/salesreceiptssortby.md b/docs/models/salesreceiptssortby.md new file mode 100644 index 00000000..e9021ff9 --- /dev/null +++ b/docs/models/salesreceiptssortby.md @@ -0,0 +1,11 @@ +# SalesReceiptsSortBy + +The field on which to sort the Sales Receipts. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `UPDATED_AT` | updated_at | +| `CREATED_AT` | created_at | \ No newline at end of file diff --git a/docs/models/updatesalesreceiptresponse.md b/docs/models/updatesalesreceiptresponse.md new file mode 100644 index 00000000..0fe729ae --- /dev/null +++ b/docs/models/updatesalesreceiptresponse.md @@ -0,0 +1,16 @@ +# UpdateSalesReceiptResponse + +SalesReceipt updated + + +## 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 | sales-receipts | +| `operation` | *str* | :heavy_check_mark: | Operation performed | update | +| `data` | [models.UnifiedID](../models/unifiedid.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Dict[str, *Any*] | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/sdks/salesreceipts/README.md b/docs/sdks/salesreceipts/README.md new file mode 100644 index 00000000..b1728382 --- /dev/null +++ b/docs/sdks/salesreceipts/README.md @@ -0,0 +1,685 @@ +# SalesReceipts +(*accounting.sales_receipts*) + +## Overview + +### Available Operations + +* [list](#list) - List Sales Receipts +* [create](#create) - Create Sales Receipt +* [get](#get) - Get Sales Receipt +* [update](#update) - Update Sales Receipt +* [delete](#delete) - Delete Sales Receipt + +## list + +List Sales Receipts + +### Example Usage + + +```python +import apideck_unify +from apideck_unify import Apideck +from apideck_unify.utils import parse_datetime +import os + + +with Apideck( + consumer_id="test-consumer", + app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + api_key=os.getenv("APIDECK_API_KEY", ""), +) as apideck: + + res = apideck.accounting.sales_receipts.list(raw=False, service_id="salesforce", company_id="12345", limit=20, filter_={ + "updated_since": parse_datetime("2020-09-30T07:43:32.000Z"), + "customer_id": "123abc", + }, sort={ + "by": apideck_unify.SalesReceiptsSortBy.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 | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `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.SalesReceiptsFilter]](../../models/salesreceiptsfilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z",
"customer_id": "123abc"
} | +| `sort` | [Optional[models.SalesReceiptsSort]](../../models/salesreceiptssort.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 + +**[models.AccountingSalesReceiptsAllResponse](../../models/accountingsalesreceiptsallresponse.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 | \*/\* | + +## create + +Create Sales Receipt + +### Example Usage + + +```python +import apideck_unify +from apideck_unify import Apideck +from apideck_unify.utils import parse_datetime +from datetime import date +import os + + +with Apideck( + consumer_id="test-consumer", + app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + api_key=os.getenv("APIDECK_API_KEY", ""), +) as apideck: + + res = apideck.accounting.sales_receipts.create(total_amount=49.99, raw=False, service_id="salesforce", company_id="12345", number="SR-00001", customer={ + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, sub_total=250, total_tax=25, transaction_date=parse_datetime("2021-05-01T12:00:00.000Z"), payment_method="cash", payment_method_reference="123456", payment_method_id="12345", account={ + "id": "123456", + "name": "Bank account", + "nominal_code": "N091", + "code": "453", + "parent_id": "123456", + "display_id": "123456", + }, 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, + "service_date": date.fromisoformat("2024-01-15"), + "category_id": "12345", + "location_id": "12345", + "department_id": "12345", + "subsidiary_id": "12345", + "shipping_id": "12345", + "memo": "Some memo", + "prepaid": True, + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_applicable_on": "Domestic_Purchase_of_Goods_and_Services", + "tax_recoverability": "Fully_Recoverable", + "tax_method": "Due_to_Supplier", + "worktags": [ + { + "id": "123456", + "value": "New York", + }, + ], + "tax_rate": { + "id": "123456", + "code": "N-T", + "rate": 10, + }, + "tracking_categories": [ + { + "id": "123456", + "code": "100", + "name": "New York", + "parent_id": "123456", + "parent_name": "New York", + }, + ], + "ledger_account": { + "id": "123456", + "name": "Bank account", + "nominal_code": "N091", + "code": "453", + "parent_id": "123456", + "display_id": "123456", + }, + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], + "row_version": "1-12345", + }, + ], tax_code="1234", discount_percentage=5.5, discount_amount=25, note="Thank you for your purchase", customer_memo="Thank you for your business and have a great day!", reference="REF-123456", 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", + "line5": "Attention: Finance Dept", + "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", + "line5": "Attention: Finance Dept", + "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", + }, department={ + "display_id": "123456", + "name": "Acme Inc.", + }, tracking_categories=[ + { + "id": "123456", + "code": "100", + "name": "New York", + "parent_id": "123456", + "parent_name": "New York", + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", + }, + }, + }, + ], + }, + ]) + + assert res.create_sales_receipt_response is not None + + # Handle response + print(res.create_sales_receipt_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `total_amount` | *Nullable[float]* | :heavy_check_mark: | The total amount of the transaction or record | 49.99 | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference number for the sales receipt. | SR-00001 | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `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: | Subtotal amount, normally before tax. | 250 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this transaction. | 25 | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `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.LinkedLedgerAccount]](../../models/linkedledgeraccount.md) | :heavy_minus_sign: | N/A | | +| `line_items` | List[[models.InvoiceLineItemInput](../../models/invoicelineiteminput.md)] | :heavy_minus_sign: | Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing. | | +| `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 sales receipt. | 5.5 | +| `discount_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount amount applied to this sales receipt. | 25 | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note to be associated with the sales receipt. | Thank you for your purchase | +| `customer_memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Customer memo | Thank you for your business and have a great day! | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message for the sales receipt. | REF-123456 | +| `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 | | +| `department` | [OptionalNullable[models.LinkedDepartmentInput]](../../models/linkeddepartmentinput.md) | :heavy_minus_sign: | N/A | | +| `tracking_categories` | List[[Nullable[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 + +**[models.AccountingSalesReceiptsAddResponse](../../models/accountingsalesreceiptsaddresponse.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 | \*/\* | + +## get + +Get Sales Receipt + +### Example Usage + + +```python +from apideck_unify import Apideck +import os + + +with Apideck( + consumer_id="test-consumer", + app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + api_key=os.getenv("APIDECK_API_KEY", ""), +) as apideck: + + res = apideck.accounting.sales_receipts.get(id="", service_id="salesforce", company_id="12345", raw=False, fields="id,updated_at") + + assert res.get_sales_receipt_response is not None + + # Handle response + print(res.get_sales_receipt_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `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 + +**[models.AccountingSalesReceiptsOneResponse](../../models/accountingsalesreceiptsoneresponse.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 | \*/\* | + +## update + +Update Sales Receipt + +### Example Usage + + +```python +import apideck_unify +from apideck_unify import Apideck +from apideck_unify.utils import parse_datetime +from datetime import date +import os + + +with Apideck( + consumer_id="test-consumer", + app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + api_key=os.getenv("APIDECK_API_KEY", ""), +) as apideck: + + res = apideck.accounting.sales_receipts.update(id="", total_amount=49.99, service_id="salesforce", raw=False, company_id="12345", number="SR-00001", customer={ + "id": "12345", + "display_name": "Windsurf Shop", + "email": "boring@boring.com", + }, currency=apideck_unify.Currency.USD, currency_rate=0.69, tax_inclusive=True, sub_total=250, total_tax=25, transaction_date=parse_datetime("2021-05-01T12:00:00.000Z"), payment_method="cash", payment_method_reference="123456", payment_method_id="12345", account={ + "id": "123456", + "name": "Bank account", + "nominal_code": "N091", + "code": "453", + "parent_id": "123456", + "display_id": "123456", + }, 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, + "service_date": date.fromisoformat("2024-01-15"), + "category_id": "12345", + "location_id": "12345", + "department_id": "12345", + "subsidiary_id": "12345", + "shipping_id": "12345", + "memo": "Some memo", + "prepaid": True, + "item": { + "id": "12344", + "code": "120-C", + "name": "Model Y", + }, + "tax_applicable_on": "Domestic_Purchase_of_Goods_and_Services", + "tax_recoverability": "Fully_Recoverable", + "tax_method": "Due_to_Supplier", + "worktags": [ + { + "id": "123456", + "value": "New York", + }, + ], + "tax_rate": { + "id": "123456", + "code": "N-T", + "rate": 10, + }, + "tracking_categories": [ + { + "id": "123456", + "code": "100", + "name": "New York", + "parent_id": "123456", + "parent_name": "New York", + }, + ], + "ledger_account": { + "id": "123456", + "name": "Bank account", + "nominal_code": "N091", + "code": "453", + "parent_id": "123456", + "display_id": "123456", + }, + "custom_fields": [ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], + "row_version": "1-12345", + }, + ], tax_code="1234", discount_percentage=5.5, discount_amount=25, note="Thank you for your purchase", customer_memo="Thank you for your business and have a great day!", reference="REF-123456", 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", + "line5": "Attention: Finance Dept", + "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", + "line5": "Attention: Finance Dept", + "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", + }, department={ + "display_id": "123456", + "name": "Acme Inc.", + }, tracking_categories=[ + { + "id": "123456", + "code": "100", + "name": "New York", + "parent_id": "123456", + "parent_name": "New York", + }, + ], custom_fields=[ + { + "id": "2389328923893298", + "name": "employee_level", + "description": "Employee Level", + "value": "Uses Salesforce and Marketo", + }, + ], row_version="1-12345", pass_through=[ + { + "service_id": "", + "extend_paths": [ + { + "path": "$.nested.property", + "value": { + "TaxClassificationRef": { + "value": "EUC-99990201-V1-00020000", + }, + }, + }, + ], + }, + ]) + + assert res.update_sales_receipt_response is not None + + # Handle response + print(res.update_sales_receipt_response) + +``` + +### Parameters + +| 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 or record | 49.99 | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference number for the sales receipt. | SR-00001 | +| `customer` | [OptionalNullable[models.LinkedCustomerInput]](../../models/linkedcustomerinput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `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: | Subtotal amount, normally before tax. | 250 | +| `total_tax` | *OptionalNullable[float]* | :heavy_minus_sign: | Total tax amount applied to this transaction. | 25 | +| `transaction_date` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `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.LinkedLedgerAccount]](../../models/linkedledgeraccount.md) | :heavy_minus_sign: | N/A | | +| `line_items` | List[[models.InvoiceLineItemInput](../../models/invoicelineiteminput.md)] | :heavy_minus_sign: | Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing. | | +| `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 sales receipt. | 5.5 | +| `discount_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | Discount amount applied to this sales receipt. | 25 | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional note to be associated with the sales receipt. | Thank you for your purchase | +| `customer_memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Customer memo | Thank you for your business and have a great day! | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference message for the sales receipt. | REF-123456 | +| `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 | | +| `department` | [OptionalNullable[models.LinkedDepartmentInput]](../../models/linkeddepartmentinput.md) | :heavy_minus_sign: | N/A | | +| `tracking_categories` | List[[Nullable[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 + +**[models.AccountingSalesReceiptsUpdateResponse](../../models/accountingsalesreceiptsupdateresponse.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 | \*/\* | + +## delete + +Delete Sales Receipt + +### Example Usage + + +```python +from apideck_unify import Apideck +import os + + +with Apideck( + consumer_id="test-consumer", + app_id="dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX", + api_key=os.getenv("APIDECK_API_KEY", ""), +) as apideck: + + res = apideck.accounting.sales_receipts.delete(id="", service_id="salesforce", raw=False, company_id="12345") + + assert res.delete_sales_receipt_response is not None + + # Handle response + print(res.delete_sales_receipt_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumer_id` | *Optional[str]* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `app_id` | *Optional[str]* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `service_id` | *Optional[str]* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional[bool]* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `company_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. | 12345 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[models.AccountingSalesReceiptsDeleteResponse](../../models/accountingsalesreceiptsdeleteresponse.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/pyproject.toml b/pyproject.toml index a9211300..3250ae55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "apideck-unify" -version = "0.36.0" +version = "0.37.0" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" diff --git a/src/apideck_unify/_version.py b/src/apideck_unify/_version.py index 58518d0e..49495e44 100644 --- a/src/apideck_unify/_version.py +++ b/src/apideck_unify/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "apideck-unify" -__version__: str = "0.36.0" -__openapi_doc_version__: str = "10.32.0" +__version__: str = "0.37.0" +__openapi_doc_version__: str = "10.34.0" __gen_version__: str = "2.753.1" -__user_agent__: str = "speakeasy-sdk/python 0.36.0 2.753.1 10.32.0 apideck-unify" +__user_agent__: str = "speakeasy-sdk/python 0.37.0 2.753.1 10.34.0 apideck-unify" try: if __package__ is not None: diff --git a/src/apideck_unify/accounting.py b/src/apideck_unify/accounting.py index 985058f8..e73e7321 100644 --- a/src/apideck_unify/accounting.py +++ b/src/apideck_unify/accounting.py @@ -33,6 +33,7 @@ from apideck_unify.purchaseorders import PurchaseOrders from apideck_unify.quotes import Quotes from apideck_unify.refunds import Refunds +from apideck_unify.salesreceipts import SalesReceipts from apideck_unify.subsidiaries import Subsidiaries from apideck_unify.suppliers import Suppliers from apideck_unify.taxrates import TaxRates @@ -57,6 +58,7 @@ class Accounting(BaseSDK): profit_and_loss: ProfitAndLossSDK journal_entries: JournalEntries general_ledger_transactions: GeneralLedgerTransactions + sales_receipts: SalesReceipts purchase_orders: PurchaseOrders subsidiaries: Subsidiaries locations: Locations @@ -117,6 +119,9 @@ def _init_sdks(self): self.general_ledger_transactions = GeneralLedgerTransactions( self.sdk_configuration, parent_ref=self.parent_ref ) + self.sales_receipts = SalesReceipts( + self.sdk_configuration, parent_ref=self.parent_ref + ) self.purchase_orders = PurchaseOrders( self.sdk_configuration, parent_ref=self.parent_ref ) diff --git a/src/apideck_unify/models/__init__.py b/src/apideck_unify/models/__init__.py index afa8f1f8..b79bc710 100644 --- a/src/apideck_unify/models/__init__.py +++ b/src/apideck_unify/models/__init__.py @@ -1008,6 +1008,46 @@ AccountingRefundsUpdateResponse, AccountingRefundsUpdateResponseTypedDict, ) + from .accounting_salesreceiptsaddop import ( + AccountingSalesReceiptsAddGlobals, + AccountingSalesReceiptsAddGlobalsTypedDict, + AccountingSalesReceiptsAddRequest, + AccountingSalesReceiptsAddRequestTypedDict, + AccountingSalesReceiptsAddResponse, + AccountingSalesReceiptsAddResponseTypedDict, + ) + from .accounting_salesreceiptsallop import ( + AccountingSalesReceiptsAllGlobals, + AccountingSalesReceiptsAllGlobalsTypedDict, + AccountingSalesReceiptsAllRequest, + AccountingSalesReceiptsAllRequestTypedDict, + AccountingSalesReceiptsAllResponse, + AccountingSalesReceiptsAllResponseTypedDict, + ) + from .accounting_salesreceiptsdeleteop import ( + AccountingSalesReceiptsDeleteGlobals, + AccountingSalesReceiptsDeleteGlobalsTypedDict, + AccountingSalesReceiptsDeleteRequest, + AccountingSalesReceiptsDeleteRequestTypedDict, + AccountingSalesReceiptsDeleteResponse, + AccountingSalesReceiptsDeleteResponseTypedDict, + ) + from .accounting_salesreceiptsoneop import ( + AccountingSalesReceiptsOneGlobals, + AccountingSalesReceiptsOneGlobalsTypedDict, + AccountingSalesReceiptsOneRequest, + AccountingSalesReceiptsOneRequestTypedDict, + AccountingSalesReceiptsOneResponse, + AccountingSalesReceiptsOneResponseTypedDict, + ) + from .accounting_salesreceiptsupdateop import ( + AccountingSalesReceiptsUpdateGlobals, + AccountingSalesReceiptsUpdateGlobalsTypedDict, + AccountingSalesReceiptsUpdateRequest, + AccountingSalesReceiptsUpdateRequestTypedDict, + AccountingSalesReceiptsUpdateResponse, + AccountingSalesReceiptsUpdateResponseTypedDict, + ) from .accounting_subsidiariesaddop import ( AccountingSubsidiariesAddGlobals, AccountingSubsidiariesAddGlobalsTypedDict, @@ -1903,6 +1943,10 @@ CreateRefundResponse, CreateRefundResponseTypedDict, ) + from .createsalesreceiptresponse import ( + CreateSalesReceiptResponse, + CreateSalesReceiptResponseTypedDict, + ) from .createsessionresponse import ( CreateSessionResponse, CreateSessionResponseData, @@ -2612,6 +2656,10 @@ DeleteRefundResponse, DeleteRefundResponseTypedDict, ) + from .deletesalesreceiptresponse import ( + DeleteSalesReceiptResponse, + DeleteSalesReceiptResponseTypedDict, + ) from .deletesharedlinkresponse import ( DeleteSharedLinkResponse, DeleteSharedLinkResponseTypedDict, @@ -3560,6 +3608,14 @@ from .getquotesresponse import GetQuotesResponse, GetQuotesResponseTypedDict from .getrefundresponse import GetRefundResponse, GetRefundResponseTypedDict from .getrefundsresponse import GetRefundsResponse, GetRefundsResponseTypedDict + from .getsalesreceiptresponse import ( + GetSalesReceiptResponse, + GetSalesReceiptResponseTypedDict, + ) + from .getsalesreceiptsresponse import ( + GetSalesReceiptsResponse, + GetSalesReceiptsResponseTypedDict, + ) from .getsharedlinkresponse import ( GetSharedLinkResponse, GetSharedLinkResponseTypedDict, @@ -4396,6 +4452,14 @@ ) from .resourcestatus import ResourceStatus from .responsevalidationerror import ResponseValidationError + from .salesreceipt import SalesReceipt, SalesReceiptTypedDict + from .salesreceipt_input import SalesReceiptInput, SalesReceiptInputTypedDict + from .salesreceiptsfilter import SalesReceiptsFilter, SalesReceiptsFilterTypedDict + from .salesreceiptssort import ( + SalesReceiptsSort, + SalesReceiptsSortBy, + SalesReceiptsSortTypedDict, + ) from .schedule import ( EvenWeeks, EvenWeeksTypedDict, @@ -4774,6 +4838,10 @@ UpdateRefundResponse, UpdateRefundResponseTypedDict, ) + from .updatesalesreceiptresponse import ( + UpdateSalesReceiptResponse, + UpdateSalesReceiptResponseTypedDict, + ) from .updatesharedlinkresponse import ( UpdateSharedLinkResponse, UpdateSharedLinkResponseTypedDict, @@ -5897,6 +5965,36 @@ "AccountingRefundsUpdateRequestTypedDict", "AccountingRefundsUpdateResponse", "AccountingRefundsUpdateResponseTypedDict", + "AccountingSalesReceiptsAddGlobals", + "AccountingSalesReceiptsAddGlobalsTypedDict", + "AccountingSalesReceiptsAddRequest", + "AccountingSalesReceiptsAddRequestTypedDict", + "AccountingSalesReceiptsAddResponse", + "AccountingSalesReceiptsAddResponseTypedDict", + "AccountingSalesReceiptsAllGlobals", + "AccountingSalesReceiptsAllGlobalsTypedDict", + "AccountingSalesReceiptsAllRequest", + "AccountingSalesReceiptsAllRequestTypedDict", + "AccountingSalesReceiptsAllResponse", + "AccountingSalesReceiptsAllResponseTypedDict", + "AccountingSalesReceiptsDeleteGlobals", + "AccountingSalesReceiptsDeleteGlobalsTypedDict", + "AccountingSalesReceiptsDeleteRequest", + "AccountingSalesReceiptsDeleteRequestTypedDict", + "AccountingSalesReceiptsDeleteResponse", + "AccountingSalesReceiptsDeleteResponseTypedDict", + "AccountingSalesReceiptsOneGlobals", + "AccountingSalesReceiptsOneGlobalsTypedDict", + "AccountingSalesReceiptsOneRequest", + "AccountingSalesReceiptsOneRequestTypedDict", + "AccountingSalesReceiptsOneResponse", + "AccountingSalesReceiptsOneResponseTypedDict", + "AccountingSalesReceiptsUpdateGlobals", + "AccountingSalesReceiptsUpdateGlobalsTypedDict", + "AccountingSalesReceiptsUpdateRequest", + "AccountingSalesReceiptsUpdateRequestTypedDict", + "AccountingSalesReceiptsUpdateResponse", + "AccountingSalesReceiptsUpdateResponseTypedDict", "AccountingSubsidiariesAddGlobals", "AccountingSubsidiariesAddGlobalsTypedDict", "AccountingSubsidiariesAddRequest", @@ -6524,6 +6622,8 @@ "CreateQuoteResponseTypedDict", "CreateRefundResponse", "CreateRefundResponseTypedDict", + "CreateSalesReceiptResponse", + "CreateSalesReceiptResponseTypedDict", "CreateSessionResponse", "CreateSessionResponseData", "CreateSessionResponseDataTypedDict", @@ -7039,6 +7139,8 @@ "DeleteQuoteResponseTypedDict", "DeleteRefundResponse", "DeleteRefundResponseTypedDict", + "DeleteSalesReceiptResponse", + "DeleteSalesReceiptResponseTypedDict", "DeleteSharedLinkResponse", "DeleteSharedLinkResponseTypedDict", "DeleteSubsidiaryResponse", @@ -7757,6 +7859,10 @@ "GetRefundResponseTypedDict", "GetRefundsResponse", "GetRefundsResponseTypedDict", + "GetSalesReceiptResponse", + "GetSalesReceiptResponseTypedDict", + "GetSalesReceiptsResponse", + "GetSalesReceiptsResponseTypedDict", "GetSharedLinkResponse", "GetSharedLinkResponseTypedDict", "GetSharedLinksResponse", @@ -8468,6 +8574,15 @@ "SalaryTypedDict", "SalesDetails", "SalesDetailsTypedDict", + "SalesReceipt", + "SalesReceiptInput", + "SalesReceiptInputTypedDict", + "SalesReceiptTypedDict", + "SalesReceiptsFilter", + "SalesReceiptsFilterTypedDict", + "SalesReceiptsSort", + "SalesReceiptsSortBy", + "SalesReceiptsSortTypedDict", "Schedule", "ScheduleStatus", "ScheduleTypedDict", @@ -8741,6 +8856,8 @@ "UpdateQuoteResponseTypedDict", "UpdateRefundResponse", "UpdateRefundResponseTypedDict", + "UpdateSalesReceiptResponse", + "UpdateSalesReceiptResponseTypedDict", "UpdateSharedLinkResponse", "UpdateSharedLinkResponseTypedDict", "UpdateSubsidiaryResponse", @@ -9748,6 +9865,36 @@ "AccountingRefundsUpdateRequestTypedDict": ".accounting_refundsupdateop", "AccountingRefundsUpdateResponse": ".accounting_refundsupdateop", "AccountingRefundsUpdateResponseTypedDict": ".accounting_refundsupdateop", + "AccountingSalesReceiptsAddGlobals": ".accounting_salesreceiptsaddop", + "AccountingSalesReceiptsAddGlobalsTypedDict": ".accounting_salesreceiptsaddop", + "AccountingSalesReceiptsAddRequest": ".accounting_salesreceiptsaddop", + "AccountingSalesReceiptsAddRequestTypedDict": ".accounting_salesreceiptsaddop", + "AccountingSalesReceiptsAddResponse": ".accounting_salesreceiptsaddop", + "AccountingSalesReceiptsAddResponseTypedDict": ".accounting_salesreceiptsaddop", + "AccountingSalesReceiptsAllGlobals": ".accounting_salesreceiptsallop", + "AccountingSalesReceiptsAllGlobalsTypedDict": ".accounting_salesreceiptsallop", + "AccountingSalesReceiptsAllRequest": ".accounting_salesreceiptsallop", + "AccountingSalesReceiptsAllRequestTypedDict": ".accounting_salesreceiptsallop", + "AccountingSalesReceiptsAllResponse": ".accounting_salesreceiptsallop", + "AccountingSalesReceiptsAllResponseTypedDict": ".accounting_salesreceiptsallop", + "AccountingSalesReceiptsDeleteGlobals": ".accounting_salesreceiptsdeleteop", + "AccountingSalesReceiptsDeleteGlobalsTypedDict": ".accounting_salesreceiptsdeleteop", + "AccountingSalesReceiptsDeleteRequest": ".accounting_salesreceiptsdeleteop", + "AccountingSalesReceiptsDeleteRequestTypedDict": ".accounting_salesreceiptsdeleteop", + "AccountingSalesReceiptsDeleteResponse": ".accounting_salesreceiptsdeleteop", + "AccountingSalesReceiptsDeleteResponseTypedDict": ".accounting_salesreceiptsdeleteop", + "AccountingSalesReceiptsOneGlobals": ".accounting_salesreceiptsoneop", + "AccountingSalesReceiptsOneGlobalsTypedDict": ".accounting_salesreceiptsoneop", + "AccountingSalesReceiptsOneRequest": ".accounting_salesreceiptsoneop", + "AccountingSalesReceiptsOneRequestTypedDict": ".accounting_salesreceiptsoneop", + "AccountingSalesReceiptsOneResponse": ".accounting_salesreceiptsoneop", + "AccountingSalesReceiptsOneResponseTypedDict": ".accounting_salesreceiptsoneop", + "AccountingSalesReceiptsUpdateGlobals": ".accounting_salesreceiptsupdateop", + "AccountingSalesReceiptsUpdateGlobalsTypedDict": ".accounting_salesreceiptsupdateop", + "AccountingSalesReceiptsUpdateRequest": ".accounting_salesreceiptsupdateop", + "AccountingSalesReceiptsUpdateRequestTypedDict": ".accounting_salesreceiptsupdateop", + "AccountingSalesReceiptsUpdateResponse": ".accounting_salesreceiptsupdateop", + "AccountingSalesReceiptsUpdateResponseTypedDict": ".accounting_salesreceiptsupdateop", "AccountingSubsidiariesAddGlobals": ".accounting_subsidiariesaddop", "AccountingSubsidiariesAddGlobalsTypedDict": ".accounting_subsidiariesaddop", "AccountingSubsidiariesAddRequest": ".accounting_subsidiariesaddop", @@ -10452,6 +10599,8 @@ "CreateQuoteResponseTypedDict": ".createquoteresponse", "CreateRefundResponse": ".createrefundresponse", "CreateRefundResponseTypedDict": ".createrefundresponse", + "CreateSalesReceiptResponse": ".createsalesreceiptresponse", + "CreateSalesReceiptResponseTypedDict": ".createsalesreceiptresponse", "CreateSessionResponse": ".createsessionresponse", "CreateSessionResponseData": ".createsessionresponse", "CreateSessionResponseDataTypedDict": ".createsessionresponse", @@ -10958,6 +11107,8 @@ "DeleteQuoteResponseTypedDict": ".deletequoteresponse", "DeleteRefundResponse": ".deleterefundresponse", "DeleteRefundResponseTypedDict": ".deleterefundresponse", + "DeleteSalesReceiptResponse": ".deletesalesreceiptresponse", + "DeleteSalesReceiptResponseTypedDict": ".deletesalesreceiptresponse", "DeleteSharedLinkResponse": ".deletesharedlinkresponse", "DeleteSharedLinkResponseTypedDict": ".deletesharedlinkresponse", "DeleteSubsidiaryResponse": ".deletesubsidiaryresponse", @@ -11659,6 +11810,10 @@ "GetRefundResponseTypedDict": ".getrefundresponse", "GetRefundsResponse": ".getrefundsresponse", "GetRefundsResponseTypedDict": ".getrefundsresponse", + "GetSalesReceiptResponse": ".getsalesreceiptresponse", + "GetSalesReceiptResponseTypedDict": ".getsalesreceiptresponse", + "GetSalesReceiptsResponse": ".getsalesreceiptsresponse", + "GetSalesReceiptsResponseTypedDict": ".getsalesreceiptsresponse", "GetSharedLinkResponse": ".getsharedlinkresponse", "GetSharedLinkResponseTypedDict": ".getsharedlinkresponse", "GetSharedLinksResponse": ".getsharedlinksresponse", @@ -12364,6 +12519,15 @@ "RequestCountAllocationTypedDict": ".requestcountallocation", "ResourceStatus": ".resourcestatus", "ResponseValidationError": ".responsevalidationerror", + "SalesReceipt": ".salesreceipt", + "SalesReceiptTypedDict": ".salesreceipt", + "SalesReceiptInput": ".salesreceipt_input", + "SalesReceiptInputTypedDict": ".salesreceipt_input", + "SalesReceiptsFilter": ".salesreceiptsfilter", + "SalesReceiptsFilterTypedDict": ".salesreceiptsfilter", + "SalesReceiptsSort": ".salesreceiptssort", + "SalesReceiptsSortBy": ".salesreceiptssort", + "SalesReceiptsSortTypedDict": ".salesreceiptssort", "EvenWeeks": ".schedule", "EvenWeeksTypedDict": ".schedule", "OddWeeks": ".schedule", @@ -12638,6 +12802,8 @@ "UpdateQuoteResponseTypedDict": ".updatequoteresponse", "UpdateRefundResponse": ".updaterefundresponse", "UpdateRefundResponseTypedDict": ".updaterefundresponse", + "UpdateSalesReceiptResponse": ".updatesalesreceiptresponse", + "UpdateSalesReceiptResponseTypedDict": ".updatesalesreceiptresponse", "UpdateSharedLinkResponse": ".updatesharedlinkresponse", "UpdateSharedLinkResponseTypedDict": ".updatesharedlinkresponse", "UpdateSubsidiaryResponse": ".updatesubsidiaryresponse", diff --git a/src/apideck_unify/models/accounting_salesreceiptsaddop.py b/src/apideck_unify/models/accounting_salesreceiptsaddop.py new file mode 100644 index 00000000..1b426395 --- /dev/null +++ b/src/apideck_unify/models/accounting_salesreceiptsaddop.py @@ -0,0 +1,119 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .createsalesreceiptresponse import ( + CreateSalesReceiptResponse, + CreateSalesReceiptResponseTypedDict, +) +from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict +from .salesreceipt_input import SalesReceiptInput, SalesReceiptInputTypedDict +from .unexpectederrorresponse import ( + UnexpectedErrorResponse, + UnexpectedErrorResponseTypedDict, +) +from apideck_unify.types import BaseModel +from apideck_unify.utils import ( + FieldMetadata, + HeaderMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountingSalesReceiptsAddGlobalsTypedDict(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 AccountingSalesReceiptsAddGlobals(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 AccountingSalesReceiptsAddRequestTypedDict(TypedDict): + sales_receipt: SalesReceiptInputTypedDict + raw: NotRequired[bool] + r"""Include raw response. Mostly used for debugging purposes""" + 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""" + 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.""" + company_id: NotRequired[str] + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + + +class AccountingSalesReceiptsAddRequest(BaseModel): + sales_receipt: Annotated[ + SalesReceiptInput, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + raw: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Include raw response. Mostly used for debugging purposes""" + + 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""" + + 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.""" + + company_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-company-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + + +class AccountingSalesReceiptsAddResponseTypedDict(TypedDict): + http_meta: HTTPMetadataTypedDict + create_sales_receipt_response: NotRequired[CreateSalesReceiptResponseTypedDict] + r"""SalesReceipt created""" + unexpected_error_response: NotRequired[UnexpectedErrorResponseTypedDict] + r"""Unexpected error""" + + +class AccountingSalesReceiptsAddResponse(BaseModel): + http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None + + create_sales_receipt_response: Optional[CreateSalesReceiptResponse] = None + r"""SalesReceipt created""" + + unexpected_error_response: Optional[UnexpectedErrorResponse] = None + r"""Unexpected error""" diff --git a/src/apideck_unify/models/accounting_salesreceiptsallop.py b/src/apideck_unify/models/accounting_salesreceiptsallop.py new file mode 100644 index 00000000..b63df650 --- /dev/null +++ b/src/apideck_unify/models/accounting_salesreceiptsallop.py @@ -0,0 +1,209 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .getsalesreceiptsresponse import ( + GetSalesReceiptsResponse, + GetSalesReceiptsResponseTypedDict, +) +from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict +from .salesreceiptsfilter import SalesReceiptsFilter, SalesReceiptsFilterTypedDict +from .salesreceiptssort import SalesReceiptsSort, SalesReceiptsSortTypedDict +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, Callable, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountingSalesReceiptsAllGlobalsTypedDict(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 AccountingSalesReceiptsAllGlobals(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 AccountingSalesReceiptsAllRequestTypedDict(TypedDict): + raw: NotRequired[bool] + r"""Include raw response. Mostly used for debugging purposes""" + 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""" + 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.""" + company_id: NotRequired[str] + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + cursor: NotRequired[Nullable[str]] + r"""Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.""" + limit: NotRequired[int] + r"""Number of results to return. Minimum 1, Maximum 200, Default 20""" + filter_: NotRequired[SalesReceiptsFilterTypedDict] + r"""Apply filters""" + sort: NotRequired[SalesReceiptsSortTypedDict] + r"""Apply sorting""" + 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 AccountingSalesReceiptsAllRequest(BaseModel): + raw: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Include raw response. Mostly used for debugging purposes""" + + 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""" + + 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.""" + + company_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-company-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + + cursor: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + r"""Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response.""" + + limit: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 20 + r"""Number of results to return. Minimum 1, Maximum 200, Default 20""" + + filter_: Annotated[ + Optional[SalesReceiptsFilter], + pydantic.Field(alias="filter"), + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = None + r"""Apply filters""" + + sort: Annotated[ + Optional[SalesReceiptsSort], + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = None + r"""Apply sorting""" + + 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", + "consumerId", + "appId", + "serviceId", + "companyId", + "cursor", + "limit", + "filter", + "sort", + "pass_through", + "fields", + ] + nullable_fields = ["cursor", "fields"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class AccountingSalesReceiptsAllResponseTypedDict(TypedDict): + http_meta: HTTPMetadataTypedDict + get_sales_receipts_response: NotRequired[GetSalesReceiptsResponseTypedDict] + r"""SalesReceipts""" + unexpected_error_response: NotRequired[UnexpectedErrorResponseTypedDict] + r"""Unexpected error""" + + +class AccountingSalesReceiptsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingSalesReceiptsAllResponse]] + + http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None + + get_sales_receipts_response: Optional[GetSalesReceiptsResponse] = None + r"""SalesReceipts""" + + unexpected_error_response: Optional[UnexpectedErrorResponse] = None + r"""Unexpected error""" diff --git a/src/apideck_unify/models/accounting_salesreceiptsdeleteop.py b/src/apideck_unify/models/accounting_salesreceiptsdeleteop.py new file mode 100644 index 00000000..1be56dbf --- /dev/null +++ b/src/apideck_unify/models/accounting_salesreceiptsdeleteop.py @@ -0,0 +1,119 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .deletesalesreceiptresponse import ( + DeleteSalesReceiptResponse, + DeleteSalesReceiptResponseTypedDict, +) +from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict +from .unexpectederrorresponse import ( + UnexpectedErrorResponse, + UnexpectedErrorResponseTypedDict, +) +from apideck_unify.types import BaseModel +from apideck_unify.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountingSalesReceiptsDeleteGlobalsTypedDict(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 AccountingSalesReceiptsDeleteGlobals(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 AccountingSalesReceiptsDeleteRequestTypedDict(TypedDict): + id: str + r"""ID of the record you are acting upon.""" + 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""" + 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.""" + raw: NotRequired[bool] + r"""Include raw response. Mostly used for debugging purposes""" + company_id: NotRequired[str] + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + + +class AccountingSalesReceiptsDeleteRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the record you are acting upon.""" + + 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""" + + 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.""" + + raw: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Include raw response. Mostly used for debugging purposes""" + + company_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-company-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + + +class AccountingSalesReceiptsDeleteResponseTypedDict(TypedDict): + http_meta: HTTPMetadataTypedDict + delete_sales_receipt_response: NotRequired[DeleteSalesReceiptResponseTypedDict] + r"""SalesReceipt deleted""" + unexpected_error_response: NotRequired[UnexpectedErrorResponseTypedDict] + r"""Unexpected error""" + + +class AccountingSalesReceiptsDeleteResponse(BaseModel): + http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None + + delete_sales_receipt_response: Optional[DeleteSalesReceiptResponse] = None + r"""SalesReceipt deleted""" + + unexpected_error_response: Optional[UnexpectedErrorResponse] = None + r"""Unexpected error""" diff --git a/src/apideck_unify/models/accounting_salesreceiptsoneop.py b/src/apideck_unify/models/accounting_salesreceiptsoneop.py new file mode 100644 index 00000000..9c94ff8c --- /dev/null +++ b/src/apideck_unify/models/accounting_salesreceiptsoneop.py @@ -0,0 +1,171 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .getsalesreceiptresponse import ( + GetSalesReceiptResponse, + GetSalesReceiptResponseTypedDict, +) +from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict +from .unexpectederrorresponse import ( + UnexpectedErrorResponse, + UnexpectedErrorResponseTypedDict, +) +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from apideck_unify.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountingSalesReceiptsOneGlobalsTypedDict(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 AccountingSalesReceiptsOneGlobals(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 AccountingSalesReceiptsOneRequestTypedDict(TypedDict): + id: str + r"""ID of the record you are acting upon.""" + 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""" + 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.""" + company_id: NotRequired[str] + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + raw: NotRequired[bool] + r"""Include raw response. Mostly used for debugging purposes""" + 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 AccountingSalesReceiptsOneRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the record you are acting upon.""" + + 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""" + + 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.""" + + company_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-company-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + + raw: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Include raw response. Mostly used for debugging purposes""" + + 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 = [ + "consumerId", + "appId", + "serviceId", + "companyId", + "raw", + "fields", + ] + nullable_fields = ["fields"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class AccountingSalesReceiptsOneResponseTypedDict(TypedDict): + http_meta: HTTPMetadataTypedDict + get_sales_receipt_response: NotRequired[GetSalesReceiptResponseTypedDict] + r"""SalesReceipt""" + unexpected_error_response: NotRequired[UnexpectedErrorResponseTypedDict] + r"""Unexpected error""" + + +class AccountingSalesReceiptsOneResponse(BaseModel): + http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None + + get_sales_receipt_response: Optional[GetSalesReceiptResponse] = None + r"""SalesReceipt""" + + unexpected_error_response: Optional[UnexpectedErrorResponse] = None + r"""Unexpected error""" diff --git a/src/apideck_unify/models/accounting_salesreceiptsupdateop.py b/src/apideck_unify/models/accounting_salesreceiptsupdateop.py new file mode 100644 index 00000000..6c524601 --- /dev/null +++ b/src/apideck_unify/models/accounting_salesreceiptsupdateop.py @@ -0,0 +1,127 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict +from .salesreceipt_input import SalesReceiptInput, SalesReceiptInputTypedDict +from .unexpectederrorresponse import ( + UnexpectedErrorResponse, + UnexpectedErrorResponseTypedDict, +) +from .updatesalesreceiptresponse import ( + UpdateSalesReceiptResponse, + UpdateSalesReceiptResponseTypedDict, +) +from apideck_unify.types import BaseModel +from apideck_unify.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountingSalesReceiptsUpdateGlobalsTypedDict(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 AccountingSalesReceiptsUpdateGlobals(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 AccountingSalesReceiptsUpdateRequestTypedDict(TypedDict): + id: str + r"""ID of the record you are acting upon.""" + sales_receipt: SalesReceiptInputTypedDict + 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""" + 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.""" + raw: NotRequired[bool] + r"""Include raw response. Mostly used for debugging purposes""" + company_id: NotRequired[str] + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + + +class AccountingSalesReceiptsUpdateRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""ID of the record you are acting upon.""" + + sales_receipt: Annotated[ + SalesReceiptInput, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + 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""" + + 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.""" + + raw: Annotated[ + Optional[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""Include raw response. Mostly used for debugging purposes""" + + company_id: Annotated[ + Optional[str], + pydantic.Field(alias="x-apideck-company-id"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = None + r"""The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings.""" + + +class AccountingSalesReceiptsUpdateResponseTypedDict(TypedDict): + http_meta: HTTPMetadataTypedDict + update_sales_receipt_response: NotRequired[UpdateSalesReceiptResponseTypedDict] + r"""SalesReceipt updated""" + unexpected_error_response: NotRequired[UnexpectedErrorResponseTypedDict] + r"""Unexpected error""" + + +class AccountingSalesReceiptsUpdateResponse(BaseModel): + http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None + + update_sales_receipt_response: Optional[UpdateSalesReceiptResponse] = None + r"""SalesReceipt updated""" + + unexpected_error_response: Optional[UnexpectedErrorResponse] = None + r"""Unexpected error""" diff --git a/src/apideck_unify/models/attachment.py b/src/apideck_unify/models/attachment.py index c27a37c0..67dee5a6 100644 --- a/src/apideck_unify/models/attachment.py +++ b/src/apideck_unify/models/attachment.py @@ -30,6 +30,8 @@ class AttachmentTypedDict(TypedDict): reference: NotRequired[AttachmentReferenceTypedDict] description: NotRequired[Nullable[str]] r"""Optional description of the file""" + file_url: NotRequired[Nullable[str]] + r"""The URL to download or preview the file""" parent_folder_id: NotRequired[Nullable[str]] r"""The folder id where this attachment belong to""" updated_by: NotRequired[Nullable[str]] @@ -65,6 +67,9 @@ class Attachment(BaseModel): description: OptionalNullable[str] = UNSET r"""Optional description of the file""" + file_url: OptionalNullable[str] = UNSET + r"""The URL to download or preview the file""" + parent_folder_id: OptionalNullable[str] = UNSET r"""The folder id where this attachment belong to""" @@ -93,6 +98,7 @@ def serialize_model(self, handler): "size", "reference", "description", + "file_url", "parent_folder_id", "updated_by", "created_by", @@ -106,6 +112,7 @@ def serialize_model(self, handler): "mime_type", "size", "description", + "file_url", "parent_folder_id", "updated_by", "created_by", diff --git a/src/apideck_unify/models/createsalesreceiptresponse.py b/src/apideck_unify/models/createsalesreceiptresponse.py new file mode 100644 index 00000000..00c96c80 --- /dev/null +++ b/src/apideck_unify/models/createsalesreceiptresponse.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .unifiedid import UnifiedID, UnifiedIDTypedDict +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateSalesReceiptResponseTypedDict(TypedDict): + r"""SalesReceipt created""" + + 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: UnifiedIDTypedDict + r"""A object containing a unique identifier for the resource that was created, updated, or deleted.""" + raw: NotRequired[Nullable[Dict[str, Any]]] + r"""Raw response from the integration when raw=true query param is provided""" + + +class CreateSalesReceiptResponse(BaseModel): + r"""SalesReceipt created""" + + 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: UnifiedID + r"""A object containing a unique identifier for the resource that was created, updated, or deleted.""" + + raw: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_raw")] = ( + UNSET + ) + r"""Raw response from the integration when raw=true query param is provided""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["_raw"] + nullable_fields = ["_raw"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/apideck_unify/models/deletesalesreceiptresponse.py b/src/apideck_unify/models/deletesalesreceiptresponse.py new file mode 100644 index 00000000..b63ad38b --- /dev/null +++ b/src/apideck_unify/models/deletesalesreceiptresponse.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .unifiedid import UnifiedID, UnifiedIDTypedDict +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DeleteSalesReceiptResponseTypedDict(TypedDict): + r"""SalesReceipt deleted""" + + 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: UnifiedIDTypedDict + r"""A object containing a unique identifier for the resource that was created, updated, or deleted.""" + raw: NotRequired[Nullable[Dict[str, Any]]] + r"""Raw response from the integration when raw=true query param is provided""" + + +class DeleteSalesReceiptResponse(BaseModel): + r"""SalesReceipt deleted""" + + 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: UnifiedID + r"""A object containing a unique identifier for the resource that was created, updated, or deleted.""" + + raw: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_raw")] = ( + UNSET + ) + r"""Raw response from the integration when raw=true query param is provided""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["_raw"] + nullable_fields = ["_raw"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/apideck_unify/models/getsalesreceiptresponse.py b/src/apideck_unify/models/getsalesreceiptresponse.py new file mode 100644 index 00000000..86224919 --- /dev/null +++ b/src/apideck_unify/models/getsalesreceiptresponse.py @@ -0,0 +1,95 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .meta import Meta, MetaTypedDict +from .salesreceipt import SalesReceipt, SalesReceiptTypedDict +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetSalesReceiptResponseTypedDict(TypedDict): + r"""SalesReceipt""" + + 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: SalesReceiptTypedDict + meta: NotRequired[MetaTypedDict] + r"""Response metadata""" + raw: NotRequired[Nullable[Dict[str, Any]]] + r"""Raw response from the integration when raw=true query param is provided""" + + +class GetSalesReceiptResponse(BaseModel): + r"""SalesReceipt""" + + 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: SalesReceipt + + meta: Optional[Meta] = None + r"""Response metadata""" + + raw: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_raw")] = ( + UNSET + ) + r"""Raw response from the integration when raw=true query param is provided""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["meta", "_raw"] + nullable_fields = ["_raw"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/apideck_unify/models/getsalesreceiptsresponse.py b/src/apideck_unify/models/getsalesreceiptsresponse.py new file mode 100644 index 00000000..be85fad7 --- /dev/null +++ b/src/apideck_unify/models/getsalesreceiptsresponse.py @@ -0,0 +1,101 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .meta import Meta, MetaTypedDict +from .salesreceipt import SalesReceipt, SalesReceiptTypedDict +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetSalesReceiptsResponseTypedDict(TypedDict): + r"""SalesReceipts""" + + 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: List[SalesReceiptTypedDict] + meta: NotRequired[MetaTypedDict] + r"""Response metadata""" + links: NotRequired[LinksTypedDict] + r"""Links to navigate to previous or next pages through the API""" + raw: NotRequired[Nullable[Dict[str, Any]]] + r"""Raw response from the integration when raw=true query param is provided""" + + +class GetSalesReceiptsResponse(BaseModel): + r"""SalesReceipts""" + + 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: List[SalesReceipt] + + meta: Optional[Meta] = None + r"""Response metadata""" + + links: Optional[Links] = None + r"""Links to navigate to previous or next pages through the API""" + + raw: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_raw")] = ( + UNSET + ) + r"""Raw response from the integration when raw=true query param is provided""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["meta", "links", "_raw"] + nullable_fields = ["_raw"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/apideck_unify/models/salesreceipt.py b/src/apideck_unify/models/salesreceipt.py new file mode 100644 index 00000000..fca3ce21 --- /dev/null +++ b/src/apideck_unify/models/salesreceipt.py @@ -0,0 +1,294 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .address import Address, AddressTypedDict +from .currency import Currency +from .customfield import CustomField, CustomFieldTypedDict +from .invoicelineitem import InvoiceLineItem, InvoiceLineItemTypedDict +from .linkedcustomer import LinkedCustomer, LinkedCustomerTypedDict +from .linkeddepartment import LinkedDepartment, LinkedDepartmentTypedDict +from .linkedledgeraccount import LinkedLedgerAccount, LinkedLedgerAccountTypedDict +from .linkedtrackingcategory import ( + LinkedTrackingCategory, + LinkedTrackingCategoryTypedDict, +) +from .passthroughbody import PassThroughBody, PassThroughBodyTypedDict +from apideck_unify import models +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from apideck_unify.utils import validate_open_enum +from datetime import datetime +from pydantic import field_serializer, model_serializer +from pydantic.functional_validators import PlainValidator +from typing import Any, Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SalesReceiptTypedDict(TypedDict): + id: str + r"""Unique identifier representing the sales receipt""" + total_amount: Nullable[float] + r"""The total amount of the transaction or record""" + number: NotRequired[Nullable[str]] + r"""Reference number for the sales receipt.""" + customer: NotRequired[Nullable[LinkedCustomerTypedDict]] + r"""The customer this entity is linked to.""" + 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).""" + currency_rate: NotRequired[Nullable[float]] + r"""Currency Exchange Rate at the time entity was recorded/generated.""" + tax_inclusive: NotRequired[Nullable[bool]] + r"""Amounts are including tax""" + sub_total: NotRequired[Nullable[float]] + r"""Subtotal amount, normally before tax.""" + total_tax: NotRequired[Nullable[float]] + r"""Total tax amount applied to this transaction.""" + transaction_date: NotRequired[Nullable[datetime]] + r"""The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD""" + payment_method: NotRequired[Nullable[str]] + r"""Payment method used for the transaction, such as cash, credit card, bank transfer, or check""" + payment_method_reference: NotRequired[Nullable[str]] + r"""Optional reference message returned by payment method on processing""" + payment_method_id: NotRequired[Nullable[str]] + r"""A unique identifier for an object.""" + account: NotRequired[Nullable[LinkedLedgerAccountTypedDict]] + line_items: NotRequired[List[InvoiceLineItemTypedDict]] + r"""Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing.""" + tax_code: NotRequired[Nullable[str]] + r"""Applicable tax id/code override if tax is not supplied on a line item basis.""" + discount_percentage: NotRequired[Nullable[float]] + r"""Discount percentage applied to this sales receipt.""" + discount_amount: NotRequired[Nullable[float]] + r"""Discount amount applied to this sales receipt.""" + note: NotRequired[Nullable[str]] + r"""Optional note to be associated with the sales receipt.""" + customer_memo: NotRequired[Nullable[str]] + r"""Customer memo""" + reference: NotRequired[Nullable[str]] + r"""Optional reference message for the sales receipt.""" + billing_address: NotRequired[AddressTypedDict] + shipping_address: NotRequired[AddressTypedDict] + department: NotRequired[Nullable[LinkedDepartmentTypedDict]] + tracking_categories: NotRequired[ + Nullable[List[Nullable[LinkedTrackingCategoryTypedDict]]] + ] + r"""A list of linked tracking categories.""" + custom_mappings: NotRequired[Nullable[Dict[str, Any]]] + r"""When custom mappings are configured on the resource, the result is included here.""" + custom_fields: NotRequired[List[CustomFieldTypedDict]] + row_version: NotRequired[Nullable[str]] + r"""A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object.""" + updated_by: NotRequired[Nullable[str]] + r"""The user who last updated the object.""" + created_by: NotRequired[Nullable[str]] + r"""The user who created the object.""" + updated_at: NotRequired[Nullable[datetime]] + r"""The date and time when the object was last updated.""" + created_at: NotRequired[Nullable[datetime]] + r"""The date and time when the object was created.""" + pass_through: NotRequired[List[PassThroughBodyTypedDict]] + r"""The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.""" + + +class SalesReceipt(BaseModel): + id: str + r"""Unique identifier representing the sales receipt""" + + total_amount: Nullable[float] + r"""The total amount of the transaction or record""" + + number: OptionalNullable[str] = UNSET + r"""Reference number for the sales receipt.""" + + customer: OptionalNullable[LinkedCustomer] = UNSET + r"""The customer this entity is linked to.""" + + currency: Annotated[ + OptionalNullable[Currency], PlainValidator(validate_open_enum(False)) + ] = UNSET + r"""Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).""" + + currency_rate: OptionalNullable[float] = UNSET + r"""Currency Exchange Rate at the time entity was recorded/generated.""" + + tax_inclusive: OptionalNullable[bool] = UNSET + r"""Amounts are including tax""" + + sub_total: OptionalNullable[float] = UNSET + r"""Subtotal amount, normally before tax.""" + + total_tax: OptionalNullable[float] = UNSET + r"""Total tax amount applied to this transaction.""" + + transaction_date: OptionalNullable[datetime] = UNSET + r"""The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD""" + + payment_method: OptionalNullable[str] = UNSET + r"""Payment method used for the transaction, such as cash, credit card, bank transfer, or check""" + + payment_method_reference: OptionalNullable[str] = UNSET + r"""Optional reference message returned by payment method on processing""" + + payment_method_id: OptionalNullable[str] = UNSET + r"""A unique identifier for an object.""" + + account: OptionalNullable[LinkedLedgerAccount] = UNSET + + line_items: Optional[List[InvoiceLineItem]] = None + r"""Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing.""" + + tax_code: OptionalNullable[str] = UNSET + r"""Applicable tax id/code override if tax is not supplied on a line item basis.""" + + discount_percentage: OptionalNullable[float] = UNSET + r"""Discount percentage applied to this sales receipt.""" + + discount_amount: OptionalNullable[float] = UNSET + r"""Discount amount applied to this sales receipt.""" + + note: OptionalNullable[str] = UNSET + r"""Optional note to be associated with the sales receipt.""" + + customer_memo: OptionalNullable[str] = UNSET + r"""Customer memo""" + + reference: OptionalNullable[str] = UNSET + r"""Optional reference message for the sales receipt.""" + + billing_address: Optional[Address] = None + + shipping_address: Optional[Address] = None + + department: OptionalNullable[LinkedDepartment] = UNSET + + tracking_categories: OptionalNullable[List[Nullable[LinkedTrackingCategory]]] = ( + UNSET + ) + r"""A list of linked tracking categories.""" + + custom_mappings: OptionalNullable[Dict[str, Any]] = UNSET + r"""When custom mappings are configured on the resource, the result is included here.""" + + custom_fields: Optional[List[CustomField]] = None + + row_version: OptionalNullable[str] = UNSET + r"""A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object.""" + + updated_by: OptionalNullable[str] = UNSET + r"""The user who last updated the object.""" + + created_by: OptionalNullable[str] = UNSET + r"""The user who created the object.""" + + updated_at: OptionalNullable[datetime] = UNSET + r"""The date and time when the object was last updated.""" + + created_at: OptionalNullable[datetime] = UNSET + r"""The date and time when the object was created.""" + + pass_through: Optional[List[PassThroughBody]] = None + r"""The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.""" + + @field_serializer("currency") + def serialize_currency(self, value): + if isinstance(value, str): + try: + return models.Currency(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "number", + "customer", + "currency", + "currency_rate", + "tax_inclusive", + "sub_total", + "total_tax", + "transaction_date", + "payment_method", + "payment_method_reference", + "payment_method_id", + "account", + "line_items", + "tax_code", + "discount_percentage", + "discount_amount", + "note", + "customer_memo", + "reference", + "billing_address", + "shipping_address", + "department", + "tracking_categories", + "custom_mappings", + "custom_fields", + "row_version", + "updated_by", + "created_by", + "updated_at", + "created_at", + "pass_through", + ] + nullable_fields = [ + "number", + "customer", + "currency", + "currency_rate", + "tax_inclusive", + "sub_total", + "total_amount", + "total_tax", + "transaction_date", + "payment_method", + "payment_method_reference", + "payment_method_id", + "account", + "tax_code", + "discount_percentage", + "discount_amount", + "note", + "customer_memo", + "reference", + "department", + "tracking_categories", + "custom_mappings", + "row_version", + "updated_by", + "created_by", + "updated_at", + "created_at", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/apideck_unify/models/salesreceipt_input.py b/src/apideck_unify/models/salesreceipt_input.py new file mode 100644 index 00000000..6ccf5f6f --- /dev/null +++ b/src/apideck_unify/models/salesreceipt_input.py @@ -0,0 +1,257 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .address import Address, AddressTypedDict +from .currency import Currency +from .customfield import CustomField, CustomFieldTypedDict +from .invoicelineitem import InvoiceLineItemInput, InvoiceLineItemInputTypedDict +from .linkedcustomer_input import LinkedCustomerInput, LinkedCustomerInputTypedDict +from .linkeddepartment_input import ( + LinkedDepartmentInput, + LinkedDepartmentInputTypedDict, +) +from .linkedledgeraccount import LinkedLedgerAccount, LinkedLedgerAccountTypedDict +from .linkedtrackingcategory import ( + LinkedTrackingCategory, + LinkedTrackingCategoryTypedDict, +) +from .passthroughbody import PassThroughBody, PassThroughBodyTypedDict +from apideck_unify import models +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from apideck_unify.utils import validate_open_enum +from datetime import datetime +from pydantic import field_serializer, model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SalesReceiptInputTypedDict(TypedDict): + total_amount: Nullable[float] + r"""The total amount of the transaction or record""" + number: NotRequired[Nullable[str]] + r"""Reference number for the sales receipt.""" + customer: NotRequired[Nullable[LinkedCustomerInputTypedDict]] + r"""The customer this entity is linked to.""" + 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).""" + currency_rate: NotRequired[Nullable[float]] + r"""Currency Exchange Rate at the time entity was recorded/generated.""" + tax_inclusive: NotRequired[Nullable[bool]] + r"""Amounts are including tax""" + sub_total: NotRequired[Nullable[float]] + r"""Subtotal amount, normally before tax.""" + total_tax: NotRequired[Nullable[float]] + r"""Total tax amount applied to this transaction.""" + transaction_date: NotRequired[Nullable[datetime]] + r"""The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD""" + payment_method: NotRequired[Nullable[str]] + r"""Payment method used for the transaction, such as cash, credit card, bank transfer, or check""" + payment_method_reference: NotRequired[Nullable[str]] + r"""Optional reference message returned by payment method on processing""" + payment_method_id: NotRequired[Nullable[str]] + r"""A unique identifier for an object.""" + account: NotRequired[Nullable[LinkedLedgerAccountTypedDict]] + line_items: NotRequired[List[InvoiceLineItemInputTypedDict]] + r"""Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing.""" + tax_code: NotRequired[Nullable[str]] + r"""Applicable tax id/code override if tax is not supplied on a line item basis.""" + discount_percentage: NotRequired[Nullable[float]] + r"""Discount percentage applied to this sales receipt.""" + discount_amount: NotRequired[Nullable[float]] + r"""Discount amount applied to this sales receipt.""" + note: NotRequired[Nullable[str]] + r"""Optional note to be associated with the sales receipt.""" + customer_memo: NotRequired[Nullable[str]] + r"""Customer memo""" + reference: NotRequired[Nullable[str]] + r"""Optional reference message for the sales receipt.""" + billing_address: NotRequired[AddressTypedDict] + shipping_address: NotRequired[AddressTypedDict] + department: NotRequired[Nullable[LinkedDepartmentInputTypedDict]] + tracking_categories: NotRequired[ + Nullable[List[Nullable[LinkedTrackingCategoryTypedDict]]] + ] + r"""A list of linked tracking categories.""" + custom_fields: NotRequired[List[CustomFieldTypedDict]] + row_version: NotRequired[Nullable[str]] + r"""A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object.""" + pass_through: NotRequired[List[PassThroughBodyTypedDict]] + r"""The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.""" + + +class SalesReceiptInput(BaseModel): + total_amount: Nullable[float] + r"""The total amount of the transaction or record""" + + number: OptionalNullable[str] = UNSET + r"""Reference number for the sales receipt.""" + + customer: OptionalNullable[LinkedCustomerInput] = UNSET + r"""The customer this entity is linked to.""" + + currency: Annotated[ + OptionalNullable[Currency], PlainValidator(validate_open_enum(False)) + ] = UNSET + r"""Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).""" + + currency_rate: OptionalNullable[float] = UNSET + r"""Currency Exchange Rate at the time entity was recorded/generated.""" + + tax_inclusive: OptionalNullable[bool] = UNSET + r"""Amounts are including tax""" + + sub_total: OptionalNullable[float] = UNSET + r"""Subtotal amount, normally before tax.""" + + total_tax: OptionalNullable[float] = UNSET + r"""Total tax amount applied to this transaction.""" + + transaction_date: OptionalNullable[datetime] = UNSET + r"""The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD""" + + payment_method: OptionalNullable[str] = UNSET + r"""Payment method used for the transaction, such as cash, credit card, bank transfer, or check""" + + payment_method_reference: OptionalNullable[str] = UNSET + r"""Optional reference message returned by payment method on processing""" + + payment_method_id: OptionalNullable[str] = UNSET + r"""A unique identifier for an object.""" + + account: OptionalNullable[LinkedLedgerAccount] = UNSET + + line_items: Optional[List[InvoiceLineItemInput]] = None + r"""Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing.""" + + tax_code: OptionalNullable[str] = UNSET + r"""Applicable tax id/code override if tax is not supplied on a line item basis.""" + + discount_percentage: OptionalNullable[float] = UNSET + r"""Discount percentage applied to this sales receipt.""" + + discount_amount: OptionalNullable[float] = UNSET + r"""Discount amount applied to this sales receipt.""" + + note: OptionalNullable[str] = UNSET + r"""Optional note to be associated with the sales receipt.""" + + customer_memo: OptionalNullable[str] = UNSET + r"""Customer memo""" + + reference: OptionalNullable[str] = UNSET + r"""Optional reference message for the sales receipt.""" + + billing_address: Optional[Address] = None + + shipping_address: Optional[Address] = None + + department: OptionalNullable[LinkedDepartmentInput] = UNSET + + tracking_categories: OptionalNullable[List[Nullable[LinkedTrackingCategory]]] = ( + UNSET + ) + r"""A list of linked tracking categories.""" + + custom_fields: Optional[List[CustomField]] = None + + row_version: OptionalNullable[str] = UNSET + r"""A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object.""" + + pass_through: Optional[List[PassThroughBody]] = None + r"""The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources.""" + + @field_serializer("currency") + def serialize_currency(self, value): + if isinstance(value, str): + try: + return models.Currency(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "number", + "customer", + "currency", + "currency_rate", + "tax_inclusive", + "sub_total", + "total_tax", + "transaction_date", + "payment_method", + "payment_method_reference", + "payment_method_id", + "account", + "line_items", + "tax_code", + "discount_percentage", + "discount_amount", + "note", + "customer_memo", + "reference", + "billing_address", + "shipping_address", + "department", + "tracking_categories", + "custom_fields", + "row_version", + "pass_through", + ] + nullable_fields = [ + "number", + "customer", + "currency", + "currency_rate", + "tax_inclusive", + "sub_total", + "total_amount", + "total_tax", + "transaction_date", + "payment_method", + "payment_method_reference", + "payment_method_id", + "account", + "tax_code", + "discount_percentage", + "discount_amount", + "note", + "customer_memo", + "reference", + "department", + "tracking_categories", + "row_version", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/apideck_unify/models/salesreceiptsfilter.py b/src/apideck_unify/models/salesreceiptsfilter.py new file mode 100644 index 00000000..5cf2c27d --- /dev/null +++ b/src/apideck_unify/models/salesreceiptsfilter.py @@ -0,0 +1,21 @@ +"""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 datetime import datetime +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SalesReceiptsFilterTypedDict(TypedDict): + updated_since: NotRequired[datetime] + customer_id: NotRequired[str] + r"""Filter by customer id""" + + +class SalesReceiptsFilter(BaseModel): + updated_since: Annotated[Optional[datetime], FieldMetadata(query=True)] = None + + customer_id: Annotated[Optional[str], FieldMetadata(query=True)] = None + r"""Filter by customer id""" diff --git a/src/apideck_unify/models/salesreceiptssort.py b/src/apideck_unify/models/salesreceiptssort.py new file mode 100644 index 00000000..d65b6f16 --- /dev/null +++ b/src/apideck_unify/models/salesreceiptssort.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .sortdirection import SortDirection +from apideck_unify import models, utils +from apideck_unify.types import BaseModel +from apideck_unify.utils import FieldMetadata, validate_open_enum +from enum import Enum +from pydantic import field_serializer +from pydantic.functional_validators import PlainValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SalesReceiptsSortBy(str, Enum, metaclass=utils.OpenEnumMeta): + r"""The field on which to sort the Sales Receipts.""" + + UPDATED_AT = "updated_at" + CREATED_AT = "created_at" + + +class SalesReceiptsSortTypedDict(TypedDict): + by: NotRequired[SalesReceiptsSortBy] + r"""The field on which to sort the Sales Receipts.""" + direction: NotRequired[SortDirection] + r"""The direction in which to sort the results""" + + +class SalesReceiptsSort(BaseModel): + by: Annotated[ + Annotated[ + Optional[SalesReceiptsSortBy], PlainValidator(validate_open_enum(False)) + ], + FieldMetadata(query=True), + ] = None + r"""The field on which to sort the Sales Receipts.""" + + direction: Annotated[ + Annotated[Optional[SortDirection], PlainValidator(validate_open_enum(False))], + FieldMetadata(query=True), + ] = SortDirection.ASC + r"""The direction in which to sort the results""" + + @field_serializer("by") + def serialize_by(self, value): + if isinstance(value, str): + try: + return models.SalesReceiptsSortBy(value) + except ValueError: + return value + return value + + @field_serializer("direction") + def serialize_direction(self, value): + if isinstance(value, str): + try: + return models.SortDirection(value) + except ValueError: + return value + return value diff --git a/src/apideck_unify/models/updatesalesreceiptresponse.py b/src/apideck_unify/models/updatesalesreceiptresponse.py new file mode 100644 index 00000000..1683424d --- /dev/null +++ b/src/apideck_unify/models/updatesalesreceiptresponse.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .unifiedid import UnifiedID, UnifiedIDTypedDict +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateSalesReceiptResponseTypedDict(TypedDict): + r"""SalesReceipt updated""" + + 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: UnifiedIDTypedDict + r"""A object containing a unique identifier for the resource that was created, updated, or deleted.""" + raw: NotRequired[Nullable[Dict[str, Any]]] + r"""Raw response from the integration when raw=true query param is provided""" + + +class UpdateSalesReceiptResponse(BaseModel): + r"""SalesReceipt updated""" + + 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: UnifiedID + r"""A object containing a unique identifier for the resource that was created, updated, or deleted.""" + + raw: Annotated[OptionalNullable[Dict[str, Any]], pydantic.Field(alias="_raw")] = ( + UNSET + ) + r"""Raw response from the integration when raw=true query param is provided""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["_raw"] + nullable_fields = ["_raw"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/apideck_unify/salesreceipts.py b/src/apideck_unify/salesreceipts.py new file mode 100644 index 00000000..54673c24 --- /dev/null +++ b/src/apideck_unify/salesreceipts.py @@ -0,0 +1,2067 @@ +"""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 Nullable, OptionalNullable, UNSET +from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response +from datetime import datetime +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union + + +class SalesReceipts(BaseSDK): + def list( + self, + *, + raw: Optional[bool] = False, + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + company_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.SalesReceiptsFilter, models.SalesReceiptsFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.SalesReceiptsSort, models.SalesReceiptsSortTypedDict] + ] = 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, + ) -> Optional[models.AccountingSalesReceiptsAllResponse]: + r"""List Sales Receipts + + List Sales Receipts + + :param raw: Include raw response. Mostly used for debugging purposes + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsAllRequest( + raw=raw, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + company_id=company_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.SalesReceiptsFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.SalesReceiptsSort]), + pass_through=pass_through, + fields=fields, + ) + + req = self._build_request( + method="GET", + path="/accounting/sales-receipts", + 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.AccountingSalesReceiptsAllGlobals( + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsAll", + oauth2_scopes=None, + 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, + ) + + def next_func() -> Optional[models.AccountingSalesReceiptsAllResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return None + + return self.list( + raw=raw, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + company_id=company_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.AccountingSalesReceiptsAllResponse( + get_sales_receipts_response=unmarshal_json_response( + Optional[models.GetSalesReceiptsResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + next=next_func, + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsAllResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + next=next_func, + ) + + raise models.APIError("Unexpected response received", http_res) + + async def list_async( + self, + *, + raw: Optional[bool] = False, + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + company_id: Optional[str] = None, + cursor: OptionalNullable[str] = UNSET, + limit: Optional[int] = 20, + filter_: Optional[ + Union[models.SalesReceiptsFilter, models.SalesReceiptsFilterTypedDict] + ] = None, + sort: Optional[ + Union[models.SalesReceiptsSort, models.SalesReceiptsSortTypedDict] + ] = 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, + ) -> Optional[models.AccountingSalesReceiptsAllResponse]: + r"""List Sales Receipts + + List Sales Receipts + + :param raw: Include raw response. Mostly used for debugging purposes + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsAllRequest( + raw=raw, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + company_id=company_id, + cursor=cursor, + limit=limit, + filter_=utils.get_pydantic_model( + filter_, Optional[models.SalesReceiptsFilter] + ), + sort=utils.get_pydantic_model(sort, Optional[models.SalesReceiptsSort]), + pass_through=pass_through, + fields=fields, + ) + + req = self._build_request_async( + method="GET", + path="/accounting/sales-receipts", + 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.AccountingSalesReceiptsAllGlobals( + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsAll", + oauth2_scopes=None, + 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, + ) + + def next_func() -> Optional[models.AccountingSalesReceiptsAllResponse]: + body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]]) + next_cursor = JSONPath("$.meta.cursors.next").parse(body) + + if len(next_cursor) == 0: + return None + + next_cursor = next_cursor[0] + if next_cursor is None or str(next_cursor).strip() == "": + return None + + return self.list( + raw=raw, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + company_id=company_id, + cursor=next_cursor, + limit=limit, + filter_=filter_, + sort=sort, + pass_through=pass_through, + fields=fields, + retries=retries, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.AccountingSalesReceiptsAllResponse( + get_sales_receipts_response=unmarshal_json_response( + Optional[models.GetSalesReceiptsResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + next=next_func, + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsAllResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + next=next_func, + ) + + raise models.APIError("Unexpected response received", http_res) + + def create( + self, + *, + total_amount: Nullable[float], + raw: Optional[bool] = False, + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + company_id: Optional[str] = None, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = 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, + transaction_date: OptionalNullable[datetime] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[models.LinkedLedgerAccount, models.LinkedLedgerAccountTypedDict] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + tax_code: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + discount_amount: OptionalNullable[float] = UNSET, + note: OptionalNullable[str] = UNSET, + customer_memo: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + department: OptionalNullable[ + Union[models.LinkedDepartmentInput, models.LinkedDepartmentInputTypedDict] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[Nullable[models.LinkedTrackingCategory]], + List[Nullable[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.AccountingSalesReceiptsAddResponse: + r"""Create Sales Receipt + + Create Sales Receipt + + :param total_amount: The total amount of the transaction or record + :param raw: Include raw response. Mostly used for debugging purposes + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :param number: Reference number for the sales receipt. + :param customer: The customer this entity is linked 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: Subtotal amount, normally before tax. + :param total_tax: Total tax amount applied to this transaction. + :param transaction_date: The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD + :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 line_items: Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing. + :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 sales receipt. + :param discount_amount: Discount amount applied to this sales receipt. + :param note: Optional note to be associated with the sales receipt. + :param customer_memo: Customer memo + :param reference: Optional reference message for the sales receipt. + :param billing_address: + :param shipping_address: + :param department: + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsAddRequest( + raw=raw, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + company_id=company_id, + sales_receipt=models.SalesReceiptInput( + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_amount=total_amount, + total_tax=total_tax, + transaction_date=transaction_date, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccount] + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + tax_code=tax_code, + discount_percentage=discount_percentage, + discount_amount=discount_amount, + note=note, + customer_memo=customer_memo, + reference=reference, + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + department=utils.get_pydantic_model( + department, OptionalNullable[models.LinkedDepartmentInput] + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[Nullable[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( + method="POST", + path="/accounting/sales-receipts", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + 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.AccountingSalesReceiptsAddGlobals( + consumer_id=self.sdk_configuration.globals.consumer_id, + app_id=self.sdk_configuration.globals.app_id, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.sales_receipt, False, False, "json", models.SalesReceiptInput + ), + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsAdd", + oauth2_scopes=None, + 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, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return models.AccountingSalesReceiptsAddResponse( + create_sales_receipt_response=unmarshal_json_response( + Optional[models.CreateSalesReceiptResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsAddResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + + raise models.APIError("Unexpected response received", http_res) + + async def create_async( + self, + *, + total_amount: Nullable[float], + raw: Optional[bool] = False, + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + company_id: Optional[str] = None, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = 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, + transaction_date: OptionalNullable[datetime] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[models.LinkedLedgerAccount, models.LinkedLedgerAccountTypedDict] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + tax_code: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + discount_amount: OptionalNullable[float] = UNSET, + note: OptionalNullable[str] = UNSET, + customer_memo: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + department: OptionalNullable[ + Union[models.LinkedDepartmentInput, models.LinkedDepartmentInputTypedDict] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[Nullable[models.LinkedTrackingCategory]], + List[Nullable[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.AccountingSalesReceiptsAddResponse: + r"""Create Sales Receipt + + Create Sales Receipt + + :param total_amount: The total amount of the transaction or record + :param raw: Include raw response. Mostly used for debugging purposes + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :param number: Reference number for the sales receipt. + :param customer: The customer this entity is linked 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: Subtotal amount, normally before tax. + :param total_tax: Total tax amount applied to this transaction. + :param transaction_date: The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD + :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 line_items: Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing. + :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 sales receipt. + :param discount_amount: Discount amount applied to this sales receipt. + :param note: Optional note to be associated with the sales receipt. + :param customer_memo: Customer memo + :param reference: Optional reference message for the sales receipt. + :param billing_address: + :param shipping_address: + :param department: + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsAddRequest( + raw=raw, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + company_id=company_id, + sales_receipt=models.SalesReceiptInput( + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_amount=total_amount, + total_tax=total_tax, + transaction_date=transaction_date, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccount] + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + tax_code=tax_code, + discount_percentage=discount_percentage, + discount_amount=discount_amount, + note=note, + customer_memo=customer_memo, + reference=reference, + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + department=utils.get_pydantic_model( + department, OptionalNullable[models.LinkedDepartmentInput] + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[Nullable[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( + method="POST", + path="/accounting/sales-receipts", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + 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.AccountingSalesReceiptsAddGlobals( + consumer_id=self.sdk_configuration.globals.consumer_id, + app_id=self.sdk_configuration.globals.app_id, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.sales_receipt, False, False, "json", models.SalesReceiptInput + ), + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsAdd", + oauth2_scopes=None, + 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, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return models.AccountingSalesReceiptsAddResponse( + create_sales_receipt_response=unmarshal_json_response( + Optional[models.CreateSalesReceiptResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsAddResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + + raise models.APIError("Unexpected response received", http_res) + + def get( + self, + *, + id: str, + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + company_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.AccountingSalesReceiptsOneResponse: + r"""Get Sales Receipt + + Get Sales Receipt + + :param id: ID of the record you are acting upon. + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsOneRequest( + id=id, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + company_id=company_id, + raw=raw, + fields=fields, + ) + + req = self._build_request( + method="GET", + path="/accounting/sales-receipts/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingSalesReceiptsOneGlobals( + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsOne", + oauth2_scopes=None, + 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, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.AccountingSalesReceiptsOneResponse( + get_sales_receipt_response=unmarshal_json_response( + Optional[models.GetSalesReceiptResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsOneResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + + raise models.APIError("Unexpected response received", http_res) + + async def get_async( + self, + *, + id: str, + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + company_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.AccountingSalesReceiptsOneResponse: + r"""Get Sales Receipt + + Get Sales Receipt + + :param id: ID of the record you are acting upon. + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. + :param company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsOneRequest( + id=id, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + company_id=company_id, + raw=raw, + fields=fields, + ) + + req = self._build_request_async( + method="GET", + path="/accounting/sales-receipts/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingSalesReceiptsOneGlobals( + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsOne", + oauth2_scopes=None, + 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, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.AccountingSalesReceiptsOneResponse( + get_sales_receipt_response=unmarshal_json_response( + Optional[models.GetSalesReceiptResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsOneResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + + raise models.APIError("Unexpected response received", http_res) + + def update( + self, + *, + id: str, + total_amount: Nullable[float], + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + company_id: Optional[str] = None, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = 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, + transaction_date: OptionalNullable[datetime] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[models.LinkedLedgerAccount, models.LinkedLedgerAccountTypedDict] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + tax_code: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + discount_amount: OptionalNullable[float] = UNSET, + note: OptionalNullable[str] = UNSET, + customer_memo: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + department: OptionalNullable[ + Union[models.LinkedDepartmentInput, models.LinkedDepartmentInputTypedDict] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[Nullable[models.LinkedTrackingCategory]], + List[Nullable[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.AccountingSalesReceiptsUpdateResponse: + r"""Update Sales Receipt + + Update Sales Receipt + + :param id: ID of the record you are acting upon. + :param total_amount: The total amount of the transaction or record + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide 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 company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :param number: Reference number for the sales receipt. + :param customer: The customer this entity is linked 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: Subtotal amount, normally before tax. + :param total_tax: Total tax amount applied to this transaction. + :param transaction_date: The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD + :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 line_items: Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing. + :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 sales receipt. + :param discount_amount: Discount amount applied to this sales receipt. + :param note: Optional note to be associated with the sales receipt. + :param customer_memo: Customer memo + :param reference: Optional reference message for the sales receipt. + :param billing_address: + :param shipping_address: + :param department: + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsUpdateRequest( + id=id, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + raw=raw, + company_id=company_id, + sales_receipt=models.SalesReceiptInput( + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_amount=total_amount, + total_tax=total_tax, + transaction_date=transaction_date, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccount] + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + tax_code=tax_code, + discount_percentage=discount_percentage, + discount_amount=discount_amount, + note=note, + customer_memo=customer_memo, + reference=reference, + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + department=utils.get_pydantic_model( + department, OptionalNullable[models.LinkedDepartmentInput] + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[Nullable[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( + method="PATCH", + path="/accounting/sales-receipts/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingSalesReceiptsUpdateGlobals( + consumer_id=self.sdk_configuration.globals.consumer_id, + app_id=self.sdk_configuration.globals.app_id, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.sales_receipt, False, False, "json", models.SalesReceiptInput + ), + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsUpdate", + oauth2_scopes=None, + 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, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.AccountingSalesReceiptsUpdateResponse( + update_sales_receipt_response=unmarshal_json_response( + Optional[models.UpdateSalesReceiptResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsUpdateResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + + raise models.APIError("Unexpected response received", http_res) + + async def update_async( + self, + *, + id: str, + total_amount: Nullable[float], + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + company_id: Optional[str] = None, + number: OptionalNullable[str] = UNSET, + customer: OptionalNullable[ + Union[models.LinkedCustomerInput, models.LinkedCustomerInputTypedDict] + ] = 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, + transaction_date: OptionalNullable[datetime] = UNSET, + payment_method: OptionalNullable[str] = UNSET, + payment_method_reference: OptionalNullable[str] = UNSET, + payment_method_id: OptionalNullable[str] = UNSET, + account: OptionalNullable[ + Union[models.LinkedLedgerAccount, models.LinkedLedgerAccountTypedDict] + ] = UNSET, + line_items: Optional[ + Union[ + List[models.InvoiceLineItemInput], + List[models.InvoiceLineItemInputTypedDict], + ] + ] = None, + tax_code: OptionalNullable[str] = UNSET, + discount_percentage: OptionalNullable[float] = UNSET, + discount_amount: OptionalNullable[float] = UNSET, + note: OptionalNullable[str] = UNSET, + customer_memo: OptionalNullable[str] = UNSET, + reference: OptionalNullable[str] = UNSET, + billing_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + shipping_address: Optional[ + Union[models.Address, models.AddressTypedDict] + ] = None, + department: OptionalNullable[ + Union[models.LinkedDepartmentInput, models.LinkedDepartmentInputTypedDict] + ] = UNSET, + tracking_categories: OptionalNullable[ + Union[ + List[Nullable[models.LinkedTrackingCategory]], + List[Nullable[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.AccountingSalesReceiptsUpdateResponse: + r"""Update Sales Receipt + + Update Sales Receipt + + :param id: ID of the record you are acting upon. + :param total_amount: The total amount of the transaction or record + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide 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 company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :param number: Reference number for the sales receipt. + :param customer: The customer this entity is linked 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: Subtotal amount, normally before tax. + :param total_tax: Total tax amount applied to this transaction. + :param transaction_date: The date of the sales receipt transaction - YYYY-MM-DDThh:mm:ss.sTZD + :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 line_items: Line items for itemized sales receipts. Used when the sales receipt includes product/service details with quantities and pricing. + :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 sales receipt. + :param discount_amount: Discount amount applied to this sales receipt. + :param note: Optional note to be associated with the sales receipt. + :param customer_memo: Customer memo + :param reference: Optional reference message for the sales receipt. + :param billing_address: + :param shipping_address: + :param department: + :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 + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsUpdateRequest( + id=id, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + raw=raw, + company_id=company_id, + sales_receipt=models.SalesReceiptInput( + number=number, + customer=utils.get_pydantic_model( + customer, OptionalNullable[models.LinkedCustomerInput] + ), + currency=currency, + currency_rate=currency_rate, + tax_inclusive=tax_inclusive, + sub_total=sub_total, + total_amount=total_amount, + total_tax=total_tax, + transaction_date=transaction_date, + payment_method=payment_method, + payment_method_reference=payment_method_reference, + payment_method_id=payment_method_id, + account=utils.get_pydantic_model( + account, OptionalNullable[models.LinkedLedgerAccount] + ), + line_items=utils.get_pydantic_model( + line_items, Optional[List[models.InvoiceLineItemInput]] + ), + tax_code=tax_code, + discount_percentage=discount_percentage, + discount_amount=discount_amount, + note=note, + customer_memo=customer_memo, + reference=reference, + billing_address=utils.get_pydantic_model( + billing_address, Optional[models.Address] + ), + shipping_address=utils.get_pydantic_model( + shipping_address, Optional[models.Address] + ), + department=utils.get_pydantic_model( + department, OptionalNullable[models.LinkedDepartmentInput] + ), + tracking_categories=utils.get_pydantic_model( + tracking_categories, + OptionalNullable[List[Nullable[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( + method="PATCH", + path="/accounting/sales-receipts/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingSalesReceiptsUpdateGlobals( + consumer_id=self.sdk_configuration.globals.consumer_id, + app_id=self.sdk_configuration.globals.app_id, + ), + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.sales_receipt, False, False, "json", models.SalesReceiptInput + ), + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsUpdate", + oauth2_scopes=None, + 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, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.AccountingSalesReceiptsUpdateResponse( + update_sales_receipt_response=unmarshal_json_response( + Optional[models.UpdateSalesReceiptResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsUpdateResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + + raise models.APIError("Unexpected response received", http_res) + + def delete( + self, + *, + id: str, + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + company_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.AccountingSalesReceiptsDeleteResponse: + r"""Delete Sales Receipt + + Delete Sales Receipt + + :param id: ID of the record you are acting upon. + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide 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 company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request 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 + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsDeleteRequest( + id=id, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + raw=raw, + company_id=company_id, + ) + + req = self._build_request( + method="DELETE", + path="/accounting/sales-receipts/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingSalesReceiptsDeleteGlobals( + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsDelete", + oauth2_scopes=None, + 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, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.AccountingSalesReceiptsDeleteResponse( + delete_sales_receipt_response=unmarshal_json_response( + Optional[models.DeleteSalesReceiptResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsDeleteResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + + raise models.APIError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + id: str, + consumer_id: Optional[str] = None, + app_id: Optional[str] = None, + service_id: Optional[str] = None, + raw: Optional[bool] = False, + company_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.AccountingSalesReceiptsDeleteResponse: + r"""Delete Sales Receipt + + Delete Sales Receipt + + :param id: ID of the record you are acting upon. + :param consumer_id: ID of the consumer which you want to get or push data from + :param app_id: The ID of your Unify application + :param service_id: Provide 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 company_id: The ID of the company to scope requests to. For connectors that support multi-company, this overrides the default company configured in connection settings. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request 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 + else: + base_url = self._get_url(base_url, url_variables) + + request = models.AccountingSalesReceiptsDeleteRequest( + id=id, + consumer_id=consumer_id, + app_id=app_id, + service_id=service_id, + raw=raw, + company_id=company_id, + ) + + req = self._build_request_async( + method="DELETE", + path="/accounting/sales-receipts/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + _globals=models.AccountingSalesReceiptsDeleteGlobals( + 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, 900000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="accounting.salesReceiptsDelete", + oauth2_scopes=None, + 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, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return models.AccountingSalesReceiptsDeleteResponse( + delete_sales_receipt_response=unmarshal_json_response( + Optional[models.DeleteSalesReceiptResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + models.BadRequestResponseData, http_res + ) + raise models.BadRequestResponse(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + models.UnauthorizedResponseData, http_res + ) + raise models.UnauthorizedResponse(response_data, http_res) + if utils.match_response(http_res, "402", "application/json"): + response_data = unmarshal_json_response( + models.PaymentRequiredResponseData, http_res + ) + raise models.PaymentRequiredResponse(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + models.NotFoundResponseData, http_res + ) + raise models.NotFoundResponse(response_data, http_res) + if utils.match_response(http_res, "422", "application/json"): + response_data = unmarshal_json_response( + models.UnprocessableResponseData, http_res + ) + raise models.UnprocessableResponse(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "default", "application/json"): + return models.AccountingSalesReceiptsDeleteResponse( + unexpected_error_response=unmarshal_json_response( + Optional[models.UnexpectedErrorResponse], http_res + ), + http_meta=models.HTTPMetadata(request=req, response=http_res), + ) + + raise models.APIError("Unexpected response received", http_res)