From cd0d209b334206259b10d332ca062507a5d82384 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 9 Jun 2026 00:53:34 +0000 Subject: [PATCH 1/2] ## Python SDK Changes Detected: * `apideck.accounting.general_ledger_transactions.list()`: **Added** * `apideck.accounting.general_ledger_transactions.get()`: **Added** * `apideck.accounting.journal_entries.list()`: `request.filter` **Changed** --- .speakeasy/gen.lock | 163 +++- .speakeasy/gen.yaml | 5 +- .speakeasy/workflow.lock | 12 +- README.md | 7 +- RELEASES.md | 12 +- ...tinggeneralledgertransactionsallglobals.md | 9 + ...tinggeneralledgertransactionsallrequest.md | 18 + ...inggeneralledgertransactionsallresponse.md | 10 + ...tinggeneralledgertransactionsoneglobals.md | 9 + ...tinggeneralledgertransactionsonerequest.md | 14 + ...inggeneralledgertransactionsoneresponse.md | 10 + docs/models/generalledgertransaction.md | 24 + .../generalledgertransactionlineitem.md | 16 + .../generalledgertransactionlineitemtype.md | 11 + .../models/generalledgertransactionsfilter.md | 10 + .../generalledgertransactionsourcetype.md | 18 + docs/models/generalledgertransactionssort.md | 9 + .../models/generalledgertransactionssortby.md | 12 + .../getgeneralledgertransactionresponse.md | 16 + .../getgeneralledgertransactionsresponse.md | 18 + docs/models/journalentriesfilter.md | 9 +- docs/models/journalentriesfilterscope.md | 11 + docs/models/sourcetype.md | 18 + docs/sdks/generalledgertransactions/README.md | 133 ++++ pyproject.toml | 2 +- src/apideck_unify/_version.py | 4 +- src/apideck_unify/accounting.py | 5 + .../generalledgertransactions.py | 712 ++++++++++++++++++ src/apideck_unify/models/__init__.py | 103 +++ ...counting_generalledgertransactionsallop.py | 219 ++++++ ...counting_generalledgertransactionsoneop.py | 175 +++++ .../models/generalledgertransaction.py | 209 +++++ .../generalledgertransactionlineitem.py | 138 ++++ .../models/generalledgertransactionsfilter.py | 58 ++ .../models/generalledgertransactionssort.py | 62 ++ .../getgeneralledgertransactionresponse.py | 92 +++ .../getgeneralledgertransactionsresponse.py | 104 +++ .../models/journalentriesfilter.py | 27 + 38 files changed, 2458 insertions(+), 26 deletions(-) create mode 100644 docs/models/accountinggeneralledgertransactionsallglobals.md create mode 100644 docs/models/accountinggeneralledgertransactionsallrequest.md create mode 100644 docs/models/accountinggeneralledgertransactionsallresponse.md create mode 100644 docs/models/accountinggeneralledgertransactionsoneglobals.md create mode 100644 docs/models/accountinggeneralledgertransactionsonerequest.md create mode 100644 docs/models/accountinggeneralledgertransactionsoneresponse.md create mode 100644 docs/models/generalledgertransaction.md create mode 100644 docs/models/generalledgertransactionlineitem.md create mode 100644 docs/models/generalledgertransactionlineitemtype.md create mode 100644 docs/models/generalledgertransactionsfilter.md create mode 100644 docs/models/generalledgertransactionsourcetype.md create mode 100644 docs/models/generalledgertransactionssort.md create mode 100644 docs/models/generalledgertransactionssortby.md create mode 100644 docs/models/getgeneralledgertransactionresponse.md create mode 100644 docs/models/getgeneralledgertransactionsresponse.md create mode 100644 docs/models/journalentriesfilterscope.md create mode 100644 docs/models/sourcetype.md create mode 100644 docs/sdks/generalledgertransactions/README.md create mode 100644 src/apideck_unify/generalledgertransactions.py create mode 100644 src/apideck_unify/models/accounting_generalledgertransactionsallop.py create mode 100644 src/apideck_unify/models/accounting_generalledgertransactionsoneop.py create mode 100644 src/apideck_unify/models/generalledgertransaction.py create mode 100644 src/apideck_unify/models/generalledgertransactionlineitem.py create mode 100644 src/apideck_unify/models/generalledgertransactionsfilter.py create mode 100644 src/apideck_unify/models/generalledgertransactionssort.py create mode 100644 src/apideck_unify/models/getgeneralledgertransactionresponse.py create mode 100644 src/apideck_unify/models/getgeneralledgertransactionsresponse.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 23dd40f4..a8279099 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: 0b751af49a20956c0cb7e4baa53246b1 + docChecksum: 4efebc8e2d2418710623df7f4137c32c docVersion: 10.24.40 speakeasyVersion: 1.656.1 generationVersion: 2.753.1 - releaseVersion: 0.31.19 - configChecksum: 8b7e87669f4d31bafde68f64508cf937 + releaseVersion: 0.31.20 + configChecksum: 9aae5bcc5cadaec9547fd3fce85a2a0c repoURL: https://github.com/apideck-libraries/sdk-python.git installationURL: https://github.com/apideck-libraries/sdk-python.git published: true @@ -282,6 +282,12 @@ generatedFiles: - docs/models/accountingexpensesupdateglobals.md - docs/models/accountingexpensesupdaterequest.md - docs/models/accountingexpensesupdateresponse.md + - docs/models/accountinggeneralledgertransactionsallglobals.md + - docs/models/accountinggeneralledgertransactionsallrequest.md + - docs/models/accountinggeneralledgertransactionsallresponse.md + - docs/models/accountinggeneralledgertransactionsoneglobals.md + - docs/models/accountinggeneralledgertransactionsonerequest.md + - docs/models/accountinggeneralledgertransactionsoneresponse.md - docs/models/accountinginvoiceitemsaddglobals.md - docs/models/accountinginvoiceitemsaddrequest.md - docs/models/accountinginvoiceitemsaddresponse.md @@ -1267,6 +1273,13 @@ generatedFiles: - docs/models/formfieldtype.md - docs/models/fulfillmentstatus.md - docs/models/gender.md + - docs/models/generalledgertransaction.md + - docs/models/generalledgertransactionlineitem.md + - docs/models/generalledgertransactionlineitemtype.md + - docs/models/generalledgertransactionsfilter.md + - docs/models/generalledgertransactionsourcetype.md + - docs/models/generalledgertransactionssort.md + - docs/models/generalledgertransactionssortby.md - docs/models/getaccountingdepartmentresponse.md - docs/models/getaccountingdepartmentsresponse.md - docs/models/getaccountingemployeeresponse.md @@ -1355,6 +1368,8 @@ generatedFiles: - docs/models/getfileresponse.md - docs/models/getfilesresponse.md - docs/models/getfolderresponse.md + - docs/models/getgeneralledgertransactionresponse.md + - docs/models/getgeneralledgertransactionsresponse.md - docs/models/gethriscompaniesresponse.md - docs/models/gethriscompanyresponse.md - docs/models/getinvoiceitemresponse.md @@ -1574,6 +1589,7 @@ generatedFiles: - docs/models/jobstatus.md - docs/models/jobtype.md - docs/models/journalentriesfilter.md + - docs/models/journalentriesfilterscope.md - docs/models/journalentriesfilterstatus.md - docs/models/journalentriessort.md - docs/models/journalentriessortby.md @@ -1809,6 +1825,7 @@ generatedFiles: - docs/models/sociallinks.md - docs/models/sortby.md - docs/models/sortdirection.md + - docs/models/sourcetype.md - docs/models/stage.md - docs/models/stages.md - docs/models/statementstatus.md @@ -2110,6 +2127,7 @@ generatedFiles: - docs/sdks/expenses/README.md - docs/sdks/files/README.md - docs/sdks/folders/README.md + - docs/sdks/generalledgertransactions/README.md - docs/sdks/invoiceitems/README.md - docs/sdks/invoices/README.md - docs/sdks/jobs/README.md @@ -2220,6 +2238,7 @@ generatedFiles: - src/apideck_unify/files.py - src/apideck_unify/filestorage.py - src/apideck_unify/folders.py + - src/apideck_unify/generalledgertransactions.py - src/apideck_unify/hris.py - src/apideck_unify/httpclient.py - src/apideck_unify/invoiceitems.py @@ -2305,6 +2324,8 @@ generatedFiles: - src/apideck_unify/models/accounting_expensesdeleteop.py - src/apideck_unify/models/accounting_expensesoneop.py - src/apideck_unify/models/accounting_expensesupdateop.py + - src/apideck_unify/models/accounting_generalledgertransactionsallop.py + - src/apideck_unify/models/accounting_generalledgertransactionsoneop.py - src/apideck_unify/models/accounting_invoiceitemsaddop.py - src/apideck_unify/models/accounting_invoiceitemsallop.py - src/apideck_unify/models/accounting_invoiceitemsdeleteop.py @@ -2765,6 +2786,10 @@ generatedFiles: - src/apideck_unify/models/formfieldoption.py - src/apideck_unify/models/formfieldoptiongroup.py - src/apideck_unify/models/gender.py + - src/apideck_unify/models/generalledgertransaction.py + - src/apideck_unify/models/generalledgertransactionlineitem.py + - src/apideck_unify/models/generalledgertransactionsfilter.py + - src/apideck_unify/models/generalledgertransactionssort.py - src/apideck_unify/models/getaccountingdepartmentresponse.py - src/apideck_unify/models/getaccountingdepartmentsresponse.py - src/apideck_unify/models/getaccountingemployeeresponse.py @@ -2853,6 +2878,8 @@ generatedFiles: - src/apideck_unify/models/getfileresponse.py - src/apideck_unify/models/getfilesresponse.py - src/apideck_unify/models/getfolderresponse.py + - src/apideck_unify/models/getgeneralledgertransactionresponse.py + - src/apideck_unify/models/getgeneralledgertransactionsresponse.py - src/apideck_unify/models/gethriscompaniesresponse.py - src/apideck_unify/models/gethriscompanyresponse.py - src/apideck_unify/models/getinvoiceitemresponse.py @@ -19659,9 +19686,71 @@ 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.generalLedgerTransactionsAll: + speakeasy-default-accounting-general-ledger-transactions-all: + parameters: + query: + raw: false + limit: 20 + filter: {"source_type": "invoice", "updated_since": "2024-09-30T07:43:32.000Z"} + sort: {"by": "posted_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": "xero", "resource": "general-ledger-transactions", "operation": "all", "data": [], "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}}, "links": {"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", "current": "https://unify.apideck.com/crm/companies", "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "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.generalLedgerTransactionsOne: + speakeasy-default-accounting-general-ledger-transactions-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": "xero", "resource": "general-ledger-transactions", "operation": "one", "data": {"id": "12345", "source_type": "invoice", "source_id": "12345", "posted_at": "2020-09-30T07:43:32.000Z", "reference": "INV-2024-001", "number": "JNL-001", "currency": "USD", "currency_rate": 0.69, "memo": "Year-end adjustment for inventory revaluation", "line_items": [{"id": "12345", "description": "Sales revenue from Q3 batch", "net_amount": 27500, "type": "debit", "tax_amount": 0, "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"}, "line_number": 1}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "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:\n* `apideck.crm.notes.list()`: `request.filter` **Added**\n* `apideck.crm.users.list()`: \n * `request.filter` **Added**\n * `response.data.[].name` **Added**\n* `apideck.crm.users.create()`: `request.name` **Added**\n* `apideck.crm.users.get()`: `response.data.name` **Added**\n* `apideck.crm.users.update()`: `request.name` **Added**\n" +releaseNotes: | + ## Python SDK Changes Detected: + * `apideck.accounting.general_ledger_transactions.list()`: **Added** + * `apideck.accounting.general_ledger_transactions.get()`: **Added** + * `apideck.accounting.journal_entries.list()`: `request.filter` **Changed** trackedFiles: .devcontainer/README.md: last_write_checksum: sha1:07adb0c0c051a9be4d479ea06461f3a9b3bbeb2f @@ -20133,6 +20222,18 @@ trackedFiles: last_write_checksum: sha1:649afc75e803cce6376bbed159716fe8895b06f1 docs/models/accountingexpensesupdateresponse.md: last_write_checksum: sha1:a0abf9ee705650d2635889c9e4290e4e62224020 + docs/models/accountinggeneralledgertransactionsallglobals.md: + last_write_checksum: sha1:38519a695a79d26796b99ff10fbd41f421085eb1 + docs/models/accountinggeneralledgertransactionsallrequest.md: + last_write_checksum: sha1:8772e92463f4ac8b8929ac44762b0d2d9ee84fc0 + docs/models/accountinggeneralledgertransactionsallresponse.md: + last_write_checksum: sha1:2174048bb8496990be42a0305ab574e2b0722f4f + docs/models/accountinggeneralledgertransactionsoneglobals.md: + last_write_checksum: sha1:e3304e64f211bb5e10547c3119fd63655bac85e0 + docs/models/accountinggeneralledgertransactionsonerequest.md: + last_write_checksum: sha1:0e78eea4c69dfca5a47ad05fc789c4d178fc6774 + docs/models/accountinggeneralledgertransactionsoneresponse.md: + last_write_checksum: sha1:02cab03b73369a9338217cf585a87822c8976b03 docs/models/accountinginvoiceitemsaddglobals.md: last_write_checksum: sha1:f8592854bba1844b0ead8ed5969c3cad022c1e19 docs/models/accountinginvoiceitemsaddrequest.md: @@ -22103,6 +22204,20 @@ trackedFiles: last_write_checksum: sha1:2d75cb4474b6c2343e4281383c19576a98eb3586 docs/models/gender.md: last_write_checksum: sha1:3c95ab15d15027e740e4c2feef121f6330266de6 + docs/models/generalledgertransaction.md: + last_write_checksum: sha1:96741147e9ddbe207f306773b1a1c3dd1fb79002 + docs/models/generalledgertransactionlineitem.md: + last_write_checksum: sha1:20d54b1701e36f66f40c6352dcfcacd5811afdbd + docs/models/generalledgertransactionlineitemtype.md: + last_write_checksum: sha1:a86b1e8ca6aba7ddad5bee31ec36b8ed7071be3a + docs/models/generalledgertransactionsfilter.md: + last_write_checksum: sha1:34771ef56027c3701400aad862cbe8e983442fbc + docs/models/generalledgertransactionsourcetype.md: + last_write_checksum: sha1:f82ee546b8c3f752042b0a2bbe6e2fdbf5c30b19 + docs/models/generalledgertransactionssort.md: + last_write_checksum: sha1:45bc6b8f55364f5bd51033cbcd7f6e3818efe2f2 + docs/models/generalledgertransactionssortby.md: + last_write_checksum: sha1:7eee207c072c5dd529b07452d66cc93789f3ed15 docs/models/getaccountingdepartmentresponse.md: last_write_checksum: sha1:d9869be1a8ab2046d52d13eea2ea153f9e5f9aa1 docs/models/getaccountingdepartmentsresponse.md: @@ -22279,6 +22394,10 @@ trackedFiles: last_write_checksum: sha1:b1fcde70e8d4eac16675a9c1b65478f6b5b43a26 docs/models/getfolderresponse.md: last_write_checksum: sha1:9086812860b8388193aca5493de972854b0e3a83 + docs/models/getgeneralledgertransactionresponse.md: + last_write_checksum: sha1:b33ebb6c16f3539acef4011dd992349745a6b9b5 + docs/models/getgeneralledgertransactionsresponse.md: + last_write_checksum: sha1:df1538f189cbc1786ed4e66b703c00f0870095fc docs/models/gethriscompaniesresponse.md: last_write_checksum: sha1:d7c7a8d91c9249964b5a9e5a6616eeaa68c73d75 docs/models/gethriscompanyresponse.md: @@ -22716,7 +22835,9 @@ trackedFiles: docs/models/jobtype.md: last_write_checksum: sha1:e6ebaadba669092d88c14d3127d44a218002e927 docs/models/journalentriesfilter.md: - last_write_checksum: sha1:142b451ee4315bb32a360e0cdfe9935b99d7aa2e + last_write_checksum: sha1:bd6c3cf5e2ecbca4dfabed67b789c35c060a2049 + docs/models/journalentriesfilterscope.md: + last_write_checksum: sha1:df5230ed4aadb3058cabc89269c06fd6a5b24014 docs/models/journalentriesfilterstatus.md: last_write_checksum: sha1:7d06dbfa7f479fd73b375e18fd1ca8fa2133b1ff docs/models/journalentriessort.md: @@ -23187,6 +23308,8 @@ trackedFiles: last_write_checksum: sha1:a1067d89003e4adda3e2c1f467a1d771020ee472 docs/models/sortdirection.md: last_write_checksum: sha1:53cc6d6adc98c85b2880671af1849b2234e07135 + docs/models/sourcetype.md: + last_write_checksum: sha1:a185f8161b55b088ca98cb972e86e9cb09681572 docs/models/stage.md: last_write_checksum: sha1:7d473faebd54bf8372b4015caf38490029ffc210 docs/models/stages.md: @@ -23789,6 +23912,8 @@ trackedFiles: last_write_checksum: sha1:6fafca167285487e1d60275037ff6cb4ac3978f3 docs/sdks/folders/README.md: last_write_checksum: sha1:2997e8070c3ac42b86e6a3b8e611ab6a468c54ab + docs/sdks/generalledgertransactions/README.md: + last_write_checksum: sha1:a6f1e311d62ca308340a41b8e124abd30e6477c0 docs/sdks/invoiceitems/README.md: last_write_checksum: sha1:d2426572c3480a9b6d0befefb7256a11051b7d76 docs/sdks/invoices/README.md: @@ -23878,9 +24003,9 @@ trackedFiles: src/apideck_unify/_hooks/types.py: last_write_checksum: sha1:4b923d3d84d979af6169a9db6b81bfc373079a25 src/apideck_unify/_version.py: - last_write_checksum: sha1:be6ae553b3103cd4961604d2a39332c7a0038e23 + last_write_checksum: sha1:43f6b6d6ea3f467b0c062faae4f7c4fc7f743701 src/apideck_unify/accounting.py: - last_write_checksum: sha1:afb8958c0092d6bbc935597b72e8a96d2b82b4aa + last_write_checksum: sha1:63ea555e29266c0cbe993e2bddf21ffecd9b02b9 src/apideck_unify/activities.py: last_write_checksum: sha1:b5f87574cb7834aaeaa00d231d4437dbecade8ef src/apideck_unify/agedcreditors_sdk.py: @@ -24009,6 +24134,8 @@ trackedFiles: last_write_checksum: sha1:cf935b847c21f965790ff3c0c664c0223aa0d78c src/apideck_unify/folders.py: last_write_checksum: sha1:e43449d48fb4728f3972587855660d10f9d49403 + src/apideck_unify/generalledgertransactions.py: + last_write_checksum: sha1:1c7638275f70bf7ec7afa564c428d37a2521e7d4 src/apideck_unify/hris.py: last_write_checksum: sha1:912ec8837c4f787eb3151a5184689536b586cc44 src/apideck_unify/httpclient.py: @@ -24034,7 +24161,7 @@ trackedFiles: src/apideck_unify/messages.py: last_write_checksum: sha1:158b4c1fb137ee3ac806cc6a59c8d906b01233d6 src/apideck_unify/models/__init__.py: - last_write_checksum: sha1:3b454e577c6f1b192756fc68fc872071e75659a9 + last_write_checksum: sha1:9d99ad62ec65124c502e83ff80b8cf98a51b4b93 src/apideck_unify/models/accounting_agedcreditorsoneop.py: last_write_checksum: sha1:7346d1ab1c21db21995aae34c5ba01549c2786c2 src/apideck_unify/models/accounting_ageddebtorsoneop.py: @@ -24179,6 +24306,10 @@ trackedFiles: last_write_checksum: sha1:b4796ef89490adb1677449ca1a68d2e308d5a2bb src/apideck_unify/models/accounting_expensesupdateop.py: last_write_checksum: sha1:f5c6839e4b7a981dc189d96ced74070e72585ea4 + src/apideck_unify/models/accounting_generalledgertransactionsallop.py: + last_write_checksum: sha1:4b64132d172734df96eb48bfd05c068ae3d0a941 + src/apideck_unify/models/accounting_generalledgertransactionsoneop.py: + last_write_checksum: sha1:463a36c21a458fde7a04eee9a69c58f2ea22a92f src/apideck_unify/models/accounting_invoiceitemsaddop.py: last_write_checksum: sha1:92daebb513cdcb6fde1ff09b91f5ac39c3789cdf src/apideck_unify/models/accounting_invoiceitemsallop.py: @@ -25099,6 +25230,14 @@ trackedFiles: last_write_checksum: sha1:0ed95da662d8e4e9286619ff09f949b0e5d15b77 src/apideck_unify/models/gender.py: last_write_checksum: sha1:32217f3aab2ebc045ba215883a02b6ee4d796a75 + src/apideck_unify/models/generalledgertransaction.py: + last_write_checksum: sha1:428165ff97ca64f06240e0b98e6f1934cf9abb3b + src/apideck_unify/models/generalledgertransactionlineitem.py: + last_write_checksum: sha1:bd6d37b0df38e879fb99c70e479e08d33b5283e9 + src/apideck_unify/models/generalledgertransactionsfilter.py: + last_write_checksum: sha1:2099d9ad1014319d31681a3d0bcafbf31aa94f30 + src/apideck_unify/models/generalledgertransactionssort.py: + last_write_checksum: sha1:e7f7ba0b44e1fa30bac2434bdca62ddb5f9fa11a src/apideck_unify/models/getaccountingdepartmentresponse.py: last_write_checksum: sha1:42ec5ecb751ba5ec4f11969e1af89caa3b842caa src/apideck_unify/models/getaccountingdepartmentsresponse.py: @@ -25275,6 +25414,10 @@ trackedFiles: last_write_checksum: sha1:a2cb75c3d4a06a6fe99536f0142efc9a6aadb464 src/apideck_unify/models/getfolderresponse.py: last_write_checksum: sha1:7b5340f5039ab8f7ccc849269f96e9ed3f733356 + src/apideck_unify/models/getgeneralledgertransactionresponse.py: + last_write_checksum: sha1:bcf3a1f5bf19b4cf49a44e2598a6af2162fb813a + src/apideck_unify/models/getgeneralledgertransactionsresponse.py: + last_write_checksum: sha1:5baf0fd7e19c9ab912d9d6063804d78033510699 src/apideck_unify/models/gethriscompaniesresponse.py: last_write_checksum: sha1:3f9cae45b34ecb40d3d5f1c63a51fb614fcf5348 src/apideck_unify/models/gethriscompanyresponse.py: @@ -25508,7 +25651,7 @@ trackedFiles: src/apideck_unify/models/jobstatus.py: last_write_checksum: sha1:832a677ab0a2c3adee9378579d34429372aab42b src/apideck_unify/models/journalentriesfilter.py: - last_write_checksum: sha1:77d361a96dc80e34f24249d421a6e438031830de + last_write_checksum: sha1:ad9f51221805ca7f779d8b23c11b0aaf5488d820 src/apideck_unify/models/journalentriessort.py: last_write_checksum: sha1:3c089f317739a631b48f3de2486e6b3275af38b9 src/apideck_unify/models/journalentry.py: @@ -26076,7 +26219,7 @@ trackedFiles: src/apideck_unify/utils/enums.py: last_write_checksum: sha1:bc8c3c1285ae09ba8a094ee5c3d9c7f41fa1284d src/apideck_unify/utils/eventstreaming.py: - last_write_checksum: sha1:620d78a8b4e3b854e08d136e02e40a01a786bd70 + last_write_checksum: sha1:cad7e4feff4f1b2824afd0d30f2b1964a604f4dd src/apideck_unify/utils/forms.py: last_write_checksum: sha1:15fa7e9ab1611e062a9984cf06cb20969713d295 src/apideck_unify/utils/headers.py: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 83b23895..70443290 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: persistentEdits: {} versioningStrategy: automatic python: - version: 0.31.19 + version: 0.31.20 additionalDependencies: dev: {} main: {} @@ -51,6 +51,9 @@ python: enableCustomCodeRegions: false enumFormat: enum envVarPrefix: APIDECK + eventStreamClassNames: + async: EventStreamAsync + sync: EventStream fixFlags: responseRequiredSep2024: true flattenGlobalSecurity: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 6b976403..7b5b7b41 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,20 +2,20 @@ speakeasyVersion: 1.656.1 sources: Apideck: sourceNamespace: apideck - sourceRevisionDigest: sha256:6dba88913734e0f668fc4a3f5d5e08056a1c2a262c63671cf33987880d732fc6 - sourceBlobDigest: sha256:20cec00e0883a655242b06dd7ae001907270ad4cfc5c2d4986a9256e99522206 + sourceRevisionDigest: sha256:5f612208e3fe8945b6b001bb0e99d28d203d67feeb1c29ee6cad5bb72d718d2e + sourceBlobDigest: sha256:a7232932fa2090fac1ece86e274439b4223bdcfa7d1ea65f7cd8bdc908ee9883 tags: - latest - - speakeasy-sdk-regen-1780664707 + - speakeasy-sdk-regen-1780908444 - 10.24.40 targets: apideck: source: Apideck sourceNamespace: apideck - sourceRevisionDigest: sha256:6dba88913734e0f668fc4a3f5d5e08056a1c2a262c63671cf33987880d732fc6 - sourceBlobDigest: sha256:20cec00e0883a655242b06dd7ae001907270ad4cfc5c2d4986a9256e99522206 + sourceRevisionDigest: sha256:5f612208e3fe8945b6b001bb0e99d28d203d67feeb1c29ee6cad5bb72d718d2e + sourceBlobDigest: sha256:a7232932fa2090fac1ece86e274439b4223bdcfa7d1ea65f7cd8bdc908ee9883 codeSamplesNamespace: apideck-python-code-samples - codeSamplesRevisionDigest: sha256:b4c5ae4325307a7a8c2133cf42481eaeff43d8100c1ed0deb49e0e052628cc55 + codeSamplesRevisionDigest: sha256:bf03949d62bd41459913d0f407de1d5e860601e38a54e5141d980d60dd717f7f workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index fafea398..9e57fd05 100644 --- a/README.md +++ b/README.md @@ -363,6 +363,11 @@ with Apideck( * [update](docs/sdks/expenses/README.md#update) - Update Expense * [delete](docs/sdks/expenses/README.md#delete) - Delete Expense +#### [accounting.general_ledger_transactions](docs/sdks/generalledgertransactions/README.md) + +* [list](docs/sdks/generalledgertransactions/README.md#list) - List General Ledger Transactions +* [get](docs/sdks/generalledgertransactions/README.md#get) - Get General Ledger Transaction + #### [accounting.invoice_items](docs/sdks/invoiceitems/README.md) * [list](docs/sdks/invoiceitems/README.md#list) - List Invoice Items @@ -1067,7 +1072,7 @@ 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 335 methods.* +* [`Unauthorized`](./src/apideck_unify/models/unauthorized.py): Unauthorized. Status code `401`. Applicable to 6 of 337 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 18757158..ac733a2a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1258,4 +1258,14 @@ Based on: ### Generated - [python v0.31.19] . ### Releases -- [PyPI v0.31.19] https://pypi.org/project/apideck-unify/0.31.19 - . \ No newline at end of file +- [PyPI v0.31.19] https://pypi.org/project/apideck-unify/0.31.19 - . + +## 2026-06-09 00:46:34 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.656.1 (2.753.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.31.20] . +### Releases +- [PyPI v0.31.20] https://pypi.org/project/apideck-unify/0.31.20 - . \ No newline at end of file diff --git a/docs/models/accountinggeneralledgertransactionsallglobals.md b/docs/models/accountinggeneralledgertransactionsallglobals.md new file mode 100644 index 00000000..750babd3 --- /dev/null +++ b/docs/models/accountinggeneralledgertransactionsallglobals.md @@ -0,0 +1,9 @@ +# AccountingGeneralLedgerTransactionsAllGlobals + + +## 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/accountinggeneralledgertransactionsallrequest.md b/docs/models/accountinggeneralledgertransactionsallrequest.md new file mode 100644 index 00000000..69ca9701 --- /dev/null +++ b/docs/models/accountinggeneralledgertransactionsallrequest.md @@ -0,0 +1,18 @@ +# AccountingGeneralLedgerTransactionsAllRequest + + +## 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.GeneralLedgerTransactionsFilter]](../models/generalledgertransactionsfilter.md) | :heavy_minus_sign: | Apply filters | {
"source_type": "invoice",
"updated_since": "2024-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.GeneralLedgerTransactionsSort]](../models/generalledgertransactionssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "posted_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/accountinggeneralledgertransactionsallresponse.md b/docs/models/accountinggeneralledgertransactionsallresponse.md new file mode 100644 index 00000000..7def17b7 --- /dev/null +++ b/docs/models/accountinggeneralledgertransactionsallresponse.md @@ -0,0 +1,10 @@ +# AccountingGeneralLedgerTransactionsAllResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `http_meta` | [models.HTTPMetadata](../models/httpmetadata.md) | :heavy_check_mark: | N/A | +| `get_general_ledger_transactions_response` | [Optional[models.GetGeneralLedgerTransactionsResponse]](../models/getgeneralledgertransactionsresponse.md) | :heavy_minus_sign: | GeneralLedgerTransactions | +| `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/accountinggeneralledgertransactionsoneglobals.md b/docs/models/accountinggeneralledgertransactionsoneglobals.md new file mode 100644 index 00000000..0d5b7760 --- /dev/null +++ b/docs/models/accountinggeneralledgertransactionsoneglobals.md @@ -0,0 +1,9 @@ +# AccountingGeneralLedgerTransactionsOneGlobals + + +## 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/accountinggeneralledgertransactionsonerequest.md b/docs/models/accountinggeneralledgertransactionsonerequest.md new file mode 100644 index 00000000..04f87dc4 --- /dev/null +++ b/docs/models/accountinggeneralledgertransactionsonerequest.md @@ -0,0 +1,14 @@ +# AccountingGeneralLedgerTransactionsOneRequest + + +## 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/accountinggeneralledgertransactionsoneresponse.md b/docs/models/accountinggeneralledgertransactionsoneresponse.md new file mode 100644 index 00000000..1087d889 --- /dev/null +++ b/docs/models/accountinggeneralledgertransactionsoneresponse.md @@ -0,0 +1,10 @@ +# AccountingGeneralLedgerTransactionsOneResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `http_meta` | [models.HTTPMetadata](../models/httpmetadata.md) | :heavy_check_mark: | N/A | +| `get_general_ledger_transaction_response` | [Optional[models.GetGeneralLedgerTransactionResponse]](../models/getgeneralledgertransactionresponse.md) | :heavy_minus_sign: | GeneralLedgerTransaction | +| `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/generalledgertransaction.md b/docs/models/generalledgertransaction.md new file mode 100644 index 00000000..70d9d3fd --- /dev/null +++ b/docs/models/generalledgertransaction.md @@ -0,0 +1,24 @@ +# GeneralLedgerTransaction + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `source_type` | [Nullable[models.GeneralLedgerTransactionSourceType]](../models/generalledgertransactionsourcetype.md) | :heavy_check_mark: | The originating transaction type that produced this posting in the general ledger. Discriminates whether the entry came from an invoice, a bill, a payment, a manual journal, etc. This is the key field that distinguishes general-ledger-transactions from journal-entries (which only covers manually-captured entries). May be `null` when the upstream connector did not return an origin discriminator (e.g. Xero's single-record endpoint strips `SourceType` for every record; certain historical records also omit it). To recover a populated value, query the list endpoint. | invoice | +| `source_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Identifier of the originating document in the vendor system. For example, when source_type is 'invoice', this is the id of the invoice that produced this posting. Use this id together with source_type to fetch the source document via its dedicated unified resource. | 12345 | +| `posted_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | The date on which the transaction was posted to the general ledger. This is the accounting date — it is what determines the period the transaction belongs to and can be earlier than the creation date for backdated postings. | 2020-09-30T07:43:32.000Z | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Optional reference identifier for the transaction. | INV-2024-001 | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | Sequential number auto-assigned by the vendor system to the transaction (e.g. Xero JournalNumber). Unique per company. | JNL-001 | +| `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 | +| `memo` | *OptionalNullable[str]* | :heavy_minus_sign: | Free-text description at the header level. Typically populated when the transaction originates from a manual journal — for system-generated postings (invoice, payment, etc.) the source document carries the descriptive text. | Year-end adjustment for inventory revaluation | +| `line_items` | List[[models.GeneralLedgerTransactionLineItem](../models/generalledgertransactionlineitem.md)] | :heavy_check_mark: | Lines of the transaction. Each line affects one ledger account with either a debit or a credit. The signed sum of net_amount across all lines must equal zero (double-entry invariant). | | +| `custom_fields` | List[[models.CustomField](../models/customfield.md)] | :heavy_minus_sign: | N/A | | +| `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 | +| `custom_mappings` | Dict[str, *Any*] | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | +| `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/generalledgertransactionlineitem.md b/docs/models/generalledgertransactionlineitem.md new file mode 100644 index 00000000..a3137056 --- /dev/null +++ b/docs/models/generalledgertransactionlineitem.md @@ -0,0 +1,16 @@ +# GeneralLedgerTransactionLineItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Free-text description of the line. | Sales revenue from Q3 batch | +| `net_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | The amount posted to the ledger account, tax-exclusive. Debit entries are positive, credit entries are negative. In general-ledger views the tax component lives in its own dedicated line against a tax payable/receivable account, so net_amount is the canonical figure for reporting. | 27500 | +| `type` | [Nullable[models.GeneralLedgerTransactionLineItemType]](../models/generalledgertransactionlineitemtype.md) | :heavy_check_mark: | Side of the entry. Redundant with the sign of net_amount but exposed as an explicit flag for filtering convenience. | debit | +| `tax_amount` | *OptionalNullable[float]* | :heavy_minus_sign: | Tax embedded in the line. In GL views this is typically 0 or null because tax has its own dedicated line against a tax payable/receivable account. Exposed for completeness and for tax-inclusive setups. | 0 | +| `tax_rate` | [Optional[models.LinkedTaxRate]](../models/linkedtaxrate.md) | :heavy_minus_sign: | N/A | | +| `tracking_categories` | List[[Nullable[models.LinkedTrackingCategory]](../models/linkedtrackingcategory.md)] | :heavy_minus_sign: | A list of linked tracking categories. | | +| `ledger_account` | [Nullable[models.LinkedLedgerAccount]](../models/linkedledgeraccount.md) | :heavy_check_mark: | N/A | | +| `line_number` | *OptionalNullable[int]* | :heavy_minus_sign: | Line number of the resource | 1 | \ No newline at end of file diff --git a/docs/models/generalledgertransactionlineitemtype.md b/docs/models/generalledgertransactionlineitemtype.md new file mode 100644 index 00000000..c48ad061 --- /dev/null +++ b/docs/models/generalledgertransactionlineitemtype.md @@ -0,0 +1,11 @@ +# GeneralLedgerTransactionLineItemType + +Side of the entry. Redundant with the sign of net_amount but exposed as an explicit flag for filtering convenience. + + +## Values + +| Name | Value | +| -------- | -------- | +| `DEBIT` | debit | +| `CREDIT` | credit | \ No newline at end of file diff --git a/docs/models/generalledgertransactionsfilter.md b/docs/models/generalledgertransactionsfilter.md new file mode 100644 index 00000000..eed4fa52 --- /dev/null +++ b/docs/models/generalledgertransactionsfilter.md @@ -0,0 +1,10 @@ +# GeneralLedgerTransactionsFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `source_type` | [Optional[models.SourceType]](../models/sourcetype.md) | :heavy_minus_sign: | Filter by the originating transaction type. | | +| `source_id` | *Optional[str]* | :heavy_minus_sign: | Return only transactions originated from the given source document id. | 12345 | +| `updated_since` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Return transactions updated on or after this timestamp. | 2024-09-30T07:43:32.000Z | \ No newline at end of file diff --git a/docs/models/generalledgertransactionsourcetype.md b/docs/models/generalledgertransactionsourcetype.md new file mode 100644 index 00000000..1c6c315c --- /dev/null +++ b/docs/models/generalledgertransactionsourcetype.md @@ -0,0 +1,18 @@ +# GeneralLedgerTransactionSourceType + +The originating transaction type that produced this posting in the general ledger. Discriminates whether the entry came from an invoice, a bill, a payment, a manual journal, etc. This is the key field that distinguishes general-ledger-transactions from journal-entries (which only covers manually-captured entries). May be `null` when the upstream connector did not return an origin discriminator (e.g. Xero's single-record endpoint strips `SourceType` for every record; certain historical records also omit it). To recover a populated value, query the list endpoint. + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `OTHER` | other | +| `INVOICE` | invoice | +| `BILL` | bill | +| `CREDIT_NOTE` | credit_note | +| `PAYMENT` | payment | +| `REFUND` | refund | +| `EXPENSE` | expense | +| `JOURNAL_ENTRY` | journal_entry | +| `PAYROLL` | payroll | \ No newline at end of file diff --git a/docs/models/generalledgertransactionssort.md b/docs/models/generalledgertransactionssort.md new file mode 100644 index 00000000..2a7afbdf --- /dev/null +++ b/docs/models/generalledgertransactionssort.md @@ -0,0 +1,9 @@ +# GeneralLedgerTransactionsSort + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `by` | [Optional[models.GeneralLedgerTransactionsSortBy]](../models/generalledgertransactionssortby.md) | :heavy_minus_sign: | The field on which to sort the General Ledger Transactions. | posted_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/generalledgertransactionssortby.md b/docs/models/generalledgertransactionssortby.md new file mode 100644 index 00000000..35c3e2d6 --- /dev/null +++ b/docs/models/generalledgertransactionssortby.md @@ -0,0 +1,12 @@ +# GeneralLedgerTransactionsSortBy + +The field on which to sort the General Ledger Transactions. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `POSTED_AT` | posted_at | +| `UPDATED_AT` | updated_at | +| `CREATED_AT` | created_at | \ No newline at end of file diff --git a/docs/models/getgeneralledgertransactionresponse.md b/docs/models/getgeneralledgertransactionresponse.md new file mode 100644 index 00000000..40124157 --- /dev/null +++ b/docs/models/getgeneralledgertransactionresponse.md @@ -0,0 +1,16 @@ +# GetGeneralLedgerTransactionResponse + +GeneralLedgerTransaction + + +## 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 | xero | +| `resource` | *str* | :heavy_check_mark: | Unified API resource name | general-ledger-transactions | +| `operation` | *str* | :heavy_check_mark: | Operation performed | one | +| `data` | [models.GeneralLedgerTransaction](../models/generalledgertransaction.md) | :heavy_check_mark: | N/A | | +| `raw` | Dict[str, *Any*] | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/getgeneralledgertransactionsresponse.md b/docs/models/getgeneralledgertransactionsresponse.md new file mode 100644 index 00000000..05e8852a --- /dev/null +++ b/docs/models/getgeneralledgertransactionsresponse.md @@ -0,0 +1,18 @@ +# GetGeneralLedgerTransactionsResponse + +GeneralLedgerTransactions + + +## 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 | xero | +| `resource` | *str* | :heavy_check_mark: | Unified API resource name | general-ledger-transactions | +| `operation` | *str* | :heavy_check_mark: | Operation performed | all | +| `data` | List[[models.GeneralLedgerTransaction](../models/generalledgertransaction.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/journalentriesfilter.md b/docs/models/journalentriesfilter.md index 347278ac..f1e07bef 100644 --- a/docs/models/journalentriesfilter.md +++ b/docs/models/journalentriesfilter.md @@ -3,7 +3,8 @@ ## 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 | -| `status` | [Optional[models.JournalEntriesFilterStatus]](../models/journalentriesfilterstatus.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| 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 | +| `status` | [Optional[models.JournalEntriesFilterStatus]](../models/journalentriesfilterstatus.md) | :heavy_minus_sign: | N/A | | +| `scope` | [Optional[models.JournalEntriesFilterScope]](../models/journalentriesfilterscope.md) | :heavy_minus_sign: | Connector-specific scope hint that controls which downstream source backs the read. On Xero, `manual` reads from `ManualJournals` (free in every tier), while `system` reads from `Journals` (the full general ledger view including manual journal postings, paid post 2026-03-02). Omitting the filter is equivalent to `system` and preserves the legacy default. Only honored on connectors where the distinction is exposed; ignored elsewhere. | | \ No newline at end of file diff --git a/docs/models/journalentriesfilterscope.md b/docs/models/journalentriesfilterscope.md new file mode 100644 index 00000000..ca6369db --- /dev/null +++ b/docs/models/journalentriesfilterscope.md @@ -0,0 +1,11 @@ +# JournalEntriesFilterScope + +Connector-specific scope hint that controls which downstream source backs the read. On Xero, `manual` reads from `ManualJournals` (free in every tier), while `system` reads from `Journals` (the full general ledger view including manual journal postings, paid post 2026-03-02). Omitting the filter is equivalent to `system` and preserves the legacy default. Only honored on connectors where the distinction is exposed; ignored elsewhere. + + +## Values + +| Name | Value | +| -------- | -------- | +| `MANUAL` | manual | +| `SYSTEM` | system | \ No newline at end of file diff --git a/docs/models/sourcetype.md b/docs/models/sourcetype.md new file mode 100644 index 00000000..9d2c3d65 --- /dev/null +++ b/docs/models/sourcetype.md @@ -0,0 +1,18 @@ +# SourceType + +Filter by the originating transaction type. + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `OTHER` | other | +| `INVOICE` | invoice | +| `BILL` | bill | +| `CREDIT_NOTE` | credit_note | +| `PAYMENT` | payment | +| `REFUND` | refund | +| `EXPENSE` | expense | +| `JOURNAL_ENTRY` | journal_entry | +| `PAYROLL` | payroll | \ No newline at end of file diff --git a/docs/sdks/generalledgertransactions/README.md b/docs/sdks/generalledgertransactions/README.md new file mode 100644 index 00000000..f4a0ed72 --- /dev/null +++ b/docs/sdks/generalledgertransactions/README.md @@ -0,0 +1,133 @@ +# GeneralLedgerTransactions +(*accounting.general_ledger_transactions*) + +## Overview + +### Available Operations + +* [list](#list) - List General Ledger Transactions +* [get](#get) - Get General Ledger Transaction + +## list + +List General Ledger Transactions + +### 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.general_ledger_transactions.list(raw=False, service_id="salesforce", company_id="12345", limit=20, filter_={ + "source_type": apideck_unify.SourceType.INVOICE, + "updated_since": parse_datetime("2024-09-30T07:43:32.000Z"), + }, sort={ + "by": apideck_unify.GeneralLedgerTransactionsSortBy.POSTED_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.GeneralLedgerTransactionsFilter]](../../models/generalledgertransactionsfilter.md) | :heavy_minus_sign: | Apply filters | {
"source_type": "invoice",
"updated_since": "2024-09-30T07:43:32.000Z"
} | +| `sort` | [Optional[models.GeneralLedgerTransactionsSort]](../../models/generalledgertransactionssort.md) | :heavy_minus_sign: | Apply sorting | {
"by": "posted_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.AccountingGeneralLedgerTransactionsAllResponse](../../models/accountinggeneralledgertransactionsallresponse.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 General Ledger Transaction + +### 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.general_ledger_transactions.get(id="", service_id="salesforce", company_id="12345", raw=False, fields="id,updated_at") + + assert res.get_general_ledger_transaction_response is not None + + # Handle response + print(res.get_general_ledger_transaction_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.AccountingGeneralLedgerTransactionsOneResponse](../../models/accountinggeneralledgertransactionsoneresponse.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 5f08d696..869bc6d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "apideck-unify" -version = "0.31.19" +version = "0.31.20" 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 86304418..c03e3995 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.31.19" +__version__: str = "0.31.20" __openapi_doc_version__: str = "10.24.40" __gen_version__: str = "2.753.1" -__user_agent__: str = "speakeasy-sdk/python 0.31.19 2.753.1 10.24.40 apideck-unify" +__user_agent__: str = "speakeasy-sdk/python 0.31.20 2.753.1 10.24.40 apideck-unify" try: if __package__ is not None: diff --git a/src/apideck_unify/accounting.py b/src/apideck_unify/accounting.py index 7664966e..985058f8 100644 --- a/src/apideck_unify/accounting.py +++ b/src/apideck_unify/accounting.py @@ -21,6 +21,7 @@ from apideck_unify.expensecategories import ExpenseCategories from apideck_unify.expensereports import ExpenseReports from apideck_unify.expenses import Expenses +from apideck_unify.generalledgertransactions import GeneralLedgerTransactions from apideck_unify.invoiceitems import InvoiceItems from apideck_unify.invoices import Invoices from apideck_unify.journalentries import JournalEntries @@ -55,6 +56,7 @@ class Accounting(BaseSDK): balance_sheet: BalanceSheetSDK profit_and_loss: ProfitAndLossSDK journal_entries: JournalEntries + general_ledger_transactions: GeneralLedgerTransactions purchase_orders: PurchaseOrders subsidiaries: Subsidiaries locations: Locations @@ -112,6 +114,9 @@ def _init_sdks(self): self.journal_entries = JournalEntries( self.sdk_configuration, parent_ref=self.parent_ref ) + self.general_ledger_transactions = GeneralLedgerTransactions( + 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/generalledgertransactions.py b/src/apideck_unify/generalledgertransactions.py new file mode 100644 index 00000000..b723d90b --- /dev/null +++ b/src/apideck_unify/generalledgertransactions.py @@ -0,0 +1,712 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from apideck_unify import models, utils +from apideck_unify._hooks import HookContext +from apideck_unify.types import OptionalNullable, UNSET +from apideck_unify.utils import get_security_from_env +from apideck_unify.utils.unmarshal_json_response import unmarshal_json_response +from jsonpath import JSONPath +from typing import Any, Dict, List, Mapping, Optional, Union + + +class GeneralLedgerTransactions(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.GeneralLedgerTransactionsFilter, + models.GeneralLedgerTransactionsFilterTypedDict, + ] + ] = None, + sort: Optional[ + Union[ + models.GeneralLedgerTransactionsSort, + models.GeneralLedgerTransactionsSortTypedDict, + ] + ] = 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.AccountingGeneralLedgerTransactionsAllResponse]: + r"""List General Ledger Transactions + + List General Ledger Transactions + + :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.AccountingGeneralLedgerTransactionsAllRequest( + 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.GeneralLedgerTransactionsFilter] + ), + sort=utils.get_pydantic_model( + sort, Optional[models.GeneralLedgerTransactionsSort] + ), + pass_through=pass_through, + fields=fields, + ) + + req = self._build_request( + method="GET", + path="/accounting/general-ledger-transactions", + 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.AccountingGeneralLedgerTransactionsAllGlobals( + 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.generalLedgerTransactionsAll", + 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.AccountingGeneralLedgerTransactionsAllResponse] + ): + 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.AccountingGeneralLedgerTransactionsAllResponse( + get_general_ledger_transactions_response=unmarshal_json_response( + Optional[models.GetGeneralLedgerTransactionsResponse], 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.AccountingGeneralLedgerTransactionsAllResponse( + 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.GeneralLedgerTransactionsFilter, + models.GeneralLedgerTransactionsFilterTypedDict, + ] + ] = None, + sort: Optional[ + Union[ + models.GeneralLedgerTransactionsSort, + models.GeneralLedgerTransactionsSortTypedDict, + ] + ] = 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.AccountingGeneralLedgerTransactionsAllResponse]: + r"""List General Ledger Transactions + + List General Ledger Transactions + + :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.AccountingGeneralLedgerTransactionsAllRequest( + 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.GeneralLedgerTransactionsFilter] + ), + sort=utils.get_pydantic_model( + sort, Optional[models.GeneralLedgerTransactionsSort] + ), + pass_through=pass_through, + fields=fields, + ) + + req = self._build_request_async( + method="GET", + path="/accounting/general-ledger-transactions", + 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.AccountingGeneralLedgerTransactionsAllGlobals( + 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.generalLedgerTransactionsAll", + 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.AccountingGeneralLedgerTransactionsAllResponse] + ): + 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.AccountingGeneralLedgerTransactionsAllResponse( + get_general_ledger_transactions_response=unmarshal_json_response( + Optional[models.GetGeneralLedgerTransactionsResponse], 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.AccountingGeneralLedgerTransactionsAllResponse( + 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 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.AccountingGeneralLedgerTransactionsOneResponse: + r"""Get General Ledger Transaction + + Get General Ledger Transaction + + :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.AccountingGeneralLedgerTransactionsOneRequest( + 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/general-ledger-transactions/{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.AccountingGeneralLedgerTransactionsOneGlobals( + 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.generalLedgerTransactionsOne", + 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.AccountingGeneralLedgerTransactionsOneResponse( + get_general_ledger_transaction_response=unmarshal_json_response( + Optional[models.GetGeneralLedgerTransactionResponse], 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.AccountingGeneralLedgerTransactionsOneResponse( + 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.AccountingGeneralLedgerTransactionsOneResponse: + r"""Get General Ledger Transaction + + Get General Ledger Transaction + + :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.AccountingGeneralLedgerTransactionsOneRequest( + 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/general-ledger-transactions/{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.AccountingGeneralLedgerTransactionsOneGlobals( + 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.generalLedgerTransactionsOne", + 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.AccountingGeneralLedgerTransactionsOneResponse( + get_general_ledger_transaction_response=unmarshal_json_response( + Optional[models.GetGeneralLedgerTransactionResponse], 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.AccountingGeneralLedgerTransactionsOneResponse( + 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) diff --git a/src/apideck_unify/models/__init__.py b/src/apideck_unify/models/__init__.py index 38631f28..4df8cdcf 100644 --- a/src/apideck_unify/models/__init__.py +++ b/src/apideck_unify/models/__init__.py @@ -584,6 +584,22 @@ AccountingExpensesUpdateResponse, AccountingExpensesUpdateResponseTypedDict, ) + from .accounting_generalledgertransactionsallop import ( + AccountingGeneralLedgerTransactionsAllGlobals, + AccountingGeneralLedgerTransactionsAllGlobalsTypedDict, + AccountingGeneralLedgerTransactionsAllRequest, + AccountingGeneralLedgerTransactionsAllRequestTypedDict, + AccountingGeneralLedgerTransactionsAllResponse, + AccountingGeneralLedgerTransactionsAllResponseTypedDict, + ) + from .accounting_generalledgertransactionsoneop import ( + AccountingGeneralLedgerTransactionsOneGlobals, + AccountingGeneralLedgerTransactionsOneGlobalsTypedDict, + AccountingGeneralLedgerTransactionsOneRequest, + AccountingGeneralLedgerTransactionsOneRequestTypedDict, + AccountingGeneralLedgerTransactionsOneResponse, + AccountingGeneralLedgerTransactionsOneResponseTypedDict, + ) from .accounting_invoiceitemsaddop import ( AccountingInvoiceItemsAddGlobals, AccountingInvoiceItemsAddGlobalsTypedDict, @@ -3084,6 +3100,26 @@ FormFieldOptionGroupTypedDict, ) from .gender import Gender + from .generalledgertransaction import ( + GeneralLedgerTransaction, + GeneralLedgerTransactionSourceType, + GeneralLedgerTransactionTypedDict, + ) + from .generalledgertransactionlineitem import ( + GeneralLedgerTransactionLineItem, + GeneralLedgerTransactionLineItemType, + GeneralLedgerTransactionLineItemTypedDict, + ) + from .generalledgertransactionsfilter import ( + GeneralLedgerTransactionsFilter, + GeneralLedgerTransactionsFilterTypedDict, + SourceType, + ) + from .generalledgertransactionssort import ( + GeneralLedgerTransactionsSort, + GeneralLedgerTransactionsSortBy, + GeneralLedgerTransactionsSortTypedDict, + ) from .getaccountingdepartmentresponse import ( GetAccountingDepartmentResponse, GetAccountingDepartmentResponseTypedDict, @@ -3375,6 +3411,14 @@ from .getfileresponse import GetFileResponse, GetFileResponseTypedDict from .getfilesresponse import GetFilesResponse, GetFilesResponseTypedDict from .getfolderresponse import GetFolderResponse, GetFolderResponseTypedDict + from .getgeneralledgertransactionresponse import ( + GetGeneralLedgerTransactionResponse, + GetGeneralLedgerTransactionResponseTypedDict, + ) + from .getgeneralledgertransactionsresponse import ( + GetGeneralLedgerTransactionsResponse, + GetGeneralLedgerTransactionsResponseTypedDict, + ) from .gethriscompaniesresponse import ( GetHrisCompaniesResponse, GetHrisCompaniesResponseTypedDict, @@ -3913,6 +3957,7 @@ from .jobstatus import JobStatus from .journalentriesfilter import ( JournalEntriesFilter, + JournalEntriesFilterScope, JournalEntriesFilterStatus, JournalEntriesFilterTypedDict, ) @@ -5446,6 +5491,18 @@ "AccountingExpensesUpdateRequestTypedDict", "AccountingExpensesUpdateResponse", "AccountingExpensesUpdateResponseTypedDict", + "AccountingGeneralLedgerTransactionsAllGlobals", + "AccountingGeneralLedgerTransactionsAllGlobalsTypedDict", + "AccountingGeneralLedgerTransactionsAllRequest", + "AccountingGeneralLedgerTransactionsAllRequestTypedDict", + "AccountingGeneralLedgerTransactionsAllResponse", + "AccountingGeneralLedgerTransactionsAllResponseTypedDict", + "AccountingGeneralLedgerTransactionsOneGlobals", + "AccountingGeneralLedgerTransactionsOneGlobalsTypedDict", + "AccountingGeneralLedgerTransactionsOneRequest", + "AccountingGeneralLedgerTransactionsOneRequestTypedDict", + "AccountingGeneralLedgerTransactionsOneResponse", + "AccountingGeneralLedgerTransactionsOneResponseTypedDict", "AccountingInvoiceItemsAddGlobals", "AccountingInvoiceItemsAddGlobalsTypedDict", "AccountingInvoiceItemsAddRequest", @@ -7314,6 +7371,17 @@ "Format", "FulfillmentStatus", "Gender", + "GeneralLedgerTransaction", + "GeneralLedgerTransactionLineItem", + "GeneralLedgerTransactionLineItemType", + "GeneralLedgerTransactionLineItemTypedDict", + "GeneralLedgerTransactionSourceType", + "GeneralLedgerTransactionTypedDict", + "GeneralLedgerTransactionsFilter", + "GeneralLedgerTransactionsFilterTypedDict", + "GeneralLedgerTransactionsSort", + "GeneralLedgerTransactionsSortBy", + "GeneralLedgerTransactionsSortTypedDict", "GetAPIResourceCoverageResponse", "GetAPIResourceCoverageResponseTypedDict", "GetAPIResourceResponse", @@ -7490,6 +7558,10 @@ "GetFilesResponseTypedDict", "GetFolderResponse", "GetFolderResponseTypedDict", + "GetGeneralLedgerTransactionResponse", + "GetGeneralLedgerTransactionResponseTypedDict", + "GetGeneralLedgerTransactionsResponse", + "GetGeneralLedgerTransactionsResponseTypedDict", "GetHrisCompaniesResponse", "GetHrisCompaniesResponseTypedDict", "GetHrisCompanyResponse", @@ -7911,6 +7983,7 @@ "JobType", "JobTypedDict", "JournalEntriesFilter", + "JournalEntriesFilterScope", "JournalEntriesFilterStatus", "JournalEntriesFilterTypedDict", "JournalEntriesSort", @@ -8325,6 +8398,7 @@ "SocialLinksTypedDict", "SortBy", "SortDirection", + "SourceType", "Stage", "StageTypedDict", "Stages", @@ -9215,6 +9289,18 @@ "AccountingExpensesUpdateRequestTypedDict": ".accounting_expensesupdateop", "AccountingExpensesUpdateResponse": ".accounting_expensesupdateop", "AccountingExpensesUpdateResponseTypedDict": ".accounting_expensesupdateop", + "AccountingGeneralLedgerTransactionsAllGlobals": ".accounting_generalledgertransactionsallop", + "AccountingGeneralLedgerTransactionsAllGlobalsTypedDict": ".accounting_generalledgertransactionsallop", + "AccountingGeneralLedgerTransactionsAllRequest": ".accounting_generalledgertransactionsallop", + "AccountingGeneralLedgerTransactionsAllRequestTypedDict": ".accounting_generalledgertransactionsallop", + "AccountingGeneralLedgerTransactionsAllResponse": ".accounting_generalledgertransactionsallop", + "AccountingGeneralLedgerTransactionsAllResponseTypedDict": ".accounting_generalledgertransactionsallop", + "AccountingGeneralLedgerTransactionsOneGlobals": ".accounting_generalledgertransactionsoneop", + "AccountingGeneralLedgerTransactionsOneGlobalsTypedDict": ".accounting_generalledgertransactionsoneop", + "AccountingGeneralLedgerTransactionsOneRequest": ".accounting_generalledgertransactionsoneop", + "AccountingGeneralLedgerTransactionsOneRequestTypedDict": ".accounting_generalledgertransactionsoneop", + "AccountingGeneralLedgerTransactionsOneResponse": ".accounting_generalledgertransactionsoneop", + "AccountingGeneralLedgerTransactionsOneResponseTypedDict": ".accounting_generalledgertransactionsoneop", "AccountingInvoiceItemsAddGlobals": ".accounting_invoiceitemsaddop", "AccountingInvoiceItemsAddGlobalsTypedDict": ".accounting_invoiceitemsaddop", "AccountingInvoiceItemsAddRequest": ".accounting_invoiceitemsaddop", @@ -11116,6 +11202,18 @@ "FormFieldOptionGroupOptionType": ".formfieldoptiongroup", "FormFieldOptionGroupTypedDict": ".formfieldoptiongroup", "Gender": ".gender", + "GeneralLedgerTransaction": ".generalledgertransaction", + "GeneralLedgerTransactionSourceType": ".generalledgertransaction", + "GeneralLedgerTransactionTypedDict": ".generalledgertransaction", + "GeneralLedgerTransactionLineItem": ".generalledgertransactionlineitem", + "GeneralLedgerTransactionLineItemType": ".generalledgertransactionlineitem", + "GeneralLedgerTransactionLineItemTypedDict": ".generalledgertransactionlineitem", + "GeneralLedgerTransactionsFilter": ".generalledgertransactionsfilter", + "GeneralLedgerTransactionsFilterTypedDict": ".generalledgertransactionsfilter", + "SourceType": ".generalledgertransactionsfilter", + "GeneralLedgerTransactionsSort": ".generalledgertransactionssort", + "GeneralLedgerTransactionsSortBy": ".generalledgertransactionssort", + "GeneralLedgerTransactionsSortTypedDict": ".generalledgertransactionssort", "GetAccountingDepartmentResponse": ".getaccountingdepartmentresponse", "GetAccountingDepartmentResponseTypedDict": ".getaccountingdepartmentresponse", "GetAccountingDepartmentsResponse": ".getaccountingdepartmentsresponse", @@ -11294,6 +11392,10 @@ "GetFilesResponseTypedDict": ".getfilesresponse", "GetFolderResponse": ".getfolderresponse", "GetFolderResponseTypedDict": ".getfolderresponse", + "GetGeneralLedgerTransactionResponse": ".getgeneralledgertransactionresponse", + "GetGeneralLedgerTransactionResponseTypedDict": ".getgeneralledgertransactionresponse", + "GetGeneralLedgerTransactionsResponse": ".getgeneralledgertransactionsresponse", + "GetGeneralLedgerTransactionsResponseTypedDict": ".getgeneralledgertransactionsresponse", "GetHrisCompaniesResponse": ".gethriscompaniesresponse", "GetHrisCompaniesResponseTypedDict": ".gethriscompaniesresponse", "GetHrisCompanyResponse": ".gethriscompanyresponse", @@ -11725,6 +11827,7 @@ "Visibility": ".job", "JobStatus": ".jobstatus", "JournalEntriesFilter": ".journalentriesfilter", + "JournalEntriesFilterScope": ".journalentriesfilter", "JournalEntriesFilterStatus": ".journalentriesfilter", "JournalEntriesFilterTypedDict": ".journalentriesfilter", "JournalEntriesSort": ".journalentriessort", diff --git a/src/apideck_unify/models/accounting_generalledgertransactionsallop.py b/src/apideck_unify/models/accounting_generalledgertransactionsallop.py new file mode 100644 index 00000000..a95ea645 --- /dev/null +++ b/src/apideck_unify/models/accounting_generalledgertransactionsallop.py @@ -0,0 +1,219 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .generalledgertransactionsfilter import ( + GeneralLedgerTransactionsFilter, + GeneralLedgerTransactionsFilterTypedDict, +) +from .generalledgertransactionssort import ( + GeneralLedgerTransactionsSort, + GeneralLedgerTransactionsSortTypedDict, +) +from .getgeneralledgertransactionsresponse import ( + GetGeneralLedgerTransactionsResponse, + GetGeneralLedgerTransactionsResponseTypedDict, +) +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, QueryParamMetadata +import pydantic +from pydantic import model_serializer +from typing import Any, Callable, Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountingGeneralLedgerTransactionsAllGlobalsTypedDict(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 AccountingGeneralLedgerTransactionsAllGlobals(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 AccountingGeneralLedgerTransactionsAllRequestTypedDict(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[GeneralLedgerTransactionsFilterTypedDict] + r"""Apply filters""" + sort: NotRequired[GeneralLedgerTransactionsSortTypedDict] + 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 AccountingGeneralLedgerTransactionsAllRequest(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[GeneralLedgerTransactionsFilter], + pydantic.Field(alias="filter"), + FieldMetadata(query=QueryParamMetadata(style="deepObject", explode=True)), + ] = None + r"""Apply filters""" + + sort: Annotated[ + Optional[GeneralLedgerTransactionsSort], + 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 AccountingGeneralLedgerTransactionsAllResponseTypedDict(TypedDict): + http_meta: HTTPMetadataTypedDict + get_general_ledger_transactions_response: NotRequired[ + GetGeneralLedgerTransactionsResponseTypedDict + ] + r"""GeneralLedgerTransactions""" + unexpected_error_response: NotRequired[UnexpectedErrorResponseTypedDict] + r"""Unexpected error""" + + +class AccountingGeneralLedgerTransactionsAllResponse(BaseModel): + next: Callable[[], Optional[AccountingGeneralLedgerTransactionsAllResponse]] + + http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None + + get_general_ledger_transactions_response: Optional[ + GetGeneralLedgerTransactionsResponse + ] = None + r"""GeneralLedgerTransactions""" + + unexpected_error_response: Optional[UnexpectedErrorResponse] = None + r"""Unexpected error""" diff --git a/src/apideck_unify/models/accounting_generalledgertransactionsoneop.py b/src/apideck_unify/models/accounting_generalledgertransactionsoneop.py new file mode 100644 index 00000000..fb860b8b --- /dev/null +++ b/src/apideck_unify/models/accounting_generalledgertransactionsoneop.py @@ -0,0 +1,175 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .getgeneralledgertransactionresponse import ( + GetGeneralLedgerTransactionResponse, + GetGeneralLedgerTransactionResponseTypedDict, +) +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 AccountingGeneralLedgerTransactionsOneGlobalsTypedDict(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 AccountingGeneralLedgerTransactionsOneGlobals(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 AccountingGeneralLedgerTransactionsOneRequestTypedDict(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 AccountingGeneralLedgerTransactionsOneRequest(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 AccountingGeneralLedgerTransactionsOneResponseTypedDict(TypedDict): + http_meta: HTTPMetadataTypedDict + get_general_ledger_transaction_response: NotRequired[ + GetGeneralLedgerTransactionResponseTypedDict + ] + r"""GeneralLedgerTransaction""" + unexpected_error_response: NotRequired[UnexpectedErrorResponseTypedDict] + r"""Unexpected error""" + + +class AccountingGeneralLedgerTransactionsOneResponse(BaseModel): + http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None + + get_general_ledger_transaction_response: Optional[ + GetGeneralLedgerTransactionResponse + ] = None + r"""GeneralLedgerTransaction""" + + unexpected_error_response: Optional[UnexpectedErrorResponse] = None + r"""Unexpected error""" diff --git a/src/apideck_unify/models/generalledgertransaction.py b/src/apideck_unify/models/generalledgertransaction.py new file mode 100644 index 00000000..1122b125 --- /dev/null +++ b/src/apideck_unify/models/generalledgertransaction.py @@ -0,0 +1,209 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .currency import Currency +from .customfield import CustomField, CustomFieldTypedDict +from .generalledgertransactionlineitem import ( + GeneralLedgerTransactionLineItem, + GeneralLedgerTransactionLineItemTypedDict, +) +from .passthroughbody import PassThroughBody, PassThroughBodyTypedDict +from apideck_unify import models, utils +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from apideck_unify.utils import validate_open_enum +from datetime import datetime +from enum import Enum +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 GeneralLedgerTransactionSourceType(str, Enum, metaclass=utils.OpenEnumMeta): + r"""The originating transaction type that produced this posting in the general ledger. Discriminates whether the entry came from an invoice, a bill, a payment, a manual journal, etc. This is the key field that distinguishes general-ledger-transactions from journal-entries (which only covers manually-captured entries). May be `null` when the upstream connector did not return an origin discriminator (e.g. Xero's single-record endpoint strips `SourceType` for every record; certain historical records also omit it). To recover a populated value, query the list endpoint.""" + + OTHER = "other" + INVOICE = "invoice" + BILL = "bill" + CREDIT_NOTE = "credit_note" + PAYMENT = "payment" + REFUND = "refund" + EXPENSE = "expense" + JOURNAL_ENTRY = "journal_entry" + PAYROLL = "payroll" + + +class GeneralLedgerTransactionTypedDict(TypedDict): + source_type: Nullable[GeneralLedgerTransactionSourceType] + r"""The originating transaction type that produced this posting in the general ledger. Discriminates whether the entry came from an invoice, a bill, a payment, a manual journal, etc. This is the key field that distinguishes general-ledger-transactions from journal-entries (which only covers manually-captured entries). May be `null` when the upstream connector did not return an origin discriminator (e.g. Xero's single-record endpoint strips `SourceType` for every record; certain historical records also omit it). To recover a populated value, query the list endpoint.""" + line_items: List[GeneralLedgerTransactionLineItemTypedDict] + r"""Lines of the transaction. Each line affects one ledger account with either a debit or a credit. The signed sum of net_amount across all lines must equal zero (double-entry invariant).""" + id: NotRequired[str] + r"""A unique identifier for an object.""" + source_id: NotRequired[Nullable[str]] + r"""Identifier of the originating document in the vendor system. For example, when source_type is 'invoice', this is the id of the invoice that produced this posting. Use this id together with source_type to fetch the source document via its dedicated unified resource.""" + posted_at: NotRequired[datetime] + r"""The date on which the transaction was posted to the general ledger. This is the accounting date — it is what determines the period the transaction belongs to and can be earlier than the creation date for backdated postings.""" + reference: NotRequired[Nullable[str]] + r"""Optional reference identifier for the transaction.""" + number: NotRequired[Nullable[str]] + r"""Sequential number auto-assigned by the vendor system to the transaction (e.g. Xero JournalNumber). Unique per company.""" + 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.""" + memo: NotRequired[Nullable[str]] + r"""Free-text description at the header level. Typically populated when the transaction originates from a manual journal — for system-generated postings (invoice, payment, etc.) the source document carries the descriptive text.""" + custom_fields: NotRequired[List[CustomFieldTypedDict]] + 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.""" + custom_mappings: NotRequired[Nullable[Dict[str, Any]]] + r"""When custom mappings are configured on the resource, the result is included here.""" + 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 GeneralLedgerTransaction(BaseModel): + source_type: Annotated[ + Nullable[GeneralLedgerTransactionSourceType], + PlainValidator(validate_open_enum(False)), + ] + r"""The originating transaction type that produced this posting in the general ledger. Discriminates whether the entry came from an invoice, a bill, a payment, a manual journal, etc. This is the key field that distinguishes general-ledger-transactions from journal-entries (which only covers manually-captured entries). May be `null` when the upstream connector did not return an origin discriminator (e.g. Xero's single-record endpoint strips `SourceType` for every record; certain historical records also omit it). To recover a populated value, query the list endpoint.""" + + line_items: List[GeneralLedgerTransactionLineItem] + r"""Lines of the transaction. Each line affects one ledger account with either a debit or a credit. The signed sum of net_amount across all lines must equal zero (double-entry invariant).""" + + id: Optional[str] = None + r"""A unique identifier for an object.""" + + source_id: OptionalNullable[str] = UNSET + r"""Identifier of the originating document in the vendor system. For example, when source_type is 'invoice', this is the id of the invoice that produced this posting. Use this id together with source_type to fetch the source document via its dedicated unified resource.""" + + posted_at: Optional[datetime] = None + r"""The date on which the transaction was posted to the general ledger. This is the accounting date — it is what determines the period the transaction belongs to and can be earlier than the creation date for backdated postings.""" + + reference: OptionalNullable[str] = UNSET + r"""Optional reference identifier for the transaction.""" + + number: OptionalNullable[str] = UNSET + r"""Sequential number auto-assigned by the vendor system to the transaction (e.g. Xero JournalNumber). Unique per company.""" + + 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.""" + + memo: OptionalNullable[str] = UNSET + r"""Free-text description at the header level. Typically populated when the transaction originates from a manual journal — for system-generated postings (invoice, payment, etc.) the source document carries the descriptive text.""" + + custom_fields: Optional[List[CustomField]] = None + + 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.""" + + custom_mappings: OptionalNullable[Dict[str, Any]] = UNSET + r"""When custom mappings are configured on the resource, the result is included here.""" + + 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("source_type") + def serialize_source_type(self, value): + if isinstance(value, str): + try: + return models.GeneralLedgerTransactionSourceType(value) + except ValueError: + return value + return value + + @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 = [ + "id", + "source_id", + "posted_at", + "reference", + "number", + "currency", + "currency_rate", + "memo", + "custom_fields", + "updated_by", + "created_by", + "updated_at", + "created_at", + "custom_mappings", + "pass_through", + ] + nullable_fields = [ + "source_type", + "source_id", + "reference", + "number", + "currency", + "currency_rate", + "memo", + "updated_by", + "created_by", + "updated_at", + "created_at", + "custom_mappings", + ] + 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/generalledgertransactionlineitem.py b/src/apideck_unify/models/generalledgertransactionlineitem.py new file mode 100644 index 00000000..7b989983 --- /dev/null +++ b/src/apideck_unify/models/generalledgertransactionlineitem.py @@ -0,0 +1,138 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .linkedledgeraccount import LinkedLedgerAccount, LinkedLedgerAccountTypedDict +from .linkedtaxrate import LinkedTaxRate, LinkedTaxRateTypedDict +from .linkedtrackingcategory import ( + LinkedTrackingCategory, + LinkedTrackingCategoryTypedDict, +) +from apideck_unify import models, utils +from apideck_unify.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from apideck_unify.utils import validate_open_enum +from enum import Enum +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 GeneralLedgerTransactionLineItemType(str, Enum, metaclass=utils.OpenEnumMeta): + r"""Side of the entry. Redundant with the sign of net_amount but exposed as an explicit flag for filtering convenience.""" + + DEBIT = "debit" + CREDIT = "credit" + + +class GeneralLedgerTransactionLineItemTypedDict(TypedDict): + type: Nullable[GeneralLedgerTransactionLineItemType] + r"""Side of the entry. Redundant with the sign of net_amount but exposed as an explicit flag for filtering convenience.""" + ledger_account: Nullable[LinkedLedgerAccountTypedDict] + id: NotRequired[str] + r"""A unique identifier for an object.""" + description: NotRequired[Nullable[str]] + r"""Free-text description of the line.""" + net_amount: NotRequired[Nullable[float]] + r"""The amount posted to the ledger account, tax-exclusive. Debit entries are positive, credit entries are negative. In general-ledger views the tax component lives in its own dedicated line against a tax payable/receivable account, so net_amount is the canonical figure for reporting.""" + tax_amount: NotRequired[Nullable[float]] + r"""Tax embedded in the line. In GL views this is typically 0 or null because tax has its own dedicated line against a tax payable/receivable account. Exposed for completeness and for tax-inclusive setups.""" + tax_rate: NotRequired[LinkedTaxRateTypedDict] + tracking_categories: NotRequired[ + Nullable[List[Nullable[LinkedTrackingCategoryTypedDict]]] + ] + r"""A list of linked tracking categories.""" + line_number: NotRequired[Nullable[int]] + r"""Line number of the resource""" + + +class GeneralLedgerTransactionLineItem(BaseModel): + type: Annotated[ + Nullable[GeneralLedgerTransactionLineItemType], + PlainValidator(validate_open_enum(False)), + ] + r"""Side of the entry. Redundant with the sign of net_amount but exposed as an explicit flag for filtering convenience.""" + + ledger_account: Nullable[LinkedLedgerAccount] + + id: Optional[str] = None + r"""A unique identifier for an object.""" + + description: OptionalNullable[str] = UNSET + r"""Free-text description of the line.""" + + net_amount: OptionalNullable[float] = UNSET + r"""The amount posted to the ledger account, tax-exclusive. Debit entries are positive, credit entries are negative. In general-ledger views the tax component lives in its own dedicated line against a tax payable/receivable account, so net_amount is the canonical figure for reporting.""" + + tax_amount: OptionalNullable[float] = UNSET + r"""Tax embedded in the line. In GL views this is typically 0 or null because tax has its own dedicated line against a tax payable/receivable account. Exposed for completeness and for tax-inclusive setups.""" + + tax_rate: Optional[LinkedTaxRate] = None + + tracking_categories: OptionalNullable[List[Nullable[LinkedTrackingCategory]]] = ( + UNSET + ) + r"""A list of linked tracking categories.""" + + line_number: OptionalNullable[int] = UNSET + r"""Line number of the resource""" + + @field_serializer("type") + def serialize_type(self, value): + if isinstance(value, str): + try: + return models.GeneralLedgerTransactionLineItemType(value) + except ValueError: + return value + return value + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "id", + "description", + "net_amount", + "tax_amount", + "tax_rate", + "tracking_categories", + "line_number", + ] + nullable_fields = [ + "description", + "net_amount", + "type", + "tax_amount", + "tracking_categories", + "ledger_account", + "line_number", + ] + 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/generalledgertransactionsfilter.py b/src/apideck_unify/models/generalledgertransactionsfilter.py new file mode 100644 index 00000000..35c23801 --- /dev/null +++ b/src/apideck_unify/models/generalledgertransactionsfilter.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from apideck_unify import models, utils +from apideck_unify.types import BaseModel +from apideck_unify.utils import FieldMetadata, validate_open_enum +from datetime import datetime +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 SourceType(str, Enum, metaclass=utils.OpenEnumMeta): + r"""Filter by the originating transaction type.""" + + OTHER = "other" + INVOICE = "invoice" + BILL = "bill" + CREDIT_NOTE = "credit_note" + PAYMENT = "payment" + REFUND = "refund" + EXPENSE = "expense" + JOURNAL_ENTRY = "journal_entry" + PAYROLL = "payroll" + + +class GeneralLedgerTransactionsFilterTypedDict(TypedDict): + source_type: NotRequired[SourceType] + r"""Filter by the originating transaction type.""" + source_id: NotRequired[str] + r"""Return only transactions originated from the given source document id.""" + updated_since: NotRequired[datetime] + r"""Return transactions updated on or after this timestamp.""" + + +class GeneralLedgerTransactionsFilter(BaseModel): + source_type: Annotated[ + Annotated[Optional[SourceType], PlainValidator(validate_open_enum(False))], + FieldMetadata(query=True), + ] = None + r"""Filter by the originating transaction type.""" + + source_id: Annotated[Optional[str], FieldMetadata(query=True)] = None + r"""Return only transactions originated from the given source document id.""" + + updated_since: Annotated[Optional[datetime], FieldMetadata(query=True)] = None + r"""Return transactions updated on or after this timestamp.""" + + @field_serializer("source_type") + def serialize_source_type(self, value): + if isinstance(value, str): + try: + return models.SourceType(value) + except ValueError: + return value + return value diff --git a/src/apideck_unify/models/generalledgertransactionssort.py b/src/apideck_unify/models/generalledgertransactionssort.py new file mode 100644 index 00000000..4d21fda4 --- /dev/null +++ b/src/apideck_unify/models/generalledgertransactionssort.py @@ -0,0 +1,62 @@ +"""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 GeneralLedgerTransactionsSortBy(str, Enum, metaclass=utils.OpenEnumMeta): + r"""The field on which to sort the General Ledger Transactions.""" + + POSTED_AT = "posted_at" + UPDATED_AT = "updated_at" + CREATED_AT = "created_at" + + +class GeneralLedgerTransactionsSortTypedDict(TypedDict): + by: NotRequired[GeneralLedgerTransactionsSortBy] + r"""The field on which to sort the General Ledger Transactions.""" + direction: NotRequired[SortDirection] + r"""The direction in which to sort the results""" + + +class GeneralLedgerTransactionsSort(BaseModel): + by: Annotated[ + Annotated[ + Optional[GeneralLedgerTransactionsSortBy], + PlainValidator(validate_open_enum(False)), + ], + FieldMetadata(query=True), + ] = None + r"""The field on which to sort the General Ledger Transactions.""" + + 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.GeneralLedgerTransactionsSortBy(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/getgeneralledgertransactionresponse.py b/src/apideck_unify/models/getgeneralledgertransactionresponse.py new file mode 100644 index 00000000..c8594f1d --- /dev/null +++ b/src/apideck_unify/models/getgeneralledgertransactionresponse.py @@ -0,0 +1,92 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .generalledgertransaction import ( + GeneralLedgerTransaction, + GeneralLedgerTransactionTypedDict, +) +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 GetGeneralLedgerTransactionResponseTypedDict(TypedDict): + r"""GeneralLedgerTransaction""" + + 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: GeneralLedgerTransactionTypedDict + raw: NotRequired[Nullable[Dict[str, Any]]] + r"""Raw response from the integration when raw=true query param is provided""" + + +class GetGeneralLedgerTransactionResponse(BaseModel): + r"""GeneralLedgerTransaction""" + + 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: GeneralLedgerTransaction + + 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/getgeneralledgertransactionsresponse.py b/src/apideck_unify/models/getgeneralledgertransactionsresponse.py new file mode 100644 index 00000000..be9b6167 --- /dev/null +++ b/src/apideck_unify/models/getgeneralledgertransactionsresponse.py @@ -0,0 +1,104 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .generalledgertransaction import ( + GeneralLedgerTransaction, + GeneralLedgerTransactionTypedDict, +) +from .links import Links, LinksTypedDict +from .meta import Meta, MetaTypedDict +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 GetGeneralLedgerTransactionsResponseTypedDict(TypedDict): + r"""GeneralLedgerTransactions""" + + 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[GeneralLedgerTransactionTypedDict] + 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 GetGeneralLedgerTransactionsResponse(BaseModel): + r"""GeneralLedgerTransactions""" + + 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[GeneralLedgerTransaction] + + 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/journalentriesfilter.py b/src/apideck_unify/models/journalentriesfilter.py index bc033075..0ec70b2e 100644 --- a/src/apideck_unify/models/journalentriesfilter.py +++ b/src/apideck_unify/models/journalentriesfilter.py @@ -23,9 +23,18 @@ class JournalEntriesFilterStatus(str, Enum, metaclass=utils.OpenEnumMeta): OTHER = "other" +class JournalEntriesFilterScope(str, Enum, metaclass=utils.OpenEnumMeta): + r"""Connector-specific scope hint that controls which downstream source backs the read. On Xero, `manual` reads from `ManualJournals` (free in every tier), while `system` reads from `Journals` (the full general ledger view including manual journal postings, paid post 2026-03-02). Omitting the filter is equivalent to `system` and preserves the legacy default. Only honored on connectors where the distinction is exposed; ignored elsewhere.""" + + MANUAL = "manual" + SYSTEM = "system" + + class JournalEntriesFilterTypedDict(TypedDict): updated_since: NotRequired[datetime] status: NotRequired[JournalEntriesFilterStatus] + scope: NotRequired[JournalEntriesFilterScope] + r"""Connector-specific scope hint that controls which downstream source backs the read. On Xero, `manual` reads from `ManualJournals` (free in every tier), while `system` reads from `Journals` (the full general ledger view including manual journal postings, paid post 2026-03-02). Omitting the filter is equivalent to `system` and preserves the legacy default. Only honored on connectors where the distinction is exposed; ignored elsewhere.""" class JournalEntriesFilter(BaseModel): @@ -39,6 +48,15 @@ class JournalEntriesFilter(BaseModel): FieldMetadata(query=True), ] = None + scope: Annotated[ + Annotated[ + Optional[JournalEntriesFilterScope], + PlainValidator(validate_open_enum(False)), + ], + FieldMetadata(query=True), + ] = None + r"""Connector-specific scope hint that controls which downstream source backs the read. On Xero, `manual` reads from `ManualJournals` (free in every tier), while `system` reads from `Journals` (the full general ledger view including manual journal postings, paid post 2026-03-02). Omitting the filter is equivalent to `system` and preserves the legacy default. Only honored on connectors where the distinction is exposed; ignored elsewhere.""" + @field_serializer("status") def serialize_status(self, value): if isinstance(value, str): @@ -47,3 +65,12 @@ def serialize_status(self, value): except ValueError: return value return value + + @field_serializer("scope") + def serialize_scope(self, value): + if isinstance(value, str): + try: + return models.JournalEntriesFilterScope(value) + except ValueError: + return value + return value From bd9c997d5602f178003c69a76b798fd3f33425d1 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 00:54:00 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow