diff --git a/previous-versions/commerce/README.md b/previous-versions/commerce/README.md index b17445a58..d08859d0c 100644 --- a/previous-versions/commerce/README.md +++ b/previous-versions/commerce/README.md @@ -7,15 +7,98 @@ You can view your SMB customers' products, orders, payments, payouts, disputes, -replace me +## SDK Installation + +```bash +pip install codat-commerce +``` ## Example Usage -replace me +```python +import codatcommerce +from codatcommerce.models import operations, shared + +s = codatcommerce.CodatCommerce( + auth_header="Basic BASE_64_ENCODED(API_KEY)", +) + +req = operations.GetCompanyInfoRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.company_info.get(req) + +if res.company_info is not None: + # handle response + pass +``` -replace me +## Available Resources and Operations + + +### [company_info](docs/sdks/companyinfo/README.md) + +* [get](docs/sdks/companyinfo/README.md#get) - Get company info + +### [customers](docs/sdks/customers/README.md) + +* [get](docs/sdks/customers/README.md#get) - Get customer +* [list](docs/sdks/customers/README.md#list) - List customers + +### [disputes](docs/sdks/disputes/README.md) + +* [get](docs/sdks/disputes/README.md#get) - Get dispute +* [list](docs/sdks/disputes/README.md#list) - List disputes + +### [locations](docs/sdks/locations/README.md) + +* [get](docs/sdks/locations/README.md#get) - Get location +* [list](docs/sdks/locations/README.md#list) - List locations + +### [orders](docs/sdks/orders/README.md) + +* [get](docs/sdks/orders/README.md#get) - Get order +* [list](docs/sdks/orders/README.md#list) - List orders + +### [payments](docs/sdks/payments/README.md) + +* [get](docs/sdks/payments/README.md#get) - Get payment +* [get_method](docs/sdks/payments/README.md#get_method) - Get payment method +* [list](docs/sdks/payments/README.md#list) - List payments +* [list_methods](docs/sdks/payments/README.md#list_methods) - List payment methods + +### [products](docs/sdks/products/README.md) + +* [get](docs/sdks/products/README.md#get) - Get product +* [get_category](docs/sdks/products/README.md#get_category) - Get product category +* [list](docs/sdks/products/README.md#list) - List products +* [list_categories](docs/sdks/products/README.md#list_categories) - List product categories + +### [tax_components](docs/sdks/taxcomponents/README.md) + +* [get](docs/sdks/taxcomponents/README.md#get) - Get tax component +* [list](docs/sdks/taxcomponents/README.md#list) - List tax components + +### [transactions](docs/sdks/transactions/README.md) + +* [get](docs/sdks/transactions/README.md#get) - Get transaction +* [list](docs/sdks/transactions/README.md#list) - List transactions + + + + + + + + + + + + ### Library generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) \ No newline at end of file diff --git a/previous-versions/commerce/RELEASES.md b/previous-versions/commerce/RELEASES.md index 9d97a44e1..191dd7971 100644 --- a/previous-versions/commerce/RELEASES.md +++ b/previous-versions/commerce/RELEASES.md @@ -616,4 +616,14 @@ Based on: ### Generated - [python v0.1.0] previous-versions/commerce ### Releases -- [PyPI v0.1.0] https://pypi.org/project/codat-commerce/0.1.0 - previous-versions/commerce \ No newline at end of file +- [PyPI v0.1.0] https://pypi.org/project/codat-commerce/0.1.0 - previous-versions/commerce + +## 2023-10-17 14:12:16 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Commerce.yaml +- Speakeasy CLI 1.100.2 (2.159.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.34.0] previous-versions/commerce +### Releases +- [PyPI v0.34.0] https://pypi.org/project/codat-commerce/0.34.0 - previous-versions/commerce \ No newline at end of file diff --git a/previous-versions/commerce/USAGE.md b/previous-versions/commerce/USAGE.md index 754ea2466..d1949cd83 100755 --- a/previous-versions/commerce/USAGE.md +++ b/previous-versions/commerce/USAGE.md @@ -6,9 +6,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetCompanyInfoRequest( @@ -20,5 +18,6 @@ res = s.company_info.get(req) if res.company_info is not None: # handle response + pass ``` \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getcompanyinforequest.md b/previous-versions/commerce/docs/models/operations/getcompanyinforequest.md index cfc4c590f..82b75dcc4 100755 --- a/previous-versions/commerce/docs/models/operations/getcompanyinforequest.md +++ b/previous-versions/commerce/docs/models/operations/getcompanyinforequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getcompanyinforesponse.md b/previous-versions/commerce/docs/models/operations/getcompanyinforesponse.md index 88b734067..e728130f8 100755 --- a/previous-versions/commerce/docs/models/operations/getcompanyinforesponse.md +++ b/previous-versions/commerce/docs/models/operations/getcompanyinforesponse.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | `company_info` | [Optional[shared.CompanyInfo]](../../models/shared/companyinfo.md) | :heavy_minus_sign: | OK | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getcustomerrequest.md b/previous-versions/commerce/docs/models/operations/getcustomerrequest.md index 73c8df78c..cf059182e 100755 --- a/previous-versions/commerce/docs/models/operations/getcustomerrequest.md +++ b/previous-versions/commerce/docs/models/operations/getcustomerrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `customer_id` | *str* | :heavy_check_mark: | Unique identifier for a customer. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getcustomerresponse.md b/previous-versions/commerce/docs/models/operations/getcustomerresponse.md index c9b76230c..5b284ceb8 100755 --- a/previous-versions/commerce/docs/models/operations/getcustomerresponse.md +++ b/previous-versions/commerce/docs/models/operations/getcustomerresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `customer` | [Optional[shared.Customer]](../../models/shared/customer.md) | :heavy_minus_sign: | OK | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getdisputerequest.md b/previous-versions/commerce/docs/models/operations/getdisputerequest.md index 73d3a9b7c..9276f747c 100755 --- a/previous-versions/commerce/docs/models/operations/getdisputerequest.md +++ b/previous-versions/commerce/docs/models/operations/getdisputerequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `dispute_id` | *str* | :heavy_check_mark: | Unique identifier for a dispute. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getdisputeresponse.md b/previous-versions/commerce/docs/models/operations/getdisputeresponse.md index e8c7be65e..74a30c2ec 100755 --- a/previous-versions/commerce/docs/models/operations/getdisputeresponse.md +++ b/previous-versions/commerce/docs/models/operations/getdisputeresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `dispute` | [Optional[shared.Dispute]](../../models/shared/dispute.md) | :heavy_minus_sign: | OK | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getlocationrequest.md b/previous-versions/commerce/docs/models/operations/getlocationrequest.md index e8b14ba95..b5293ad47 100755 --- a/previous-versions/commerce/docs/models/operations/getlocationrequest.md +++ b/previous-versions/commerce/docs/models/operations/getlocationrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `location_id` | *str* | :heavy_check_mark: | Unique identifier for a location. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getlocationresponse.md b/previous-versions/commerce/docs/models/operations/getlocationresponse.md index ce4f675e1..912baf6ba 100755 --- a/previous-versions/commerce/docs/models/operations/getlocationresponse.md +++ b/previous-versions/commerce/docs/models/operations/getlocationresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | | `location` | [Optional[shared.Location]](../../models/shared/location.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getorderrequest.md b/previous-versions/commerce/docs/models/operations/getorderrequest.md index 06962f6a4..8a6cb8b37 100755 --- a/previous-versions/commerce/docs/models/operations/getorderrequest.md +++ b/previous-versions/commerce/docs/models/operations/getorderrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_id` | *str* | :heavy_check_mark: | Unique identifier for an order. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getorderresponse.md b/previous-versions/commerce/docs/models/operations/getorderresponse.md index da592a48c..9e1ac3f59 100755 --- a/previous-versions/commerce/docs/models/operations/getorderresponse.md +++ b/previous-versions/commerce/docs/models/operations/getorderresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | | `order` | [Optional[shared.Order]](../../models/shared/order.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getpaymentmethodrequest.md b/previous-versions/commerce/docs/models/operations/getpaymentmethodrequest.md index bde6d9f7b..122a630c8 100755 --- a/previous-versions/commerce/docs/models/operations/getpaymentmethodrequest.md +++ b/previous-versions/commerce/docs/models/operations/getpaymentmethodrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `payment_method_id` | *str* | :heavy_check_mark: | Unique identifier for a payment method. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getpaymentmethodresponse.md b/previous-versions/commerce/docs/models/operations/getpaymentmethodresponse.md index f239e9e8b..67b8ffb05 100755 --- a/previous-versions/commerce/docs/models/operations/getpaymentmethodresponse.md +++ b/previous-versions/commerce/docs/models/operations/getpaymentmethodresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | | `payment_method` | [Optional[shared.PaymentMethod]](../../models/shared/paymentmethod.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getpaymentrequest.md b/previous-versions/commerce/docs/models/operations/getpaymentrequest.md index 565726256..7b87cedc3 100755 --- a/previous-versions/commerce/docs/models/operations/getpaymentrequest.md +++ b/previous-versions/commerce/docs/models/operations/getpaymentrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `payment_id` | *str* | :heavy_check_mark: | Unique identifier for a payment. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getpaymentresponse.md b/previous-versions/commerce/docs/models/operations/getpaymentresponse.md index fa5f6fc10..f8012ecf3 100755 --- a/previous-versions/commerce/docs/models/operations/getpaymentresponse.md +++ b/previous-versions/commerce/docs/models/operations/getpaymentresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | | `payment` | [Optional[shared.Payment]](../../models/shared/payment.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getproductcategoryrequest.md b/previous-versions/commerce/docs/models/operations/getproductcategoryrequest.md index 6d538c2e6..a8498171d 100755 --- a/previous-versions/commerce/docs/models/operations/getproductcategoryrequest.md +++ b/previous-versions/commerce/docs/models/operations/getproductcategoryrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `product_id` | *str* | :heavy_check_mark: | Unique identifier for a product. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getproductcategoryresponse.md b/previous-versions/commerce/docs/models/operations/getproductcategoryresponse.md index 9868488e3..ada92e1f3 100755 --- a/previous-versions/commerce/docs/models/operations/getproductcategoryresponse.md +++ b/previous-versions/commerce/docs/models/operations/getproductcategoryresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | | `product_category` | [Optional[shared.ProductCategory]](../../models/shared/productcategory.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getproductrequest.md b/previous-versions/commerce/docs/models/operations/getproductrequest.md index 649d7a2a2..da7b24cd9 100755 --- a/previous-versions/commerce/docs/models/operations/getproductrequest.md +++ b/previous-versions/commerce/docs/models/operations/getproductrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `product_id` | *str* | :heavy_check_mark: | Unique identifier for a product. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/getproductresponse.md b/previous-versions/commerce/docs/models/operations/getproductresponse.md index d393c99da..444be628c 100755 --- a/previous-versions/commerce/docs/models/operations/getproductresponse.md +++ b/previous-versions/commerce/docs/models/operations/getproductresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | | `product` | [Optional[shared.Product]](../../models/shared/product.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/gettaxcomponentrequest.md b/previous-versions/commerce/docs/models/operations/gettaxcomponentrequest.md index 092a0274a..f470d210a 100755 --- a/previous-versions/commerce/docs/models/operations/gettaxcomponentrequest.md +++ b/previous-versions/commerce/docs/models/operations/gettaxcomponentrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `tax_id` | *str* | :heavy_check_mark: | Unique identifier for a tax component. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/gettaxcomponentresponse.md b/previous-versions/commerce/docs/models/operations/gettaxcomponentresponse.md index 3d4484d67..382694629 100755 --- a/previous-versions/commerce/docs/models/operations/gettaxcomponentresponse.md +++ b/previous-versions/commerce/docs/models/operations/gettaxcomponentresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `tax_component` | [Optional[shared.TaxComponent]](../../models/shared/taxcomponent.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/gettransactionrequest.md b/previous-versions/commerce/docs/models/operations/gettransactionrequest.md index 039884708..a259224ef 100755 --- a/previous-versions/commerce/docs/models/operations/gettransactionrequest.md +++ b/previous-versions/commerce/docs/models/operations/gettransactionrequest.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `transaction_id` | *str* | :heavy_check_mark: | Unique identifier for a transaction. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/gettransactionresponse.md b/previous-versions/commerce/docs/models/operations/gettransactionresponse.md index 65d6409f7..1021bb5fc 100755 --- a/previous-versions/commerce/docs/models/operations/gettransactionresponse.md +++ b/previous-versions/commerce/docs/models/operations/gettransactionresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `transaction` | [Optional[shared.Transaction]](../../models/shared/transaction.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listcustomersrequest.md b/previous-versions/commerce/docs/models/operations/listcustomersrequest.md index 4cbae0c33..f88c8275e 100755 --- a/previous-versions/commerce/docs/models/operations/listcustomersrequest.md +++ b/previous-versions/commerce/docs/models/operations/listcustomersrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listcustomersresponse.md b/previous-versions/commerce/docs/models/operations/listcustomersresponse.md index 2240b385a..a539dbe01 100755 --- a/previous-versions/commerce/docs/models/operations/listcustomersresponse.md +++ b/previous-versions/commerce/docs/models/operations/listcustomersresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `customers` | [Optional[shared.Customers]](../../models/shared/customers.md) | :heavy_minus_sign: | OK | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listdisputesrequest.md b/previous-versions/commerce/docs/models/operations/listdisputesrequest.md index 059929f66..88e469611 100755 --- a/previous-versions/commerce/docs/models/operations/listdisputesrequest.md +++ b/previous-versions/commerce/docs/models/operations/listdisputesrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listdisputesresponse.md b/previous-versions/commerce/docs/models/operations/listdisputesresponse.md index 25e161621..9f1b0392d 100755 --- a/previous-versions/commerce/docs/models/operations/listdisputesresponse.md +++ b/previous-versions/commerce/docs/models/operations/listdisputesresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `disputes` | [Optional[shared.Disputes]](../../models/shared/disputes.md) | :heavy_minus_sign: | OK | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listlocationsrequest.md b/previous-versions/commerce/docs/models/operations/listlocationsrequest.md index 40484a3d2..6efa3b667 100755 --- a/previous-versions/commerce/docs/models/operations/listlocationsrequest.md +++ b/previous-versions/commerce/docs/models/operations/listlocationsrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listlocationsresponse.md b/previous-versions/commerce/docs/models/operations/listlocationsresponse.md index 23abc31fe..671675613 100755 --- a/previous-versions/commerce/docs/models/operations/listlocationsresponse.md +++ b/previous-versions/commerce/docs/models/operations/listlocationsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | | `locations` | [Optional[shared.Locations]](../../models/shared/locations.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listordersrequest.md b/previous-versions/commerce/docs/models/operations/listordersrequest.md index f6842f06e..5833074b3 100755 --- a/previous-versions/commerce/docs/models/operations/listordersrequest.md +++ b/previous-versions/commerce/docs/models/operations/listordersrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listordersresponse.md b/previous-versions/commerce/docs/models/operations/listordersresponse.md index 348ce7dfe..7b2f65659 100755 --- a/previous-versions/commerce/docs/models/operations/listordersresponse.md +++ b/previous-versions/commerce/docs/models/operations/listordersresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | | `orders` | [Optional[shared.Orders]](../../models/shared/orders.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listpaymentmethodsrequest.md b/previous-versions/commerce/docs/models/operations/listpaymentmethodsrequest.md index 867235554..b37077e01 100755 --- a/previous-versions/commerce/docs/models/operations/listpaymentmethodsrequest.md +++ b/previous-versions/commerce/docs/models/operations/listpaymentmethodsrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listpaymentmethodsresponse.md b/previous-versions/commerce/docs/models/operations/listpaymentmethodsresponse.md index d70bf739b..24ae17bf9 100755 --- a/previous-versions/commerce/docs/models/operations/listpaymentmethodsresponse.md +++ b/previous-versions/commerce/docs/models/operations/listpaymentmethodsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | | `payment_methods` | [Optional[shared.PaymentMethods]](../../models/shared/paymentmethods.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listpaymentsrequest.md b/previous-versions/commerce/docs/models/operations/listpaymentsrequest.md index e6224d142..322944c88 100755 --- a/previous-versions/commerce/docs/models/operations/listpaymentsrequest.md +++ b/previous-versions/commerce/docs/models/operations/listpaymentsrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listpaymentsresponse.md b/previous-versions/commerce/docs/models/operations/listpaymentsresponse.md index 0593bef3c..834b3d40f 100755 --- a/previous-versions/commerce/docs/models/operations/listpaymentsresponse.md +++ b/previous-versions/commerce/docs/models/operations/listpaymentsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | | `payments` | [Optional[shared.Payments]](../../models/shared/payments.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listproductcategoriesrequest.md b/previous-versions/commerce/docs/models/operations/listproductcategoriesrequest.md index 0193b8cfa..a9230cf27 100755 --- a/previous-versions/commerce/docs/models/operations/listproductcategoriesrequest.md +++ b/previous-versions/commerce/docs/models/operations/listproductcategoriesrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listproductcategoriesresponse.md b/previous-versions/commerce/docs/models/operations/listproductcategoriesresponse.md index 314f623a3..4524302a0 100755 --- a/previous-versions/commerce/docs/models/operations/listproductcategoriesresponse.md +++ b/previous-versions/commerce/docs/models/operations/listproductcategoriesresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | | `product_categories` | [Optional[shared.ProductCategories]](../../models/shared/productcategories.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listproductsrequest.md b/previous-versions/commerce/docs/models/operations/listproductsrequest.md index 93d1cffcc..8659ae82d 100755 --- a/previous-versions/commerce/docs/models/operations/listproductsrequest.md +++ b/previous-versions/commerce/docs/models/operations/listproductsrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listproductsresponse.md b/previous-versions/commerce/docs/models/operations/listproductsresponse.md index 108502f6b..7fd0e5911 100755 --- a/previous-versions/commerce/docs/models/operations/listproductsresponse.md +++ b/previous-versions/commerce/docs/models/operations/listproductsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | | `products` | [Optional[shared.Products]](../../models/shared/products.md) | :heavy_minus_sign: | OK | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listtaxcomponentsrequest.md b/previous-versions/commerce/docs/models/operations/listtaxcomponentsrequest.md index 5ad562ac1..9edd5d29c 100755 --- a/previous-versions/commerce/docs/models/operations/listtaxcomponentsrequest.md +++ b/previous-versions/commerce/docs/models/operations/listtaxcomponentsrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listtaxcomponentsresponse.md b/previous-versions/commerce/docs/models/operations/listtaxcomponentsresponse.md index 76b97007f..f65163144 100755 --- a/previous-versions/commerce/docs/models/operations/listtaxcomponentsresponse.md +++ b/previous-versions/commerce/docs/models/operations/listtaxcomponentsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `tax_components` | [Optional[shared.TaxComponents]](../../models/shared/taxcomponents.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/operations/listtransactionsrequest.md b/previous-versions/commerce/docs/models/operations/listtransactionsrequest.md index 81e963825..051cad624 100755 --- a/previous-versions/commerce/docs/models/operations/listtransactionsrequest.md +++ b/previous-versions/commerce/docs/models/operations/listtransactionsrequest.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | diff --git a/previous-versions/commerce/docs/models/operations/listtransactionsresponse.md b/previous-versions/commerce/docs/models/operations/listtransactionsresponse.md index cabfe1d87..c22ae7b2c 100755 --- a/previous-versions/commerce/docs/models/operations/listtransactionsresponse.md +++ b/previous-versions/commerce/docs/models/operations/listtransactionsresponse.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | -| `status_code` | *int* | :heavy_check_mark: | N/A | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | `transactions` | [Optional[shared.Transactions]](../../models/shared/transactions.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/accountbalance.md b/previous-versions/commerce/docs/models/shared/accountbalance.md index 7e917fdcb..cdabad224 100755 --- a/previous-versions/commerce/docs/models/shared/accountbalance.md +++ b/previous-versions/commerce/docs/models/shared/accountbalance.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | -| `available` | *Optional[float]* | :heavy_minus_sign: | The account's current balance | | +| `available` | *Optional[Decimal]* | :heavy_minus_sign: | The account's current balance | | | `currency` | *Optional[str]* | :heavy_minus_sign: | The currency of the account | GBP | -| `pending` | *Optional[float]* | :heavy_minus_sign: | Funds that are not yet available in the balance | | -| `reserved` | *Optional[float]* | :heavy_minus_sign: | Funds reserved as holdings | | \ No newline at end of file +| `pending` | *Optional[Decimal]* | :heavy_minus_sign: | Funds that are not yet available in the balance | | +| `reserved` | *Optional[Any]* | :heavy_minus_sign: | Funds reserved as holdings | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/companyinfo.md b/previous-versions/commerce/docs/models/shared/companyinfo.md index b0cb43b2d..cba60efb0 100755 --- a/previous-versions/commerce/docs/models/shared/companyinfo.md +++ b/previous-versions/commerce/docs/models/shared/companyinfo.md @@ -11,16 +11,16 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `account_balances` | list[[AccountBalance](../../models/shared/accountbalance.md)] | :heavy_minus_sign: | The available and current cash balances for the company's accounts | | -| `addresses` | list[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | Addresses associated with the company | | +| `account_balances` | List[[AccountBalance](../../models/shared/accountbalance.md)] | :heavy_minus_sign: | The available and current cash balances for the company's accounts | | +| `addresses` | List[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | Addresses associated with the company | | | `base_currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | | `commerce_platform_ref` | *Optional[str]* | :heavy_minus_sign: | Identifier or reference for the company in the commerce platform | | | `company_legal_name` | *Optional[str]* | :heavy_minus_sign: | The full legal name of the company | Codat Limited | | `company_name` | *Optional[str]* | :heavy_minus_sign: | The name of the company | Codat | | `created_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `phone_numbers` | list[[PhoneNumber](../../models/shared/phonenumber.md)] | :heavy_minus_sign: | Phone numbers associated with the company | | +| `phone_numbers` | List[[PhoneNumber](../../models/shared/phonenumber.md)] | :heavy_minus_sign: | Phone numbers associated with the company | | | `registration_number` | *Optional[str]* | :heavy_minus_sign: | The registration number of the company | 10480375 | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `source_urls` | dict[str, *str*] | :heavy_minus_sign: | URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system | | -| `web_links` | list[[CompanyInfoWeblink](../../models/shared/companyinfoweblink.md)] | :heavy_minus_sign: | Weblinks associated with the company | | \ No newline at end of file +| `source_urls` | Dict[str, *str*] | :heavy_minus_sign: | URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system | [object Object] | +| `web_links` | List[[CompanyInfoWeblink](../../models/shared/companyinfoweblink.md)] | :heavy_minus_sign: | Weblinks associated with the company | [object Object] | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/customer.md b/previous-versions/commerce/docs/models/shared/customer.md index 85a82fe06..9b1bbfe18 100755 --- a/previous-versions/commerce/docs/models/shared/customer.md +++ b/previous-versions/commerce/docs/models/shared/customer.md @@ -9,7 +9,7 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `addresses` | list[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | Addresses of the customer | | +| `addresses` | List[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | Addresses of the customer | | | `created_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `customer_name` | *Optional[str]* | :heavy_minus_sign: | Name of the customer | Fred Smith | | `default_currency` | *Optional[str]* | :heavy_minus_sign: | N/A | GBP | diff --git a/previous-versions/commerce/docs/models/shared/customers.md b/previous-versions/commerce/docs/models/shared/customers.md index 57a0b0056..0ef44bd32 100755 --- a/previous-versions/commerce/docs/models/shared/customers.md +++ b/previous-versions/commerce/docs/models/shared/customers.md @@ -1,14 +1,12 @@ # Customers -OK - ## Fields | Field | Type | Required | Description | | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[Customer](../../models/shared/customer.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[Customer](../../models/shared/customer.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/dispute.md b/previous-versions/commerce/docs/models/shared/dispute.md index 3c3ed24c5..6bfa039fc 100755 --- a/previous-versions/commerce/docs/models/shared/dispute.md +++ b/previous-versions/commerce/docs/models/shared/dispute.md @@ -16,11 +16,11 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `created_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `currency` | *str* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `disputed_transactions` | list[[TransactionSourceRef](../../models/shared/transactionsourceref.md)] | :heavy_minus_sign: | Link to the source event(s) which triggered this transaction. | | +| `disputed_transactions` | List[[TransactionSourceRef](../../models/shared/transactionsourceref.md)] | :heavy_minus_sign: | Link to the source event(s) which triggered this transaction. | | | `due_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `id` | *str* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `reason` | *Optional[str]* | :heavy_minus_sign: | Reason for the dispute | Unhappy with product | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `status` | [Optional[DisputeStatus]](../../models/shared/disputestatus.md) | :heavy_minus_sign: | Current status of the dispute | EvidenceRequired | -| `total_amount` | *Optional[float]* | :heavy_minus_sign: | Total transaction amount that is under dispute. | 194.12 | \ No newline at end of file +| `total_amount` | *Optional[Any]* | :heavy_minus_sign: | Total transaction amount that is under dispute. | 194.12 | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/disputes.md b/previous-versions/commerce/docs/models/shared/disputes.md index 4e0f2cd14..04853134d 100755 --- a/previous-versions/commerce/docs/models/shared/disputes.md +++ b/previous-versions/commerce/docs/models/shared/disputes.md @@ -1,14 +1,12 @@ # Disputes -OK - ## Fields | Field | Type | Required | Description | | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[Dispute](../../models/shared/dispute.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[Dispute](../../models/shared/dispute.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/errormessage.md b/previous-versions/commerce/docs/models/shared/errormessage.md index b32400646..2d1289c0d 100755 --- a/previous-versions/commerce/docs/models/shared/errormessage.md +++ b/previous-versions/commerce/docs/models/shared/errormessage.md @@ -1,15 +1,13 @@ # ErrorMessage -Your `query` parameter was not correctly formed - ## Fields -| Field | Type | Required | Description | -| --------------------- | --------------------- | --------------------- | --------------------- | -| `can_be_retried` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `correlation_id` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `detailed_error_code` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `error` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `service` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `status_code` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `can_be_retried` | *Optional[str]* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | +| `correlation_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | +| `detailed_error_code` | *Optional[int]* | :heavy_minus_sign: | Machine readable error code used to automate processes based on the code returned. | +| `error` | *Optional[str]* | :heavy_minus_sign: | A brief description of the error. | +| `service` | *Optional[str]* | :heavy_minus_sign: | Codat's service the returned the error. | +| `status_code` | *Optional[int]* | :heavy_minus_sign: | The HTTP status code returned by the error. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/halref.md b/previous-versions/commerce/docs/models/shared/halref.md index fef2ab2fc..94c6476ff 100755 --- a/previous-versions/commerce/docs/models/shared/halref.md +++ b/previous-versions/commerce/docs/models/shared/halref.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `href` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `href` | *Optional[str]* | :heavy_minus_sign: | Uri hypertext reference. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/locations.md b/previous-versions/commerce/docs/models/shared/locations.md index 1622d9723..c27122ed4 100755 --- a/previous-versions/commerce/docs/models/shared/locations.md +++ b/previous-versions/commerce/docs/models/shared/locations.md @@ -1,14 +1,12 @@ # Locations -OK - ## Fields | Field | Type | Required | Description | | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[Location](../../models/shared/location.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[Location](../../models/shared/location.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/order.md b/previous-versions/commerce/docs/models/shared/order.md index f9f86f85b..8940c8607 100755 --- a/previous-versions/commerce/docs/models/shared/order.md +++ b/previous-versions/commerce/docs/models/shared/order.md @@ -18,14 +18,14 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `id` | *str* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | | `location_ref` | [Optional[LocationRef]](../../models/shared/locationref.md) | :heavy_minus_sign: | Reference to the geographic location where the order was placed. | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `order_line_items` | list[[OrderLineItem](../../models/shared/orderlineitem.md)] | :heavy_minus_sign: | N/A | | +| `order_line_items` | List[[OrderLineItem](../../models/shared/orderlineitem.md)] | :heavy_minus_sign: | N/A | | | `order_number` | *Optional[str]* | :heavy_minus_sign: | Friendly reference for the order in the commerce or point of sale platform. | | -| `payments` | list[[PaymentRef](../../models/shared/paymentref.md)] | :heavy_minus_sign: | N/A | | -| `service_charges` | list[[ServiceCharge](../../models/shared/servicecharge.md)] | :heavy_minus_sign: | N/A | | +| `payments` | List[[PaymentRef](../../models/shared/paymentref.md)] | :heavy_minus_sign: | N/A | | +| `service_charges` | List[[ServiceCharge](../../models/shared/servicecharge.md)] | :heavy_minus_sign: | N/A | | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `supplemental_data` | [Optional[OrderSupplementalData]](../../models/shared/ordersupplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. | | -| `total_amount` | *Optional[float]* | :heavy_minus_sign: | Total amount of the order, including tax, net of any discounts and refunds. | | -| `total_discount` | *Optional[float]* | :heavy_minus_sign: | Total amount of discount applied to the order. | | -| `total_gratuity` | *Optional[float]* | :heavy_minus_sign: | Extra amount added to a bill. | | -| `total_refund` | *Optional[float]* | :heavy_minus_sign: | Total amount refunded issued by a merchant on an order (always a negative value). | | -| `total_tax_amount` | *Optional[float]* | :heavy_minus_sign: | Total amount of tax applied to the order. | | \ No newline at end of file +| `supplemental_data` | [Optional[SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of the order, including discounts, refunds, and tax, but excluding gratuities. | | +| `total_discount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order). | | +| `total_gratuity` | *Optional[Decimal]* | :heavy_minus_sign: | Extra amount added to the order. | | +| `total_refund` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative. | | +| `total_tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of tax applied to the order. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/orderdiscountallocation.md b/previous-versions/commerce/docs/models/shared/orderdiscountallocation.md index bcf4d3a4e..84a454e20 100755 --- a/previous-versions/commerce/docs/models/shared/orderdiscountallocation.md +++ b/previous-versions/commerce/docs/models/shared/orderdiscountallocation.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the discount in the commerce or point of sale platform. | Promotional Discount | -| `total_amount` | *Optional[float]* | :heavy_minus_sign: | Total amount of discount applied. | 15.25 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the discount in the commerce or point of sale platform. | Promotional Discount | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line). | 15.25 | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/orderlineitem.md b/previous-versions/commerce/docs/models/shared/orderlineitem.md index 288c33e9f..fa5ad253a 100755 --- a/previous-versions/commerce/docs/models/shared/orderlineitem.md +++ b/previous-versions/commerce/docs/models/shared/orderlineitem.md @@ -5,13 +5,13 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `discount_allocations` | list[[OrderDiscountAllocation](../../models/shared/orderdiscountallocation.md)] | :heavy_minus_sign: | N/A | | +| `discount_allocations` | List[[OrderDiscountAllocation](../../models/shared/orderdiscountallocation.md)] | :heavy_minus_sign: | N/A | | | `id` | *str* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | | `product_ref` | [Optional[ProductRef]](../../models/shared/productref.md) | :heavy_minus_sign: | Reference that links the line item to the correct product details. | | | `product_variant_ref` | [Optional[ProductVariantRef]](../../models/shared/productvariantref.md) | :heavy_minus_sign: | Reference that links the line item to the specific version of product that has been ordered. | | -| `quantity` | *Optional[float]* | :heavy_minus_sign: | Number of units of the product sold.
For refunds, quantity is a negative value.
| | -| `tax_percentage` | *Optional[float]* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any sale tax applied to the unit amount. | 0 | -| `taxes` | list[[TaxComponentAllocation](../../models/shared/taxcomponentallocation.md)] | :heavy_minus_sign: | Taxes breakdown as applied to order lines. | | -| `total_amount` | *Optional[float]* | :heavy_minus_sign: | Total price of the line item, including discounts, tax and minus any refunds. | | -| `total_tax_amount` | *Optional[float]* | :heavy_minus_sign: | Total amount of tax applied to the line item. | | -| `unit_price` | *Optional[float]* | :heavy_minus_sign: | Price per unit of goods or service. | | \ No newline at end of file +| `quantity` | *Optional[Decimal]* | :heavy_minus_sign: | Number of units of the product sold.
For refunds, quantity is negative.
| | +| `tax_percentage` | *Optional[Decimal]* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any sales tax applied to the unit price. | 0 | +| `taxes` | List[[TaxComponentAllocation](../../models/shared/taxcomponentallocation.md)] | :heavy_minus_sign: | Taxes breakdown as applied to order lines. | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | | +| `total_tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of tax applied to the line item, factoring in any discounts. | | +| `unit_price` | *Optional[Decimal]* | :heavy_minus_sign: | Price per unit of goods or services, excluding discounts and tax. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/orders.md b/previous-versions/commerce/docs/models/shared/orders.md index 17c75d356..02cce5a05 100755 --- a/previous-versions/commerce/docs/models/shared/orders.md +++ b/previous-versions/commerce/docs/models/shared/orders.md @@ -1,14 +1,12 @@ # Orders -OK - ## Fields | Field | Type | Required | Description | | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[Order](../../models/shared/order.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[Order](../../models/shared/order.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/payment.md b/previous-versions/commerce/docs/models/shared/payment.md index b888a81bf..6b27d6caf 100755 --- a/previous-versions/commerce/docs/models/shared/payment.md +++ b/previous-versions/commerce/docs/models/shared/payment.md @@ -13,13 +13,14 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount` | *Optional[float]* | :heavy_minus_sign: | Payment Amount (including gratuity) | 194.12 | +| `amount` | *Optional[Decimal]* | :heavy_minus_sign: | Payment Amount (including gratuity) | 194.12 | | `created_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | | `due_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `id` | *str* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `payment_method_ref` | *Optional[Any]* | :heavy_minus_sign: | N/A | | +| `payment_method_ref` | [Optional[PaymentMethodRef]](../../models/shared/paymentmethodref.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce platform. | | | `payment_provider` | *Optional[str]* | :heavy_minus_sign: | Service provider of the payment, if applicable. | Amazon Pay | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `status` | [Optional[PaymentStatus]](../../models/shared/paymentstatus.md) | :heavy_minus_sign: | Status of the payment. | | \ No newline at end of file +| `status` | [Optional[PaymentStatus]](../../models/shared/paymentstatus.md) | :heavy_minus_sign: | Status of the payment. | | +| `supplemental_data` | [Optional[SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/paymentmethod.md b/previous-versions/commerce/docs/models/shared/paymentmethod.md index 59112c935..b405691b6 100755 --- a/previous-versions/commerce/docs/models/shared/paymentmethod.md +++ b/previous-versions/commerce/docs/models/shared/paymentmethod.md @@ -13,4 +13,4 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `name` | *Optional[str]* | :heavy_minus_sign: | The name of the PaymentMethod | Alipay | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `status` | [Optional[PaymentMethodStatus]](../../models/shared/paymentmethodstatus.md) | :heavy_minus_sign: | Status of the Payment Method | Active | \ No newline at end of file +| `status` | [Optional[PaymentMethodStatus]](../../models/shared/paymentmethodstatus.md) | :heavy_minus_sign: | Status of the Payment Method. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/paymentmethodref.md b/previous-versions/commerce/docs/models/shared/paymentmethodref.md new file mode 100755 index 000000000..9f8fd8995 --- /dev/null +++ b/previous-versions/commerce/docs/models/shared/paymentmethodref.md @@ -0,0 +1,11 @@ +# PaymentMethodRef + +The payment method the record is linked to in the accounting or commerce platform. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the location being referenced. | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the location being referenced. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/paymentmethods.md b/previous-versions/commerce/docs/models/shared/paymentmethods.md index 2554932b2..25dae3cce 100755 --- a/previous-versions/commerce/docs/models/shared/paymentmethods.md +++ b/previous-versions/commerce/docs/models/shared/paymentmethods.md @@ -1,14 +1,12 @@ # PaymentMethods -OK - ## Fields | Field | Type | Required | Description | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[PaymentMethod](../../models/shared/paymentmethod.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[PaymentMethod](../../models/shared/paymentmethod.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/paymentmethodstatus.md b/previous-versions/commerce/docs/models/shared/paymentmethodstatus.md index a34ab7a84..18014390a 100755 --- a/previous-versions/commerce/docs/models/shared/paymentmethodstatus.md +++ b/previous-versions/commerce/docs/models/shared/paymentmethodstatus.md @@ -1,12 +1,12 @@ # PaymentMethodStatus -Status of the Payment Method +Status of the Payment Method. ## Values | Name | Value | | ---------- | ---------- | +| `UNKNOWN` | Unknown | | `ACTIVE` | Active | -| `ARCHIVED` | Archived | -| `UNKNOWN` | Unknown | \ No newline at end of file +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/paymentref.md b/previous-versions/commerce/docs/models/shared/paymentref.md index fdc4fd6d5..7e0588b0e 100755 --- a/previous-versions/commerce/docs/models/shared/paymentref.md +++ b/previous-versions/commerce/docs/models/shared/paymentref.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount` | *Optional[float]* | :heavy_minus_sign: | Payment Amount (including gratuity). | 194.12 | +| `amount` | *Optional[Decimal]* | :heavy_minus_sign: | Payment Amount (including gratuity). | 194.12 | | `created_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | | `due_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | diff --git a/previous-versions/commerce/docs/models/shared/payments.md b/previous-versions/commerce/docs/models/shared/payments.md index 93a5f54a2..6216b6215 100755 --- a/previous-versions/commerce/docs/models/shared/payments.md +++ b/previous-versions/commerce/docs/models/shared/payments.md @@ -1,14 +1,12 @@ # Payments -OK - ## Fields | Field | Type | Required | Description | | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[Payment](../../models/shared/payment.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[Payment](../../models/shared/payment.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/phonenumber.md b/previous-versions/commerce/docs/models/shared/phonenumber.md index 252898c68..84a85c5e2 100755 --- a/previous-versions/commerce/docs/models/shared/phonenumber.md +++ b/previous-versions/commerce/docs/models/shared/phonenumber.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `number` | *str* | :heavy_check_mark: | A phone number. | +44 25691 154789 | +| `number` | *Optional[str]* | :heavy_check_mark: | A phone number. | +44 25691 154789 | | `type` | [PhoneNumberType](../../models/shared/phonenumbertype.md) | :heavy_check_mark: | The type of phone number | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/product.md b/previous-versions/commerce/docs/models/shared/product.md index de8dae160..430a1a516 100755 --- a/previous-versions/commerce/docs/models/shared/product.md +++ b/previous-versions/commerce/docs/models/shared/product.md @@ -8,11 +8,12 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `categorization` | *Optional[str]* | :heavy_minus_sign: | Retail category that the product is assigned to | Hardware | -| `description` | *Optional[str]* | :heavy_minus_sign: | Description of the product recorded in the commerce or point of sale platform. | 1tb Western Digital Hard Drive | -| `id` | *str* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `is_gift_card` | *Optional[bool]* | :heavy_minus_sign: | Whether the product represents a gift card or voucher that
can be redeemed in the commerce or POS platform
| | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the product in the commerce or POS system | Hard Drive | -| `variants` | list[[ProductVariant](../../models/shared/productvariant.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `categorization` | *Optional[str]* | :heavy_minus_sign: | Retail category that the product is assigned to e.g. `Hardware`. | Hardware | +| `description` | *Optional[str]* | :heavy_minus_sign: | Description of the product recorded in the commerce or point of sale platform. | 1tb Western Digital Hard Drive | +| `id` | *str* | :heavy_check_mark: | A unique, persistent identifier for this record | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `is_gift_card` | *Optional[bool]* | :heavy_minus_sign: | Whether the product represents a gift card or voucher that
can be redeemed in the commerce or POS platform.
| | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the product in the commerce or POS system | Hard Drive | +| `supplemental_data` | [Optional[SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `variants` | List[[ProductVariant](../../models/shared/productvariant.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/productcategories.md b/previous-versions/commerce/docs/models/shared/productcategories.md index a3bedff4a..47b1536a6 100755 --- a/previous-versions/commerce/docs/models/shared/productcategories.md +++ b/previous-versions/commerce/docs/models/shared/productcategories.md @@ -1,14 +1,12 @@ # ProductCategories -OK - ## Fields | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[ProductCategory](../../models/shared/productcategory.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[ProductCategory](../../models/shared/productcategory.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/productcategory.md b/previous-versions/commerce/docs/models/shared/productcategory.md index 6ab48494b..cb0699a7a 100755 --- a/previous-versions/commerce/docs/models/shared/productcategory.md +++ b/previous-versions/commerce/docs/models/shared/productcategory.md @@ -9,7 +9,7 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `ancestor_refs` | list[[RecordRef](../../models/shared/recordref.md)] | :heavy_minus_sign: | A collection of parent product categories implicitly ordered with the immediate parent last in the list. | | +| `ancestor_refs` | List[[RecordRef](../../models/shared/recordref.md)] | :heavy_minus_sign: | A collection of parent product categories implicitly ordered with the immediate parent last in the list. | | | `has_children` | *Optional[bool]* | :heavy_minus_sign: | A boolean indicating whether there are other product categories beneath this one in the hierarchy. | | | `id` | *Optional[str]* | :heavy_minus_sign: | The unique identifier of the product category | "102" | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | diff --git a/previous-versions/commerce/docs/models/shared/productinventory.md b/previous-versions/commerce/docs/models/shared/productinventory.md index f89e3b0ce..a551e7026 100755 --- a/previous-versions/commerce/docs/models/shared/productinventory.md +++ b/previous-versions/commerce/docs/models/shared/productinventory.md @@ -7,5 +7,5 @@ Information about the total inventory as well as the locations inventory is in. | Field | Type | Required | Description | | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `locations` | list[[ProductInventoryLocation](../../models/shared/productinventorylocation.md)] | :heavy_minus_sign: | N/A | -| `total_quantity` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `locations` | List[[ProductInventoryLocation](../../models/shared/productinventorylocation.md)] | :heavy_minus_sign: | N/A | +| `total_quantity` | *Optional[Decimal]* | :heavy_minus_sign: | The total quantity of stock remaining across locations. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/productinventorylocation.md b/previous-versions/commerce/docs/models/shared/productinventorylocation.md index 8db3a845e..3ebe8cefa 100755 --- a/previous-versions/commerce/docs/models/shared/productinventorylocation.md +++ b/previous-versions/commerce/docs/models/shared/productinventorylocation.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | | `location_ref` | [Optional[LocationRef]](../../models/shared/locationref.md) | :heavy_minus_sign: | Reference to the geographic location where the order was placed. | -| `quantity` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `quantity` | *Optional[Decimal]* | :heavy_minus_sign: | The quantity of stock remaining at location. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/productprice.md b/previous-versions/commerce/docs/models/shared/productprice.md index dc6c7fdb0..c7143ea68 100755 --- a/previous-versions/commerce/docs/models/shared/productprice.md +++ b/previous-versions/commerce/docs/models/shared/productprice.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `unit_price` | *Optional[float]* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `unit_price` | *Optional[Decimal]* | :heavy_minus_sign: | The product variant's unit price. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/productref.md b/previous-versions/commerce/docs/models/shared/productref.md index 442e20373..69c038149 100755 --- a/previous-versions/commerce/docs/models/shared/productref.md +++ b/previous-versions/commerce/docs/models/shared/productref.md @@ -5,7 +5,7 @@ Reference that links the line item to the correct product details. ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The unique identitifer of the product being referenced. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the product being referenced. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the product being referenced. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the product being referenced. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/products.md b/previous-versions/commerce/docs/models/shared/products.md index 38f2a6c12..9ee02858a 100755 --- a/previous-versions/commerce/docs/models/shared/products.md +++ b/previous-versions/commerce/docs/models/shared/products.md @@ -1,14 +1,12 @@ # Products -OK - ## Fields | Field | Type | Required | Description | | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[Product](../../models/shared/product.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[Product](../../models/shared/product.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/productvariant.md b/previous-versions/commerce/docs/models/shared/productvariant.md index 22f0f989a..70b360a62 100755 --- a/previous-versions/commerce/docs/models/shared/productvariant.md +++ b/previous-versions/commerce/docs/models/shared/productvariant.md @@ -15,10 +15,10 @@ Represents a variation of a product available for sale, for example an item of c | `is_tax_enabled` | *Optional[bool]* | :heavy_minus_sign: | Whether sales taxes are enabled for this product variant. | | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `name` | *Optional[str]* | :heavy_minus_sign: | Name of the product recorded in the commerce or point of sale platform. | Red Coat | -| `prices` | list[[ProductPrice](../../models/shared/productprice.md)] | :heavy_minus_sign: | Prices for the product variants in different currencies. | | +| `prices` | List[[ProductPrice](../../models/shared/productprice.md)] | :heavy_minus_sign: | Prices for the product variants in different currencies. | | | `shipping_required` | *Optional[bool]* | :heavy_minus_sign: | Indicates whether or not the product requires physical delivery. | | | `sku` | *Optional[str]* | :heavy_minus_sign: | SKU (stock keeping unit) of the variant, as defined by the merchant. | Coat-Red-Lrg | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | -| `status` | [Optional[ProductVariantStatus]](../../models/shared/productvariantstatus.md) | :heavy_minus_sign: | N/A | | +| `status` | [Optional[ProductVariantStatus]](../../models/shared/productvariantstatus.md) | :heavy_minus_sign: | The status of the product variant. | | | `unit_of_measure` | *Optional[str]* | :heavy_minus_sign: | Unit of measure for the variant, such as `kg` or `meters`. | kg | -| `vat_percentage` | *Optional[float]* | :heavy_minus_sign: | VAT rate for the product variant if sales taxes are enabled. | 12.5 | \ No newline at end of file +| `vat_percentage` | *Optional[Decimal]* | :heavy_minus_sign: | VAT rate for the product variant if sales taxes are enabled. | 12.5 | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/productvariantref.md b/previous-versions/commerce/docs/models/shared/productvariantref.md index 7eb6aeee5..34c2bb82f 100755 --- a/previous-versions/commerce/docs/models/shared/productvariantref.md +++ b/previous-versions/commerce/docs/models/shared/productvariantref.md @@ -5,7 +5,7 @@ Reference that links the line item to the specific version of product that has b ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | The unique identitifer of the product variant being referenced. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the product variant being referenced. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the product variant being referenced. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the product variant being referenced. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/productvariantstatus.md b/previous-versions/commerce/docs/models/shared/productvariantstatus.md index 3a6aefbda..cac82c987 100755 --- a/previous-versions/commerce/docs/models/shared/productvariantstatus.md +++ b/previous-versions/commerce/docs/models/shared/productvariantstatus.md @@ -1,5 +1,7 @@ # ProductVariantStatus +The status of the product variant. + ## Values diff --git a/previous-versions/commerce/docs/models/shared/servicecharge.md b/previous-versions/commerce/docs/models/shared/servicecharge.md index 76009419a..0b098f367 100755 --- a/previous-versions/commerce/docs/models/shared/servicecharge.md +++ b/previous-versions/commerce/docs/models/shared/servicecharge.md @@ -7,8 +7,8 @@ | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `description` | *Optional[str]* | :heavy_minus_sign: | Service charges for this order. | A service charge | | `quantity` | *Optional[int]* | :heavy_minus_sign: | The number of times the charge is charged. | 1 | -| `tax_amount` | *Optional[float]* | :heavy_minus_sign: | Amount of the service charge that is tax. | 0 | -| `tax_percentage` | *Optional[float]* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any tax applied to the service charge. | 0 | -| `taxes` | list[[TaxComponentAllocation](../../models/shared/taxcomponentallocation.md)] | :heavy_minus_sign: | Taxes breakdown as applied to service charges. | | -| `total_amount` | *Optional[float]* | :heavy_minus_sign: | Total service charge, including taxes. | 0 | +| `tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the service charge that is tax. | 0 | +| `tax_percentage` | *Optional[Decimal]* | :heavy_minus_sign: | Percentage rate (from 0 to 100) of any tax applied to the service charge. | 0 | +| `taxes` | List[[TaxComponentAllocation](../../models/shared/taxcomponentallocation.md)] | :heavy_minus_sign: | Taxes breakdown as applied to service charges. | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of the service charge, including tax. | 0 | | `type` | [Optional[ServiceChargeType]](../../models/shared/servicechargetype.md) | :heavy_minus_sign: | The type of the service charge. | Overpayment | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/ordersupplementaldata.md b/previous-versions/commerce/docs/models/shared/supplementaldata.md similarity index 77% rename from previous-versions/commerce/docs/models/shared/ordersupplementaldata.md rename to previous-versions/commerce/docs/models/shared/supplementaldata.md index 38c298b2d..f9d04fc2b 100755 --- a/previous-versions/commerce/docs/models/shared/ordersupplementaldata.md +++ b/previous-versions/commerce/docs/models/shared/supplementaldata.md @@ -1,12 +1,12 @@ -# OrderSupplementalData +# SupplementalData Supplemental data is additional data you can include in our standard data types. -It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. +It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. ## Fields | Field | Type | Required | Description | | --------------------------- | --------------------------- | --------------------------- | --------------------------- | -| `content` | dict[str, dict[str, *Any*]] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `content` | Dict[str, Dict[str, *Any*]] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/taxcomponent.md b/previous-versions/commerce/docs/models/shared/taxcomponent.md index a9a9986c4..169076a65 100755 --- a/previous-versions/commerce/docs/models/shared/taxcomponent.md +++ b/previous-versions/commerce/docs/models/shared/taxcomponent.md @@ -13,5 +13,5 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `is_compound` | *Optional[bool]* | :heavy_minus_sign: | The Boolean flag to indicate when a Tax Rate Component compounds on a sale. | true | | `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `name` | *Optional[str]* | :heavy_minus_sign: | Name of the Tax Rate Component in the source commerce platform. | Sales Tax | -| `rate` | *Optional[float]* | :heavy_minus_sign: | Rate of taxation represented as a fraction of the net price (typically in the range 0.00 - 1.00). | 0.15 | +| `rate` | *Optional[Decimal]* | :heavy_minus_sign: | Rate of taxation represented as a fraction of the net price (typically in the range 0.00 - 1.00). | 0.15 | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/taxcomponentallocation.md b/previous-versions/commerce/docs/models/shared/taxcomponentallocation.md index 9ee8a10a6..436af3294 100755 --- a/previous-versions/commerce/docs/models/shared/taxcomponentallocation.md +++ b/previous-versions/commerce/docs/models/shared/taxcomponentallocation.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `rate` | *Optional[float]* | :heavy_minus_sign: | Tax amount on order line sale as available from source commerce platform. | +| `rate` | *Optional[Decimal]* | :heavy_minus_sign: | Tax amount on order line sale as available from source commerce platform. | | `tax_component_ref` | [Optional[TaxComponentRef]](../../models/shared/taxcomponentref.md) | :heavy_minus_sign: | Taxes rates reference object depending on the rates being available on source commerce package. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/taxcomponents.md b/previous-versions/commerce/docs/models/shared/taxcomponents.md index 370a5f265..7b52fde33 100755 --- a/previous-versions/commerce/docs/models/shared/taxcomponents.md +++ b/previous-versions/commerce/docs/models/shared/taxcomponents.md @@ -1,14 +1,12 @@ # TaxComponents -OK - ## Fields | Field | Type | Required | Description | | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[TaxComponent](../../models/shared/taxcomponent.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[TaxComponent](../../models/shared/taxcomponent.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/transaction.md b/previous-versions/commerce/docs/models/shared/transaction.md index ae747f711..011455c07 100755 --- a/previous-versions/commerce/docs/models/shared/transaction.md +++ b/previous-versions/commerce/docs/models/shared/transaction.md @@ -23,6 +23,7 @@ Explore our [data coverage](https://knowledge.codat.io/supported-features/commer | `source_created_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00.000Z | | `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | | `sub_type` | *Optional[str]* | :heavy_minus_sign: | Non-standardised transaction type data from the commerce platform | CardPayment | -| `total_amount` | *Optional[float]* | :heavy_minus_sign: | The total transaction amount | 194.12 | +| `supplemental_data` | [Optional[SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | The total transaction amount | 194.12 | | `transaction_source_ref` | [Optional[TransactionSourceRef]](../../models/shared/transactionsourceref.md) | :heavy_minus_sign: | Link to the source event which triggered this transaction | | | `type` | [Optional[TransactionType]](../../models/shared/transactiontype.md) | :heavy_minus_sign: | The type of the platform transaction:
- `Unknown`
- `FailedPayout` — Failed transfer of funds from the seller's merchant account to their bank account.
- `Payment` — Credit and debit card payments.
- `PaymentFee` — Payment provider's fee on each card payment.
- `PaymentFeeRefund` — Payment provider's fee that has been refunded to the seller.
- `Payout` — Transfer of funds from the seller's merchant account to their bank account.
- `Refund` — Refunds to a customer's credit or debit card.
- `Transfer` — Secure transfer of funds to the seller's bank account. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/transactions.md b/previous-versions/commerce/docs/models/shared/transactions.md index 4759e45a5..0cc12f4d9 100755 --- a/previous-versions/commerce/docs/models/shared/transactions.md +++ b/previous-versions/commerce/docs/models/shared/transactions.md @@ -1,14 +1,12 @@ # Transactions -OK - ## Fields | Field | Type | Required | Description | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | | `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | -| `page_number` | *int* | :heavy_check_mark: | N/A | -| `page_size` | *int* | :heavy_check_mark: | N/A | -| `results` | list[[Transaction](../../models/shared/transaction.md)] | :heavy_minus_sign: | N/A | -| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file +| `page_number` | *int* | :heavy_check_mark: | Current page number. | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | +| `results` | List[[Transaction](../../models/shared/transaction.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/transactionsourceref.md b/previous-versions/commerce/docs/models/shared/transactionsourceref.md index f39387a85..5336242fc 100755 --- a/previous-versions/commerce/docs/models/shared/transactionsourceref.md +++ b/previous-versions/commerce/docs/models/shared/transactionsourceref.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | The unique identitifer of the record being referenced | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `type` | [TransactionSourceType](../../models/shared/transactionsourcetype.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `type` | [TransactionSourceType](../../models/shared/transactionsourcetype.md) | :heavy_check_mark: | The type of source the transaction arose. | | \ No newline at end of file diff --git a/previous-versions/commerce/docs/models/shared/transactionsourcetype.md b/previous-versions/commerce/docs/models/shared/transactionsourcetype.md index dc353aa07..1c0f09833 100755 --- a/previous-versions/commerce/docs/models/shared/transactionsourcetype.md +++ b/previous-versions/commerce/docs/models/shared/transactionsourcetype.md @@ -1,5 +1,7 @@ # TransactionSourceType +The type of source the transaction arose. + ## Values diff --git a/previous-versions/commerce/docs/sdks/codatcommerce/README.md b/previous-versions/commerce/docs/sdks/codatcommerce/README.md index 793f3ac7e..9f0d358e5 100755 --- a/previous-versions/commerce/docs/sdks/codatcommerce/README.md +++ b/previous-versions/commerce/docs/sdks/codatcommerce/README.md @@ -1,5 +1,6 @@ # CodatCommerce SDK + ## Overview Codat's Commerce API allows you to access standardised data from over 11 commerce and POS systems. diff --git a/previous-versions/commerce/docs/sdks/companyinfo/README.md b/previous-versions/commerce/docs/sdks/companyinfo/README.md index 269036b28..35d8075b6 100755 --- a/previous-versions/commerce/docs/sdks/companyinfo/README.md +++ b/previous-versions/commerce/docs/sdks/companyinfo/README.md @@ -1,4 +1,5 @@ -# company_info +# CompanyInfo +(*company_info*) ## Overview @@ -21,9 +22,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetCompanyInfoRequest( @@ -35,6 +34,7 @@ res = s.company_info.get(req) if res.company_info is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/docs/sdks/customers/README.md b/previous-versions/commerce/docs/sdks/customers/README.md index e14a99db8..0e2ddddc0 100755 --- a/previous-versions/commerce/docs/sdks/customers/README.md +++ b/previous-versions/commerce/docs/sdks/customers/README.md @@ -1,4 +1,5 @@ -# customers +# Customers +(*customers*) ## Overview @@ -27,21 +28,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetCustomerRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - customer_id='corrupti', + customer_id='Northeast Hatchback Kia', ) res = s.customers.get(req) if res.customer is not None: # handle response + pass ``` ### Parameters @@ -73,9 +73,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListCustomersRequest( @@ -84,13 +82,13 @@ req = operations.ListCustomersRequest( order_by='-modifiedDate', page=1, page_size=100, - query='provident', ) res = s.customers.list(req) if res.customers is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/docs/sdks/disputes/README.md b/previous-versions/commerce/docs/sdks/disputes/README.md index d6876b2b9..7264ab2f5 100755 --- a/previous-versions/commerce/docs/sdks/disputes/README.md +++ b/previous-versions/commerce/docs/sdks/disputes/README.md @@ -1,4 +1,5 @@ -# disputes +# Disputes +(*disputes*) ## Overview @@ -27,21 +28,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetDisputeRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - dispute_id='distinctio', + dispute_id='Northeast Hatchback Kia', ) res = s.disputes.get(req) if res.dispute is not None: # handle response + pass ``` ### Parameters @@ -73,9 +73,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListDisputesRequest( @@ -84,13 +82,13 @@ req = operations.ListDisputesRequest( order_by='-modifiedDate', page=1, page_size=100, - query='quibusdam', ) res = s.disputes.list(req) if res.disputes is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/docs/sdks/locations/README.md b/previous-versions/commerce/docs/sdks/locations/README.md index 3520ada14..6118e5a4d 100755 --- a/previous-versions/commerce/docs/sdks/locations/README.md +++ b/previous-versions/commerce/docs/sdks/locations/README.md @@ -1,4 +1,5 @@ -# locations +# Locations +(*locations*) ## Overview @@ -27,21 +28,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetLocationRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - location_id='unde', + location_id='Northeast Hatchback Kia', ) res = s.locations.get(req) if res.location is not None: # handle response + pass ``` ### Parameters @@ -73,9 +73,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListLocationsRequest( @@ -87,6 +85,7 @@ res = s.locations.list(req) if res.locations is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/docs/sdks/orders/README.md b/previous-versions/commerce/docs/sdks/orders/README.md index f699c052d..6bbd10cae 100755 --- a/previous-versions/commerce/docs/sdks/orders/README.md +++ b/previous-versions/commerce/docs/sdks/orders/README.md @@ -1,4 +1,5 @@ -# orders +# Orders +(*orders*) ## Overview @@ -27,21 +28,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetOrderRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - order_id='nulla', + order_id='Northeast Hatchback Kia', ) res = s.orders.get(req) if res.order is not None: # handle response + pass ``` ### Parameters @@ -73,9 +73,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListOrdersRequest( @@ -84,13 +82,13 @@ req = operations.ListOrdersRequest( order_by='-modifiedDate', page=1, page_size=100, - query='corrupti', ) res = s.orders.list(req) if res.orders is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/docs/sdks/payments/README.md b/previous-versions/commerce/docs/sdks/payments/README.md index 0317824ab..8ae7122b9 100755 --- a/previous-versions/commerce/docs/sdks/payments/README.md +++ b/previous-versions/commerce/docs/sdks/payments/README.md @@ -1,4 +1,5 @@ -# payments +# Payments +(*payments*) ## Overview @@ -29,21 +30,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetPaymentRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - payment_id='illum', + payment_id='Northeast Hatchback Kia', ) res = s.payments.get(req) if res.payment is not None: # handle response + pass ``` ### Parameters @@ -77,21 +77,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetPaymentMethodRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - payment_method_id='vel', + payment_method_id='Markets', ) res = s.payments.get_method(req) if res.payment_method is not None: # handle response + pass ``` ### Parameters @@ -123,9 +122,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListPaymentsRequest( @@ -134,13 +131,13 @@ req = operations.ListPaymentsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='error', ) res = s.payments.list(req) if res.payments is not None: # handle response + pass ``` ### Parameters @@ -172,9 +169,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListPaymentMethodsRequest( @@ -183,13 +178,13 @@ req = operations.ListPaymentMethodsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='deserunt', ) res = s.payments.list_methods(req) if res.payment_methods is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/docs/sdks/products/README.md b/previous-versions/commerce/docs/sdks/products/README.md index 6a15e5248..14edb80b6 100755 --- a/previous-versions/commerce/docs/sdks/products/README.md +++ b/previous-versions/commerce/docs/sdks/products/README.md @@ -1,4 +1,5 @@ -# products +# Products +(*products*) ## Overview @@ -29,21 +30,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetProductRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - product_id='suscipit', + product_id='Northeast Hatchback Kia', ) res = s.products.get(req) if res.product is not None: # handle response + pass ``` ### Parameters @@ -77,21 +77,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetProductCategoryRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - product_id='iure', + product_id='personalise contingency', ) res = s.products.get_category(req) if res.product_category is not None: # handle response + pass ``` ### Parameters @@ -123,9 +122,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListProductsRequest( @@ -134,13 +131,13 @@ req = operations.ListProductsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='magnam', ) res = s.products.list(req) if res.products is not None: # handle response + pass ``` ### Parameters @@ -172,9 +169,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListProductCategoriesRequest( @@ -183,13 +178,13 @@ req = operations.ListProductCategoriesRequest( order_by='-modifiedDate', page=1, page_size=100, - query='debitis', ) res = s.products.list_categories(req) if res.product_categories is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/docs/sdks/taxcomponents/README.md b/previous-versions/commerce/docs/sdks/taxcomponents/README.md index e4aaf8531..98507fc2d 100755 --- a/previous-versions/commerce/docs/sdks/taxcomponents/README.md +++ b/previous-versions/commerce/docs/sdks/taxcomponents/README.md @@ -1,4 +1,5 @@ -# tax_components +# TaxComponents +(*tax_components*) ## Overview @@ -27,21 +28,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetTaxComponentRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - tax_id='ipsa', + tax_id='Northeast Hatchback Kia', ) res = s.tax_components.get(req) if res.tax_component is not None: # handle response + pass ``` ### Parameters @@ -73,9 +73,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListTaxComponentsRequest( @@ -84,13 +82,13 @@ req = operations.ListTaxComponentsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='delectus', ) res = s.tax_components.list(req) if res.tax_components is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/docs/sdks/transactions/README.md b/previous-versions/commerce/docs/sdks/transactions/README.md index 3b87d6934..c8f54c2de 100755 --- a/previous-versions/commerce/docs/sdks/transactions/README.md +++ b/previous-versions/commerce/docs/sdks/transactions/README.md @@ -1,4 +1,5 @@ -# transactions +# Transactions +(*transactions*) ## Overview @@ -27,21 +28,20 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.GetTransactionRequest( company_id='8a210b68-6988-11ed-a1eb-0242ac120002', connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - transaction_id='tempora', + transaction_id='Northeast Hatchback Kia', ) res = s.transactions.get(req) if res.transaction is not None: # handle response + pass ``` ### Parameters @@ -73,9 +73,7 @@ import codatcommerce from codatcommerce.models import operations, shared s = codatcommerce.CodatCommerce( - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), + auth_header="Basic BASE_64_ENCODED(API_KEY)", ) req = operations.ListTransactionsRequest( @@ -84,13 +82,13 @@ req = operations.ListTransactionsRequest( order_by='-modifiedDate', page=1, page_size=100, - query='suscipit', ) res = s.transactions.list(req) if res.transactions is not None: # handle response + pass ``` ### Parameters diff --git a/previous-versions/commerce/files.gen b/previous-versions/commerce/files.gen index 2f649724f..d781dbb01 100755 --- a/previous-versions/commerce/files.gen +++ b/previous-versions/commerce/files.gen @@ -58,6 +58,7 @@ src/codatcommerce/models/shared/disputes.py src/codatcommerce/models/shared/location.py src/codatcommerce/models/shared/locations.py src/codatcommerce/models/shared/order.py +src/codatcommerce/models/shared/supplementaldata.py src/codatcommerce/models/shared/servicecharge.py src/codatcommerce/models/shared/servicechargetype.py src/codatcommerce/models/shared/taxcomponentallocation.py @@ -73,8 +74,8 @@ src/codatcommerce/models/shared/locationref.py src/codatcommerce/models/shared/commercecustomerref.py src/codatcommerce/models/shared/orders.py src/codatcommerce/models/shared/payment.py +src/codatcommerce/models/shared/paymentmethodref.py src/codatcommerce/models/shared/paymentmethod.py -src/codatcommerce/models/shared/paymentmethodstatus.py src/codatcommerce/models/shared/payments.py src/codatcommerce/models/shared/paymentmethods.py src/codatcommerce/models/shared/product.py @@ -95,17 +96,6 @@ src/codatcommerce/models/shared/transactions.py src/codatcommerce/models/shared/security.py src/codatcommerce/models/shared/__init__.py src/codatcommerce/models/errors/__init__.py -docs/sdks/codatcommerce/README.md -docs/models/utils/retryconfig.md -docs/sdks/companyinfo/README.md -docs/sdks/customers/README.md -docs/sdks/disputes/README.md -docs/sdks/locations/README.md -docs/sdks/orders/README.md -docs/sdks/payments/README.md -docs/sdks/products/README.md -docs/sdks/taxcomponents/README.md -docs/sdks/transactions/README.md USAGE.md docs/models/operations/getcompanyinforequest.md docs/models/operations/getcompanyinforesponse.md @@ -169,8 +159,8 @@ docs/models/shared/transactionsourcetype.md docs/models/shared/disputes.md docs/models/shared/location.md docs/models/shared/locations.md -docs/models/shared/ordersupplementaldata.md docs/models/shared/order.md +docs/models/shared/supplementaldata.md docs/models/shared/servicecharge.md docs/models/shared/servicechargetype.md docs/models/shared/taxcomponentallocation.md @@ -186,8 +176,9 @@ docs/models/shared/locationref.md docs/models/shared/commercecustomerref.md docs/models/shared/orders.md docs/models/shared/payment.md -docs/models/shared/paymentmethod.md +docs/models/shared/paymentmethodref.md docs/models/shared/paymentmethodstatus.md +docs/models/shared/paymentmethod.md docs/models/shared/payments.md docs/models/shared/paymentmethods.md docs/models/shared/product.md @@ -206,4 +197,15 @@ docs/models/shared/transaction.md docs/models/shared/transactiontype.md docs/models/shared/transactions.md docs/models/shared/security.md +docs/sdks/codatcommerce/README.md +docs/models/utils/retryconfig.md +docs/sdks/companyinfo/README.md +docs/sdks/customers/README.md +docs/sdks/disputes/README.md +docs/sdks/locations/README.md +docs/sdks/orders/README.md +docs/sdks/payments/README.md +docs/sdks/products/README.md +docs/sdks/taxcomponents/README.md +docs/sdks/transactions/README.md .gitattributes \ No newline at end of file diff --git a/previous-versions/commerce/gen.yaml b/previous-versions/commerce/gen.yaml index f02324d34..26897186d 100644 --- a/previous-versions/commerce/gen.yaml +++ b/previous-versions/commerce/gen.yaml @@ -1,16 +1,25 @@ configVersion: 1.0.0 management: - docChecksum: '00000000000000000000000000000000' - docVersion: 2.1.0 - speakeasyVersion: 1.53.0 - generationVersion: 2.58.0 + docChecksum: 640f5d08c51ea84e84a6d38fbe2231e6 + docVersion: 3.0.0 + speakeasyVersion: 1.100.2 + generationVersion: 2.159.2 generation: sdkClassName: CodatCommerce singleTagPerOp: false telemetryEnabled: true +features: + python: + core: 3.0.2 + examples: 2.81.2 + globalSecurity: 2.82.0 + globalServerURLs: 2.82.0 + nameOverrides: 2.81.1 + retries: 2.82.0 python: - version: 0.33.1 + version: 0.34.0 author: Codat description: Access standardized commerce data from our commerce integrations. + flattenGlobalSecurity: true maxMethodParams: 0 packageName: codat-commerce diff --git a/previous-versions/commerce/pylintrc b/previous-versions/commerce/pylintrc index ab6495dd6..1ed32214e 100755 --- a/previous-versions/commerce/pylintrc +++ b/previous-versions/commerce/pylintrc @@ -88,7 +88,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.9 +py-version=3.8 # Discover python modules and packages in the file system subtree. recursive=no @@ -116,12 +116,12 @@ argument-naming-style=snake_case #argument-rgx= # Naming style matching correct attribute names. -attr-naming-style=snake_case +#attr-naming-style=snake_case # Regular expression matching correct attribute names. Overrides attr-naming- # style. If left empty, attribute names will be checked with the set naming # style. -#attr-rgx= +attr-rgx=[^\W\d][^\W]*|__.*__$ # Bad variable names which should always be refused, separated by a comma. bad-names= diff --git a/previous-versions/commerce/setup.py b/previous-versions/commerce/setup.py index 15681e9e1..943c5c58d 100755 --- a/previous-versions/commerce/setup.py +++ b/previous-versions/commerce/setup.py @@ -10,33 +10,31 @@ setuptools.setup( name="codat-commerce", - version="0.1.0", + version="0.34.0", author="Codat", description="Access standardized commerce data from our commerce integrations.", long_description=long_description, long_description_content_type="text/markdown", packages=setuptools.find_packages(where="src"), install_requires=[ - "certifi>=2022.12.7", - "charset-normalizer>=2.1.1", - "dataclasses-json>=0.5.12", - "idna>=3.3", + "certifi>=2023.7.22", + "charset-normalizer>=3.2.0", + "dataclasses-json>=0.6.1", + "idna>=3.4", "jsonpath-python>=1.0.6 ", - "marshmallow>=3.17.1", - "marshmallow-enum>=1.5.1", - "mypy-extensions>=0.4.3", - "packaging>=21.3", - "pyparsing>=3.0.9", + "marshmallow>=3.19.0", + "mypy-extensions>=1.0.0", + "packaging>=23.1", "python-dateutil>=2.8.2", - "requests>=2.28.1", + "requests>=2.31.0", "six>=1.16.0", - "typing-inspect>=0.8.0", - "typing_extensions>=4.3.0", - "urllib3>=1.26.12", + "typing-inspect>=0.9.0", + "typing_extensions>=4.7.1", + "urllib3>=2.0.4", ], extras_require={ "dev":["pylint==2.16.2"] }, package_dir={'': 'src'}, - python_requires='>=3.9' + python_requires='>=3.8' ) diff --git a/previous-versions/commerce/src/codatcommerce/company_info.py b/previous-versions/commerce/src/codatcommerce/company_info.py index 148972c87..7ef759a4b 100755 --- a/previous-versions/commerce/src/codatcommerce/company_info.py +++ b/previous-versions/commerce/src/codatcommerce/company_info.py @@ -24,17 +24,21 @@ def get(self, request: operations.GetCompanyInfoRequest, retries: Optional[utils url = utils.generate_url(operations.GetCompanyInfoRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-info', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/customers.py b/previous-versions/commerce/src/codatcommerce/customers.py index eb6a7a4da..ce6f74ac4 100755 --- a/previous-versions/commerce/src/codatcommerce/customers.py +++ b/previous-versions/commerce/src/codatcommerce/customers.py @@ -28,17 +28,21 @@ def get(self, request: operations.GetCustomerRequest, retries: Optional[utils.Re url = utils.generate_url(operations.GetCustomerRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-customers/{customerId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -78,17 +82,21 @@ def list(self, request: operations.ListCustomersRequest, retries: Optional[utils headers = {} query_params = utils.get_query_params(operations.ListCustomersRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/disputes.py b/previous-versions/commerce/src/codatcommerce/disputes.py index 36a8e6322..ff987c16f 100755 --- a/previous-versions/commerce/src/codatcommerce/disputes.py +++ b/previous-versions/commerce/src/codatcommerce/disputes.py @@ -28,17 +28,21 @@ def get(self, request: operations.GetDisputeRequest, retries: Optional[utils.Ret url = utils.generate_url(operations.GetDisputeRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-disputes/{disputeId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -78,17 +82,21 @@ def list(self, request: operations.ListDisputesRequest, retries: Optional[utils. headers = {} query_params = utils.get_query_params(operations.ListDisputesRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/locations.py b/previous-versions/commerce/src/codatcommerce/locations.py index f08d6eff6..0d7d633d0 100755 --- a/previous-versions/commerce/src/codatcommerce/locations.py +++ b/previous-versions/commerce/src/codatcommerce/locations.py @@ -28,17 +28,21 @@ def get(self, request: operations.GetLocationRequest, retries: Optional[utils.Re url = utils.generate_url(operations.GetLocationRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-locations/{locationId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -77,17 +81,21 @@ def list(self, request: operations.ListLocationsRequest, retries: Optional[utils url = utils.generate_url(operations.ListLocationsRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-locations', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/models/__init__.py b/previous-versions/commerce/src/codatcommerce/models/__init__.py index 889f8adcf..36628d6cc 100755 --- a/previous-versions/commerce/src/codatcommerce/models/__init__.py +++ b/previous-versions/commerce/src/codatcommerce/models/__init__.py @@ -1,2 +1,3 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +# __init__.py diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_company_info.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_company_info.py index 088b87f60..d43a1fee9 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_company_info.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_company_info.py @@ -8,24 +8,27 @@ from typing import Optional - @dataclasses.dataclass class GetCompanyInfoRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" - @dataclasses.dataclass class GetCompanyInfoResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" company_info: Optional[shared_companyinfo.CompanyInfo] = dataclasses.field(default=None) r"""OK""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_customer.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_customer.py index f2b44c117..79927eef3 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_customer.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_customer.py @@ -8,26 +8,29 @@ from typing import Optional - @dataclasses.dataclass class GetCustomerRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" customer_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'customerId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a customer.""" - @dataclasses.dataclass class GetCustomerResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" customer: Optional[shared_customer.Customer] = dataclasses.field(default=None) r"""OK""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_dispute.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_dispute.py index 8b7278c90..4dd12c5d2 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_dispute.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_dispute.py @@ -8,26 +8,29 @@ from typing import Optional - @dataclasses.dataclass class GetDisputeRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" dispute_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'disputeId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a dispute.""" - @dataclasses.dataclass class GetDisputeResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" dispute: Optional[shared_dispute.Dispute] = dataclasses.field(default=None) r"""OK""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_location.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_location.py index 79e05e53a..717630f64 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_location.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_location.py @@ -8,26 +8,29 @@ from typing import Optional - @dataclasses.dataclass class GetLocationRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" location_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'locationId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a location.""" - @dataclasses.dataclass class GetLocationResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" location: Optional[shared_location.Location] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_order.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_order.py index 0088a69d2..acb9afdf8 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_order.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_order.py @@ -8,26 +8,29 @@ from typing import Optional - @dataclasses.dataclass class GetOrderRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'orderId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for an order.""" - @dataclasses.dataclass class GetOrderResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" order: Optional[shared_order.Order] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_payment.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_payment.py index 1c59eac25..ef00bb97a 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_payment.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_payment.py @@ -8,26 +8,29 @@ from typing import Optional - @dataclasses.dataclass class GetPaymentRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" payment_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'paymentId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a payment.""" - @dataclasses.dataclass class GetPaymentResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" payment: Optional[shared_payment.Payment] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_payment_method.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_payment_method.py index 1a145c3f6..60572aef6 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_payment_method.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_payment_method.py @@ -8,26 +8,29 @@ from typing import Optional - @dataclasses.dataclass class GetPaymentMethodRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" payment_method_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'paymentMethodId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a payment method.""" - @dataclasses.dataclass class GetPaymentMethodResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" payment_method: Optional[shared_paymentmethod.PaymentMethod] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_product.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_product.py index c20a35435..3eec85bf5 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_product.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_product.py @@ -8,26 +8,29 @@ from typing import Optional - @dataclasses.dataclass class GetProductRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" product_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'productId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a product.""" - @dataclasses.dataclass class GetProductResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" product: Optional[shared_product.Product] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_product_category.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_product_category.py index 6d0cf8f85..0d048e2e1 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_product_category.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_product_category.py @@ -8,26 +8,29 @@ from typing import Optional - @dataclasses.dataclass class GetProductCategoryRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" product_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'productId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a product.""" - @dataclasses.dataclass class GetProductCategoryResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" product_category: Optional[shared_productcategory.ProductCategory] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_tax_component.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_tax_component.py index cae478c9b..e99e6cb85 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_tax_component.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_tax_component.py @@ -8,25 +8,28 @@ from typing import Optional - @dataclasses.dataclass class GetTaxComponentRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" tax_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'taxId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a tax component.""" - @dataclasses.dataclass class GetTaxComponentResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" tax_component: Optional[shared_taxcomponent.TaxComponent] = dataclasses.field(default=None) r"""OK""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/get_transaction.py b/previous-versions/commerce/src/codatcommerce/models/operations/get_transaction.py index 99d12bc3e..2c1835cc5 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/get_transaction.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/get_transaction.py @@ -8,25 +8,28 @@ from typing import Optional - @dataclasses.dataclass class GetTransactionRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" transaction_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'transactionId', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a transaction.""" - @dataclasses.dataclass class GetTransactionResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your API request was not properly authorized.""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" transaction: Optional[shared_transaction.Transaction] = dataclasses.field(default=None) r"""OK""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_customers.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_customers.py index 8e80c1a88..6630825f1 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_customers.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_customers.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListCustomersRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,15 +26,17 @@ class ListCustomersRequest: - @dataclasses.dataclass class ListCustomersResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" customers: Optional[shared_customers.Customers] = dataclasses.field(default=None) r"""OK""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_disputes.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_disputes.py index 7cadbfc93..a93c68108 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_disputes.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_disputes.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListDisputesRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,15 +26,17 @@ class ListDisputesRequest: - @dataclasses.dataclass class ListDisputesResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" disputes: Optional[shared_disputes.Disputes] = dataclasses.field(default=None) r"""OK""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_locations.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_locations.py index e8c8fb716..112a10b43 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_locations.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_locations.py @@ -8,24 +8,27 @@ from typing import Optional - @dataclasses.dataclass class ListLocationsRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" - @dataclasses.dataclass class ListLocationsResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" locations: Optional[shared_locations.Locations] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_orders.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_orders.py index b9cc15676..6472b2a88 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_orders.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_orders.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListOrdersRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,15 +26,17 @@ class ListOrdersRequest: - @dataclasses.dataclass class ListOrdersResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" orders: Optional[shared_orders.Orders] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_payment_methods.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_payment_methods.py index 128c802cb..b40996d24 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_payment_methods.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_payment_methods.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListPaymentMethodsRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,15 +26,17 @@ class ListPaymentMethodsRequest: - @dataclasses.dataclass class ListPaymentMethodsResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" payment_methods: Optional[shared_paymentmethods.PaymentMethods] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_payments.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_payments.py index 1c7e431db..f24b74e24 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_payments.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_payments.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListPaymentsRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,15 +26,17 @@ class ListPaymentsRequest: - @dataclasses.dataclass class ListPaymentsResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" payments: Optional[shared_payments.Payments] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_product_categories.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_product_categories.py index 89a7ed267..5544bf749 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_product_categories.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_product_categories.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListProductCategoriesRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,15 +26,17 @@ class ListProductCategoriesRequest: - @dataclasses.dataclass class ListProductCategoriesResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" product_categories: Optional[shared_productcategories.ProductCategories] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_products.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_products.py index 7b7779b20..de70fceec 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_products.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_products.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListProductsRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,15 +26,17 @@ class ListProductsRequest: - @dataclasses.dataclass class ListProductsResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" products: Optional[shared_products.Products] = dataclasses.field(default=None) r"""OK""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_tax_components.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_tax_components.py index 098121f8f..4b6e0cba0 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_tax_components.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_tax_components.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListTaxComponentsRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,14 +26,16 @@ class ListTaxComponentsRequest: - @dataclasses.dataclass class ListTaxComponentsResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" tax_components: Optional[shared_taxcomponents.TaxComponents] = dataclasses.field(default=None) r"""OK""" diff --git a/previous-versions/commerce/src/codatcommerce/models/operations/list_transactions.py b/previous-versions/commerce/src/codatcommerce/models/operations/list_transactions.py index 6b5693274..5d70ba007 100755 --- a/previous-versions/commerce/src/codatcommerce/models/operations/list_transactions.py +++ b/previous-versions/commerce/src/codatcommerce/models/operations/list_transactions.py @@ -8,16 +8,17 @@ from typing import Optional - @dataclasses.dataclass class ListTransactionsRequest: company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a company.""" connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a connection.""" order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) + page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) + page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" @@ -25,14 +26,16 @@ class ListTransactionsRequest: - @dataclasses.dataclass class ListTransactionsResponse: content_type: str = dataclasses.field() + r"""HTTP response content type for this operation""" status_code: int = dataclasses.field() + r"""HTTP response status code for this operation""" error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) r"""Your `query` parameter was not correctly formed""" raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + r"""Raw HTTP response; suitable for custom response parsing""" transactions: Optional[shared_transactions.Transactions] = dataclasses.field(default=None) r"""OK""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/__init__.py b/previous-versions/commerce/src/codatcommerce/models/shared/__init__.py index 57afd5b5d..10898bd94 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/__init__.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/__init__.py @@ -22,8 +22,8 @@ from .orders import * from .payment import * from .paymentmethod import * +from .paymentmethodref import * from .paymentmethods import * -from .paymentmethodstatus import * from .paymentref import * from .payments import * from .paymentstatus import * @@ -45,6 +45,7 @@ from .security import * from .servicecharge import * from .servicechargetype import * +from .supplementaldata import * from .taxcomponent import * from .taxcomponentallocation import * from .taxcomponentref import * @@ -55,4 +56,4 @@ from .transactionsourcetype import * from .transactiontype import * -__all__ = ["AccountBalance","Address","CommerceAddressType","CommerceCustomerRef","CompanyInfo","CompanyInfoWeblink","CompanyInfoWeblinkType","Customer","Customers","Dispute","DisputeStatus","Disputes","ErrorMessage","HalRef","Links","Location","LocationRef","Locations","Order","OrderDiscountAllocation","OrderLineItem","OrderSupplementalData","Orders","Payment","PaymentMethod","PaymentMethodStatus","PaymentMethods","PaymentRef","PaymentStatus","PaymentType","Payments","PhoneNumber","PhoneNumberType","Product","ProductCategories","ProductCategory","ProductInventory","ProductInventoryLocation","ProductPrice","ProductRef","ProductVariant","ProductVariantRef","ProductVariantStatus","Products","RecordRef","Security","ServiceCharge","ServiceChargeType","TaxComponent","TaxComponentAllocation","TaxComponentRef","TaxComponents","Transaction","TransactionSourceRef","TransactionSourceType","TransactionType","Transactions"] +__all__ = ["AccountBalance","Address","CommerceAddressType","CommerceCustomerRef","CompanyInfo","CompanyInfoWeblink","CompanyInfoWeblinkType","Customer","Customers","Dispute","DisputeStatus","Disputes","ErrorMessage","HalRef","Links","Location","LocationRef","Locations","Order","OrderDiscountAllocation","OrderLineItem","Orders","Payment","PaymentMethod","PaymentMethodRef","PaymentMethodStatus","PaymentMethods","PaymentRef","PaymentStatus","PaymentType","Payments","PhoneNumber","PhoneNumberType","Product","ProductCategories","ProductCategory","ProductInventory","ProductInventoryLocation","ProductPrice","ProductRef","ProductVariant","ProductVariantRef","ProductVariantStatus","Products","RecordRef","Security","ServiceCharge","ServiceChargeType","SupplementalData","TaxComponent","TaxComponentAllocation","TaxComponentRef","TaxComponents","Transaction","TransactionSourceRef","TransactionSourceType","TransactionType","Transactions"] diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/accountbalance.py b/previous-versions/commerce/src/codatcommerce/models/shared/accountbalance.py index 57af10b54..cdd9109ba 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/accountbalance.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/accountbalance.py @@ -4,20 +4,20 @@ import dataclasses from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from decimal import Decimal +from typing import Any, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class AccountBalance: - available: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('available'), 'exclude': lambda f: f is None }}) + available: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('available'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""The account's current balance""" currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) r"""The currency of the account""" - pending: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pending'), 'exclude': lambda f: f is None }}) + pending: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pending'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""Funds that are not yet available in the balance""" - reserved: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reserved'), 'exclude': lambda f: f is None }}) + reserved: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reserved'), 'exclude': lambda f: f is None }}) r"""Funds reserved as holdings""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/address.py b/previous-versions/commerce/src/codatcommerce/models/shared/address.py index 60aa91947..df8fbf01f 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/address.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/address.py @@ -9,7 +9,6 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Address: city: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('city'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/commercecustomerref.py b/previous-versions/commerce/src/codatcommerce/models/shared/commercecustomerref.py index eddcf6e5b..611927a41 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/commercecustomerref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/commercecustomerref.py @@ -8,7 +8,6 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class CommerceCustomerRef: r"""Reference to the customer that placed the order.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/companyinfo.py b/previous-versions/commerce/src/codatcommerce/models/shared/companyinfo.py index f3a3e787f..1407fd5bc 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/companyinfo.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/companyinfo.py @@ -8,7 +8,7 @@ from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json from enum import Enum -from typing import Optional +from typing import Dict, List, Optional class CompanyInfoWeblinkType(str, Enum): r"""The type of the weblink.""" @@ -18,7 +18,6 @@ class CompanyInfoWeblinkType(str, Enum): @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class CompanyInfoWeblink: r"""Weblink associated with the company.""" @@ -31,7 +30,6 @@ class CompanyInfoWeblink: @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class CompanyInfo: r"""In the Codat system, company information includes standard commercial details about @@ -39,9 +37,9 @@ class CompanyInfo: Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=companyInfo) for this data type. """ - account_balances: Optional[list[shared_accountbalance.AccountBalance]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountBalances'), 'exclude': lambda f: f is None }}) + account_balances: Optional[List[shared_accountbalance.AccountBalance]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountBalances'), 'exclude': lambda f: f is None }}) r"""The available and current cash balances for the company's accounts""" - addresses: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is None }}) + addresses: Optional[List[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is None }}) r"""Addresses associated with the company""" base_currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('baseCurrency'), 'exclude': lambda f: f is None }}) r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. @@ -80,14 +78,14 @@ class CompanyInfo: > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. """ modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - phone_numbers: Optional[list[shared_phonenumber.PhoneNumber]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phoneNumbers'), 'exclude': lambda f: f is None }}) + phone_numbers: Optional[List[shared_phonenumber.PhoneNumber]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phoneNumbers'), 'exclude': lambda f: f is None }}) r"""Phone numbers associated with the company""" registration_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is None }}) r"""The registration number of the company""" source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - source_urls: Optional[dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceUrls'), 'exclude': lambda f: f is None }}) + source_urls: Optional[Dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceUrls'), 'exclude': lambda f: f is None }}) r"""URL addresses for the originating system. For example, potential use cases include 'deeplinking' to the originating system""" - web_links: Optional[list[CompanyInfoWeblink]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('webLinks'), 'exclude': lambda f: f is None }}) + web_links: Optional[List[CompanyInfoWeblink]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('webLinks'), 'exclude': lambda f: f is None }}) r"""Weblinks associated with the company""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/customer.py b/previous-versions/commerce/src/codatcommerce/models/shared/customer.py index cfd3eed08..739505a71 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/customer.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/customer.py @@ -5,11 +5,10 @@ from ..shared import address as shared_address from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Customer: r"""When a customer places an order with the connected commerce store their details are added to the Customers dataset. You can use the data from the Customers endpoints to calculate key metrics, such as customer churn. @@ -18,7 +17,7 @@ class Customer: """ id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) r"""A unique, persistent identifier for this record""" - addresses: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is None }}) + addresses: Optional[List[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is None }}) r"""Addresses of the customer""" created_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdDate'), 'exclude': lambda f: f is None }}) r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -49,7 +48,7 @@ class Customer: modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) note: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('note'), 'exclude': lambda f: f is None }}) r"""Any additional information about the customer""" - phone: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is None }}) + phone: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone') }}) r"""A phone number.""" source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/customers.py b/previous-versions/commerce/src/codatcommerce/models/shared/customers.py index c4b7697ac..3c21056ff 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/customers.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/customers.py @@ -6,18 +6,19 @@ from ..shared import links as shared_links from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Customers: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_customer.Customer]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_customer.Customer]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/dispute.py b/previous-versions/commerce/src/codatcommerce/models/shared/dispute.py index b8d29aab9..88bbf3e89 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/dispute.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/dispute.py @@ -6,11 +6,10 @@ from ..shared import transactionsourceref as shared_transactionsourceref from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import Any, List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Dispute: r"""A customer may file a payment dispute with their bank or other card issuer when they're unsatisfied with their purchase or believe they have been charged incorrectly. For example: @@ -54,7 +53,7 @@ class Dispute: > Not all dates from Codat will contain information about time zones. > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. """ - disputed_transactions: Optional[list[shared_transactionsourceref.TransactionSourceRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('disputedTransactions'), 'exclude': lambda f: f is None }}) + disputed_transactions: Optional[List[shared_transactionsourceref.TransactionSourceRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('disputedTransactions'), 'exclude': lambda f: f is None }}) r"""Link to the source event(s) which triggered this transaction.""" due_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dueDate'), 'exclude': lambda f: f is None }}) r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -83,7 +82,7 @@ class Dispute: source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) status: Optional[shared_disputestatus.DisputeStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) r"""Current status of the dispute""" - total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) + total_amount: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) r"""Total transaction amount that is under dispute.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/disputes.py b/previous-versions/commerce/src/codatcommerce/models/shared/disputes.py index ba8934741..d7d011bc5 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/disputes.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/disputes.py @@ -6,18 +6,19 @@ from ..shared import links as shared_links from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Disputes: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_dispute.Dispute]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_dispute.Dispute]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/errormessage.py b/previous-versions/commerce/src/codatcommerce/models/shared/errormessage.py index 7a3c41275..66b090b1b 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/errormessage.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/errormessage.py @@ -8,15 +8,19 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ErrorMessage: - r"""Your `query` parameter was not correctly formed""" can_be_retried: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('canBeRetried'), 'exclude': lambda f: f is None }}) + r"""`True` if the error occurred transiently and can be retried.""" correlation_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('correlationId'), 'exclude': lambda f: f is None }}) + r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" detailed_error_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detailedErrorCode'), 'exclude': lambda f: f is None }}) + r"""Machine readable error code used to automate processes based on the code returned.""" error: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('error'), 'exclude': lambda f: f is None }}) + r"""A brief description of the error.""" service: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('service'), 'exclude': lambda f: f is None }}) + r"""Codat's service the returned the error.""" status_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) + r"""The HTTP status code returned by the error.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/halref.py b/previous-versions/commerce/src/codatcommerce/models/shared/halref.py index 7bef5b55b..4b0cc1c4c 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/halref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/halref.py @@ -8,9 +8,9 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class HalRef: href: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('href'), 'exclude': lambda f: f is None }}) + r"""Uri hypertext reference.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/links.py b/previous-versions/commerce/src/codatcommerce/models/shared/links.py index 89a592bcf..71f509f8d 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/links.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/links.py @@ -9,7 +9,6 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Links: current: shared_halref.HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('current') }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/location.py b/previous-versions/commerce/src/codatcommerce/models/shared/location.py index e166f63f6..c21e86379 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/location.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/location.py @@ -9,7 +9,6 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Location: r"""The Location datatype holds information on the geographic location at which stocks of products may be held, as referenced in the Products data type. diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/locationref.py b/previous-versions/commerce/src/codatcommerce/models/shared/locationref.py index 40cdac418..6913e1af1 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/locationref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/locationref.py @@ -8,7 +8,6 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class LocationRef: r"""Reference to the geographic location where the order was placed.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/locations.py b/previous-versions/commerce/src/codatcommerce/models/shared/locations.py index 2844b430b..bf1e03a58 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/locations.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/locations.py @@ -6,18 +6,19 @@ from ..shared import location as shared_location from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Locations: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_location.Location]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_location.Location]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/order.py b/previous-versions/commerce/src/codatcommerce/models/shared/order.py index 67745c351..93525dcdb 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/order.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/order.py @@ -7,26 +7,14 @@ from ..shared import orderlineitem as shared_orderlineitem from ..shared import paymentref as shared_paymentref from ..shared import servicecharge as shared_servicecharge +from ..shared import supplementaldata as shared_supplementaldata from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Any, Optional +from decimal import Decimal +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - -@dataclasses.dataclass -class OrderSupplementalData: - r"""Supplemental data is additional data you can include in our standard data types. - - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. - """ - content: Optional[dict[str, dict[str, Any]]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('content'), 'exclude': lambda f: f is None }}) - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Order: r"""Orders contain the transaction details for all products sold by the company, and include details of any payments, service charges, or refunds related to each order. You can use data from the Orders endpoints to calculate key metrics, such as gross sales values and monthly recurring revenue (MRR). @@ -90,26 +78,26 @@ class Order: location_ref: Optional[shared_locationref.LocationRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('locationRef'), 'exclude': lambda f: f is None }}) r"""Reference to the geographic location where the order was placed.""" modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - order_line_items: Optional[list[shared_orderlineitem.OrderLineItem]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('orderLineItems'), 'exclude': lambda f: f is None }}) + order_line_items: Optional[List[shared_orderlineitem.OrderLineItem]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('orderLineItems'), 'exclude': lambda f: f is None }}) order_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('orderNumber'), 'exclude': lambda f: f is None }}) r"""Friendly reference for the order in the commerce or point of sale platform.""" - payments: Optional[list[shared_paymentref.PaymentRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payments'), 'exclude': lambda f: f is None }}) - service_charges: Optional[list[shared_servicecharge.ServiceCharge]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('serviceCharges'), 'exclude': lambda f: f is None }}) + payments: Optional[List[shared_paymentref.PaymentRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payments'), 'exclude': lambda f: f is None }}) + service_charges: Optional[List[shared_servicecharge.ServiceCharge]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('serviceCharges'), 'exclude': lambda f: f is None }}) source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - supplemental_data: Optional[OrderSupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) + supplemental_data: Optional[shared_supplementaldata.SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) r"""Supplemental data is additional data you can include in our standard data types. - It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. """ - total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) - r"""Total amount of the order, including tax, net of any discounts and refunds.""" - total_discount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalDiscount'), 'exclude': lambda f: f is None }}) - r"""Total amount of discount applied to the order.""" - total_gratuity: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalGratuity'), 'exclude': lambda f: f is None }}) - r"""Extra amount added to a bill.""" - total_refund: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalRefund'), 'exclude': lambda f: f is None }}) - r"""Total amount refunded issued by a merchant on an order (always a negative value).""" - total_tax_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalTaxAmount'), 'exclude': lambda f: f is None }}) + total_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Total amount of the order, including discounts, refunds, and tax, but excluding gratuities.""" + total_discount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalDiscount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Total amount of any discounts applied to the order, excluding tax. This is typically positive (for discounts which decrease the amount of the order), but can also be negative (for discounts which increase the amount of the order).""" + total_gratuity: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalGratuity'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Extra amount added to the order.""" + total_refund: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalRefund'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Total amount of any refunds issued on the order, including discounts and tax, but excluding gratuities. This is always negative.""" + total_tax_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalTaxAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""Total amount of tax applied to the order.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/orderdiscountallocation.py b/previous-versions/commerce/src/codatcommerce/models/shared/orderdiscountallocation.py index 1c77ce74d..d8711963d 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/orderdiscountallocation.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/orderdiscountallocation.py @@ -4,16 +4,16 @@ import dataclasses from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class OrderDiscountAllocation: name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) r"""Name of the discount in the commerce or point of sale platform.""" - total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) - r"""Total amount of discount applied.""" + total_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Total amount of discount applied, excluding tax. This is typically positive (for discounts which decrease the amount of the order line), but can also be negative (for discounts which increase the amount of the order line).""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/orderlineitem.py b/previous-versions/commerce/src/codatcommerce/models/shared/orderlineitem.py index d18b28e58..a11d7b484 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/orderlineitem.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/orderlineitem.py @@ -8,33 +8,33 @@ from ..shared import taxcomponentallocation as shared_taxcomponentallocation from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from decimal import Decimal +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class OrderLineItem: id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) r"""A unique, persistent identifier for this record""" - discount_allocations: Optional[list[shared_orderdiscountallocation.OrderDiscountAllocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discountAllocations'), 'exclude': lambda f: f is None }}) + discount_allocations: Optional[List[shared_orderdiscountallocation.OrderDiscountAllocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discountAllocations'), 'exclude': lambda f: f is None }}) product_ref: Optional[shared_productref.ProductRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('productRef'), 'exclude': lambda f: f is None }}) r"""Reference that links the line item to the correct product details.""" product_variant_ref: Optional[shared_productvariantref.ProductVariantRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('productVariantRef'), 'exclude': lambda f: f is None }}) r"""Reference that links the line item to the specific version of product that has been ordered.""" - quantity: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity'), 'exclude': lambda f: f is None }}) + quantity: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""Number of units of the product sold. - For refunds, quantity is a negative value. + For refunds, quantity is negative. """ - taxes: Optional[list[shared_taxcomponentallocation.TaxComponentAllocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxes'), 'exclude': lambda f: f is None }}) + taxes: Optional[List[shared_taxcomponentallocation.TaxComponentAllocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxes'), 'exclude': lambda f: f is None }}) r"""Taxes breakdown as applied to order lines.""" - tax_percentage: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxPercentage'), 'exclude': lambda f: f is None }}) - r"""Percentage rate (from 0 to 100) of any sale tax applied to the unit amount.""" - total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) - r"""Total price of the line item, including discounts, tax and minus any refunds.""" - total_tax_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalTaxAmount'), 'exclude': lambda f: f is None }}) - r"""Total amount of tax applied to the line item.""" - unit_price: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unitPrice'), 'exclude': lambda f: f is None }}) - r"""Price per unit of goods or service.""" + tax_percentage: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxPercentage'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Percentage rate (from 0 to 100) of any sales tax applied to the unit price.""" + total_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Total amount of the line item, including discounts and tax.""" + total_tax_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalTaxAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Total amount of tax applied to the line item, factoring in any discounts.""" + unit_price: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unitPrice'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Price per unit of goods or services, excluding discounts and tax.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/orders.py b/previous-versions/commerce/src/codatcommerce/models/shared/orders.py index fe716b9b8..935c12adc 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/orders.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/orders.py @@ -6,18 +6,19 @@ from ..shared import order as shared_order from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Orders: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_order.Order]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_order.Order]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/payment.py b/previous-versions/commerce/src/codatcommerce/models/shared/payment.py index d075eb70f..f39cbce1c 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/payment.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/payment.py @@ -2,14 +2,16 @@ from __future__ import annotations import dataclasses +from ..shared import paymentmethodref as shared_paymentmethodref from ..shared import paymentstatus as shared_paymentstatus +from ..shared import supplementaldata as shared_supplementaldata from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Any, Optional +from decimal import Decimal +from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Payment: r"""Payments contain details of all payments made by customers to a company, including: amounts, currency used, payment method, payment provider, and payment status. @@ -22,7 +24,7 @@ class Payment: """ id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) r"""A unique, persistent identifier for this record""" - amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount'), 'exclude': lambda f: f is None }}) + amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""Payment Amount (including gratuity)""" created_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdDate'), 'exclude': lambda f: f is None }}) r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -76,11 +78,17 @@ class Payment: > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. """ modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - payment_method_ref: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('paymentMethodRef'), 'exclude': lambda f: f is None }}) + payment_method_ref: Optional[shared_paymentmethodref.PaymentMethodRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('paymentMethodRef'), 'exclude': lambda f: f is None }}) + r"""The payment method the record is linked to in the accounting or commerce platform.""" payment_provider: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('paymentProvider'), 'exclude': lambda f: f is None }}) r"""Service provider of the payment, if applicable.""" source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) status: Optional[shared_paymentstatus.PaymentStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) r"""Status of the payment.""" + supplemental_data: Optional[shared_supplementaldata.SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethod.py b/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethod.py index a55526bf4..c6fe8bcc3 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethod.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethod.py @@ -2,14 +2,19 @@ from __future__ import annotations import dataclasses -from ..shared import paymentmethodstatus as shared_paymentmethodstatus from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from enum import Enum from typing import Optional +class PaymentMethodStatus(str, Enum): + r"""Status of the Payment Method.""" + UNKNOWN = 'Unknown' + ACTIVE = 'Active' + ARCHIVED = 'Archived' -@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass class PaymentMethod: r"""A Payment Method represents the payment method(s) used to make payments. @@ -22,7 +27,7 @@ class PaymentMethod: name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) r"""The name of the PaymentMethod""" source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - status: Optional[shared_paymentmethodstatus.PaymentMethodStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) - r"""Status of the Payment Method""" + status: Optional[PaymentMethodStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) + r"""Status of the Payment Method.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethodref.py b/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethodref.py new file mode 100755 index 000000000..1d5e079e3 --- /dev/null +++ b/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethodref.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from codatcommerce import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class PaymentMethodRef: + r"""The payment method the record is linked to in the accounting or commerce platform.""" + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + r"""The unique identifier of the location being referenced.""" + name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) + r"""Name of the location being referenced.""" + + diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethods.py b/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethods.py index c3060d893..2d86f4df3 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethods.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethods.py @@ -6,18 +6,19 @@ from ..shared import paymentmethod as shared_paymentmethod from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class PaymentMethods: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_paymentmethod.PaymentMethod]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_paymentmethod.PaymentMethod]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethodstatus.py b/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethodstatus.py deleted file mode 100755 index 9a8cecaa7..000000000 --- a/previous-versions/commerce/src/codatcommerce/models/shared/paymentmethodstatus.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class PaymentMethodStatus(str, Enum): - r"""Status of the Payment Method""" - ACTIVE = 'Active' - ARCHIVED = 'Archived' - UNKNOWN = 'Unknown' diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/paymentref.py b/previous-versions/commerce/src/codatcommerce/models/shared/paymentref.py index b58f9f00f..108dab9d2 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/paymentref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/paymentref.py @@ -6,16 +6,16 @@ from ..shared import paymenttype as shared_paymenttype from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class PaymentRef: id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) r"""A unique, persistent identifier for this record""" - amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount'), 'exclude': lambda f: f is None }}) + amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) r"""Payment Amount (including gratuity).""" created_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdDate'), 'exclude': lambda f: f is None }}) r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: @@ -74,7 +74,7 @@ class PaymentRef: source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) status: Optional[shared_paymentstatus.PaymentStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) r"""Status of the payment.""" - type: Optional[shared_paymenttype.PaymentType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + type: Optional[shared_paymenttype.PaymentType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) r"""Type of payment.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/payments.py b/previous-versions/commerce/src/codatcommerce/models/shared/payments.py index 126cb7272..5856184dd 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/payments.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/payments.py @@ -6,18 +6,19 @@ from ..shared import payment as shared_payment from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Payments: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_payment.Payment]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_payment.Payment]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/phonenumber.py b/previous-versions/commerce/src/codatcommerce/models/shared/phonenumber.py index 8b5578071..6fb3f2ce5 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/phonenumber.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/phonenumber.py @@ -5,13 +5,13 @@ from ..shared import phonenumbertype as shared_phonenumbertype from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class PhoneNumber: - number: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('number') }}) + number: Optional[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('number') }}) r"""A phone number.""" type: shared_phonenumbertype.PhoneNumberType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) r"""The type of phone number""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/product.py b/previous-versions/commerce/src/codatcommerce/models/shared/product.py index 1f4b3211f..85d31282a 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/product.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/product.py @@ -3,13 +3,13 @@ from __future__ import annotations import dataclasses from ..shared import productvariant as shared_productvariant +from ..shared import supplementaldata as shared_supplementaldata from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Product: r"""A Product is an item in the company's inventory, and includes information about the price and quantity of all products, and variants thereof, available for sale. @@ -19,15 +19,20 @@ class Product: id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) r"""A unique, persistent identifier for this record""" categorization: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('categorization'), 'exclude': lambda f: f is None }}) - r"""Retail category that the product is assigned to""" + r"""Retail category that the product is assigned to e.g. `Hardware`.""" description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) r"""Description of the product recorded in the commerce or point of sale platform.""" is_gift_card: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isGiftCard'), 'exclude': lambda f: f is None }}) r"""Whether the product represents a gift card or voucher that - can be redeemed in the commerce or POS platform + can be redeemed in the commerce or POS platform. """ name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) r"""Name of the product in the commerce or POS system""" - variants: Optional[list[shared_productvariant.ProductVariant]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('variants'), 'exclude': lambda f: f is None }}) + supplemental_data: Optional[shared_supplementaldata.SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + variants: Optional[List[shared_productvariant.ProductVariant]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('variants'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productcategories.py b/previous-versions/commerce/src/codatcommerce/models/shared/productcategories.py index f6aaf4b9a..edb3a5b2e 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productcategories.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productcategories.py @@ -6,18 +6,19 @@ from ..shared import productcategory as shared_productcategory from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ProductCategories: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_productcategory.ProductCategory]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_productcategory.ProductCategory]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productcategory.py b/previous-versions/commerce/src/codatcommerce/models/shared/productcategory.py index 3e6c70b7b..51f67fec5 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productcategory.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productcategory.py @@ -5,18 +5,17 @@ from ..shared import recordref as shared_recordref from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ProductCategory: r"""Product categories are used to classify a group of products together, either by type (e.g. \\"Furniture\\"), or sometimes by tax profile. Explore our [data coverage](https://knowledge.codat.io/supported-features/commerce?view=tab-by-data-type&dataType=commerce-productCategories) for this data type. """ - ancestor_refs: Optional[list[shared_recordref.RecordRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ancestorRefs'), 'exclude': lambda f: f is None }}) + ancestor_refs: Optional[List[shared_recordref.RecordRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ancestorRefs'), 'exclude': lambda f: f is None }}) r"""A collection of parent product categories implicitly ordered with the immediate parent last in the list.""" has_children: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('hasChildren'), 'exclude': lambda f: f is None }}) r"""A boolean indicating whether there are other product categories beneath this one in the hierarchy.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productinventory.py b/previous-versions/commerce/src/codatcommerce/models/shared/productinventory.py index 62d74a22f..6041b6f51 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productinventory.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productinventory.py @@ -5,15 +5,16 @@ from ..shared import productinventorylocation as shared_productinventorylocation from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from decimal import Decimal +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ProductInventory: r"""Information about the total inventory as well as the locations inventory is in.""" - locations: Optional[list[shared_productinventorylocation.ProductInventoryLocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('locations'), 'exclude': lambda f: f is None }}) - total_quantity: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalQuantity'), 'exclude': lambda f: f is None }}) + locations: Optional[List[shared_productinventorylocation.ProductInventoryLocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('locations'), 'exclude': lambda f: f is None }}) + total_quantity: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalQuantity'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) + r"""The total quantity of stock remaining across locations.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productinventorylocation.py b/previous-versions/commerce/src/codatcommerce/models/shared/productinventorylocation.py index db7a91046..39f0a3b10 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productinventorylocation.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productinventorylocation.py @@ -5,15 +5,16 @@ from ..shared import locationref as shared_locationref from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ProductInventoryLocation: location_ref: Optional[shared_locationref.LocationRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('locationRef'), 'exclude': lambda f: f is None }}) r"""Reference to the geographic location where the order was placed.""" - quantity: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity'), 'exclude': lambda f: f is None }}) + quantity: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""The quantity of stock remaining at location.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productprice.py b/previous-versions/commerce/src/codatcommerce/models/shared/productprice.py index cce74be2e..a761764f7 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productprice.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productprice.py @@ -4,11 +4,11 @@ import dataclasses from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ProductPrice: currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) @@ -20,6 +20,7 @@ class ProductPrice: There are only a very small number of edge cases where this currency code is returned by the Codat system. """ - unit_price: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unitPrice'), 'exclude': lambda f: f is None }}) + unit_price: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unitPrice'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""The product variant's unit price.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productref.py b/previous-versions/commerce/src/codatcommerce/models/shared/productref.py index 037f228d5..aa4e0103a 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productref.py @@ -8,12 +8,11 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ProductRef: r"""Reference that links the line item to the correct product details.""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""The unique identitifer of the product being referenced.""" + r"""The unique identifier of the product being referenced.""" name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) r"""Name of the product being referenced.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/products.py b/previous-versions/commerce/src/codatcommerce/models/shared/products.py index 08fecd47d..d0e0c1f39 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/products.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/products.py @@ -6,18 +6,19 @@ from ..shared import product as shared_product from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Products: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_product.Product]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_product.Product]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productvariant.py b/previous-versions/commerce/src/codatcommerce/models/shared/productvariant.py index 958e08021..2330c57ca 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productvariant.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productvariant.py @@ -7,11 +7,11 @@ from ..shared import productvariantstatus as shared_productvariantstatus from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from decimal import Decimal +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ProductVariant: r"""Represents a variation of a product available for sale, for example an item of clothing that may be available for sale in multiple sizes and colors.""" @@ -47,7 +47,7 @@ class ProductVariant: modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) r"""Name of the product recorded in the commerce or point of sale platform.""" - prices: Optional[list[shared_productprice.ProductPrice]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('prices'), 'exclude': lambda f: f is None }}) + prices: Optional[List[shared_productprice.ProductPrice]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('prices'), 'exclude': lambda f: f is None }}) r"""Prices for the product variants in different currencies.""" shipping_required: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('shippingRequired'), 'exclude': lambda f: f is None }}) r"""Indicates whether or not the product requires physical delivery.""" @@ -55,9 +55,10 @@ class ProductVariant: r"""SKU (stock keeping unit) of the variant, as defined by the merchant.""" source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) status: Optional[shared_productvariantstatus.ProductVariantStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) + r"""The status of the product variant.""" unit_of_measure: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unitOfMeasure'), 'exclude': lambda f: f is None }}) r"""Unit of measure for the variant, such as `kg` or `meters`.""" - vat_percentage: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('vatPercentage'), 'exclude': lambda f: f is None }}) + vat_percentage: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('vatPercentage'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""VAT rate for the product variant if sales taxes are enabled.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productvariantref.py b/previous-versions/commerce/src/codatcommerce/models/shared/productvariantref.py index 85510ad59..77165ddaa 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productvariantref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productvariantref.py @@ -8,12 +8,11 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ProductVariantRef: r"""Reference that links the line item to the specific version of product that has been ordered.""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""The unique identitifer of the product variant being referenced.""" + r"""The unique identifier of the product variant being referenced.""" name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) r"""Name of the product variant being referenced.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/productvariantstatus.py b/previous-versions/commerce/src/codatcommerce/models/shared/productvariantstatus.py index 5f073db6a..f54446a78 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/productvariantstatus.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/productvariantstatus.py @@ -4,6 +4,7 @@ from enum import Enum class ProductVariantStatus(str, Enum): + r"""The status of the product variant.""" UNKNOWN = 'Unknown' PUBLISHED = 'Published' UNPUBLISHED = 'Unpublished' diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/recordref.py b/previous-versions/commerce/src/codatcommerce/models/shared/recordref.py index a18ef03de..b10f7754a 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/recordref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/recordref.py @@ -7,7 +7,6 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class RecordRef: id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/security.py b/previous-versions/commerce/src/codatcommerce/models/shared/security.py index a72246378..1d57f5faa 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/security.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/security.py @@ -4,7 +4,6 @@ import dataclasses - @dataclasses.dataclass class Security: auth_header: str = dataclasses.field(metadata={'security': { 'scheme': True, 'type': 'apiKey', 'sub_type': 'header', 'field_name': 'Authorization' }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/servicecharge.py b/previous-versions/commerce/src/codatcommerce/models/shared/servicecharge.py index 0706ff4ba..782c25324 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/servicecharge.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/servicecharge.py @@ -6,25 +6,25 @@ from ..shared import taxcomponentallocation as shared_taxcomponentallocation from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from decimal import Decimal +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class ServiceCharge: description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) r"""Service charges for this order.""" quantity: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity'), 'exclude': lambda f: f is None }}) r"""The number of times the charge is charged.""" - tax_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxAmount'), 'exclude': lambda f: f is None }}) + tax_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""Amount of the service charge that is tax.""" - taxes: Optional[list[shared_taxcomponentallocation.TaxComponentAllocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxes'), 'exclude': lambda f: f is None }}) + taxes: Optional[List[shared_taxcomponentallocation.TaxComponentAllocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxes'), 'exclude': lambda f: f is None }}) r"""Taxes breakdown as applied to service charges.""" - tax_percentage: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxPercentage'), 'exclude': lambda f: f is None }}) + tax_percentage: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxPercentage'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""Percentage rate (from 0 to 100) of any tax applied to the service charge.""" - total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) - r"""Total service charge, including taxes.""" + total_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) + r"""Total amount of the service charge, including tax.""" type: Optional[shared_servicechargetype.ServiceChargeType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) r"""The type of the service charge.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/supplementaldata.py b/previous-versions/commerce/src/codatcommerce/models/shared/supplementaldata.py new file mode 100755 index 000000000..c6bb3eaf2 --- /dev/null +++ b/previous-versions/commerce/src/codatcommerce/models/shared/supplementaldata.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from codatcommerce import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Any, Dict, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class SupplementalData: + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + content: Optional[Dict[str, Dict[str, Any]]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('content') }}) + + diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponent.py b/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponent.py index b4308e2b6..093f575aa 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponent.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponent.py @@ -4,11 +4,11 @@ import dataclasses from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class TaxComponent: r"""The Tax Components endpoints return tax rates data from the commerce platform, including tax rate names and values. This is to support the mapping of tax rates from the commerce platform to those in the accounting platform. @@ -22,7 +22,7 @@ class TaxComponent: modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) r"""Name of the Tax Rate Component in the source commerce platform.""" - rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('rate'), 'exclude': lambda f: f is None }}) + rate: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('rate'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""Rate of taxation represented as a fraction of the net price (typically in the range 0.00 - 1.00).""" source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponentallocation.py b/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponentallocation.py index f738d8935..ef5342958 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponentallocation.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponentallocation.py @@ -5,14 +5,14 @@ from ..shared import taxcomponentref as shared_taxcomponentref from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class TaxComponentAllocation: - rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('rate'), 'exclude': lambda f: f is None }}) + rate: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('rate'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder }}) r"""Tax amount on order line sale as available from source commerce platform.""" tax_component_ref: Optional[shared_taxcomponentref.TaxComponentRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxComponentRef'), 'exclude': lambda f: f is None }}) r"""Taxes rates reference object depending on the rates being available on source commerce package.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponentref.py b/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponentref.py index c51bef35e..5bceeca2e 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponentref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponentref.py @@ -7,7 +7,6 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class TaxComponentRef: r"""Taxes rates reference object depending on the rates being available on source commerce package.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponents.py b/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponents.py index bcc89c8e7..c2fb3222b 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponents.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/taxcomponents.py @@ -6,18 +6,19 @@ from ..shared import taxcomponent as shared_taxcomponent from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class TaxComponents: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_taxcomponent.TaxComponent]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_taxcomponent.TaxComponent]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/transaction.py b/previous-versions/commerce/src/codatcommerce/models/shared/transaction.py index d4ae49679..c238abd8e 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/transaction.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/transaction.py @@ -2,15 +2,16 @@ from __future__ import annotations import dataclasses +from ..shared import supplementaldata as shared_supplementaldata from ..shared import transactionsourceref as shared_transactionsourceref from ..shared import transactiontype as shared_transactiontype from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json +from decimal import Decimal from typing import Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Transaction: r"""Details of all financial transactions recorded in the commerce or point of sale system are added to the Transactions data type. For example, payments, service charges, and fees. @@ -81,7 +82,12 @@ class Transaction: source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) sub_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subType'), 'exclude': lambda f: f is None }}) r"""Non-standardised transaction type data from the commerce platform""" - total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) + supplemental_data: Optional[shared_supplementaldata.SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is None }}) + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + total_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) r"""The total transaction amount""" transaction_source_ref: Optional[shared_transactionsourceref.TransactionSourceRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('transactionSourceRef'), 'exclude': lambda f: f is None }}) r"""Link to the source event which triggered this transaction""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/transactions.py b/previous-versions/commerce/src/codatcommerce/models/shared/transactions.py index c0eb9e07a..dee0615f0 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/transactions.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/transactions.py @@ -6,18 +6,19 @@ from ..shared import transaction as shared_transaction from codatcommerce import utils from dataclasses_json import Undefined, dataclass_json -from typing import Optional +from typing import List, Optional @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class Transactions: - r"""OK""" links: shared_links.Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) + r"""Current page number.""" page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + r"""Number of items to return in results array.""" total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - results: Optional[list[shared_transaction.Transaction]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + r"""Total number of items.""" + results: Optional[List[shared_transaction.Transaction]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/transactionsourceref.py b/previous-versions/commerce/src/codatcommerce/models/shared/transactionsourceref.py index d7bc74823..84a21f425 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/transactionsourceref.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/transactionsourceref.py @@ -8,11 +8,11 @@ @dataclass_json(undefined=Undefined.EXCLUDE) - @dataclasses.dataclass class TransactionSourceRef: id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) r"""The unique identitifer of the record being referenced""" type: shared_transactionsourcetype.TransactionSourceType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + r"""The type of source the transaction arose.""" diff --git a/previous-versions/commerce/src/codatcommerce/models/shared/transactionsourcetype.py b/previous-versions/commerce/src/codatcommerce/models/shared/transactionsourcetype.py index 90c7bd583..7efe4d8de 100755 --- a/previous-versions/commerce/src/codatcommerce/models/shared/transactionsourcetype.py +++ b/previous-versions/commerce/src/codatcommerce/models/shared/transactionsourcetype.py @@ -4,6 +4,7 @@ from enum import Enum class TransactionSourceType(str, Enum): + r"""The type of source the transaction arose.""" FEE = 'Fee' ORDER = 'Order' PAYMENT = 'Payment' diff --git a/previous-versions/commerce/src/codatcommerce/orders.py b/previous-versions/commerce/src/codatcommerce/orders.py index dd82684b3..7fc7d9c62 100755 --- a/previous-versions/commerce/src/codatcommerce/orders.py +++ b/previous-versions/commerce/src/codatcommerce/orders.py @@ -28,17 +28,21 @@ def get(self, request: operations.GetOrderRequest, retries: Optional[utils.Retry url = utils.generate_url(operations.GetOrderRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-orders/{orderId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -78,17 +82,21 @@ def list(self, request: operations.ListOrdersRequest, retries: Optional[utils.Re headers = {} query_params = utils.get_query_params(operations.ListOrdersRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/payments.py b/previous-versions/commerce/src/codatcommerce/payments.py index 9821a22c2..c873dcc42 100755 --- a/previous-versions/commerce/src/codatcommerce/payments.py +++ b/previous-versions/commerce/src/codatcommerce/payments.py @@ -28,17 +28,21 @@ def get(self, request: operations.GetPaymentRequest, retries: Optional[utils.Ret url = utils.generate_url(operations.GetPaymentRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-payments/{paymentId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -79,17 +83,21 @@ def get_method(self, request: operations.GetPaymentMethodRequest, retries: Optio url = utils.generate_url(operations.GetPaymentMethodRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-paymentMethods/{paymentMethodId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -129,17 +137,21 @@ def list(self, request: operations.ListPaymentsRequest, retries: Optional[utils. headers = {} query_params = utils.get_query_params(operations.ListPaymentsRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -179,17 +191,21 @@ def list_methods(self, request: operations.ListPaymentMethodsRequest, retries: O headers = {} query_params = utils.get_query_params(operations.ListPaymentMethodsRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/products.py b/previous-versions/commerce/src/codatcommerce/products.py index e8a2a9cf9..11d638e98 100755 --- a/previous-versions/commerce/src/codatcommerce/products.py +++ b/previous-versions/commerce/src/codatcommerce/products.py @@ -28,17 +28,21 @@ def get(self, request: operations.GetProductRequest, retries: Optional[utils.Ret url = utils.generate_url(operations.GetProductRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-products/{productId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -79,17 +83,21 @@ def get_category(self, request: operations.GetProductCategoryRequest, retries: O url = utils.generate_url(operations.GetProductCategoryRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-productCategories/{productId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -129,17 +137,21 @@ def list(self, request: operations.ListProductsRequest, retries: Optional[utils. headers = {} query_params = utils.get_query_params(operations.ListProductsRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -179,17 +191,21 @@ def list_categories(self, request: operations.ListProductCategoriesRequest, retr headers = {} query_params = utils.get_query_params(operations.ListProductCategoriesRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/sdk.py b/previous-versions/commerce/src/codatcommerce/sdk.py index 9ad9377c5..5dcb50c72 100755 --- a/previous-versions/commerce/src/codatcommerce/sdk.py +++ b/previous-versions/commerce/src/codatcommerce/sdk.py @@ -13,6 +13,7 @@ from .transactions import Transactions from codatcommerce import utils from codatcommerce.models import shared +from typing import Dict class CodatCommerce: r"""Commerce API: Codat's standardized API for accessing commerce data @@ -46,35 +47,40 @@ class CodatCommerce: sdk_configuration: SDKConfiguration def __init__(self, - security: shared.Security = None, + auth_header: str, server_idx: int = None, server_url: str = None, - url_params: dict[str, str] = None, - client: requests_http.Session = None + url_params: Dict[str, str] = None, + client: requests_http.Session = None, + retry_config: utils.RetryConfig = None ) -> None: """Instantiates the SDK configuring it with the provided parameters. - :param security: The security details required for authentication - :type security: shared.Security + :param auth_header: The auth_header required for authentication + :type auth_header: str :param server_idx: The index of the server to use for all operations :type server_idx: int :param server_url: The server URL to use for all operations :type server_url: str :param url_params: Parameters to optionally template the server URL with - :type url_params: dict[str, str] + :type url_params: Dict[str, str] :param client: The requests.Session HTTP client to use for all operations - :type client: requests_http.Session + :type client: requests_http.Session + :param retry_config: The utils.RetryConfig to use globally + :type retry_config: utils.RetryConfig """ if client is None: client = requests_http.Session() - security_client = utils.configure_security_client(client, security) + + security_client = utils.configure_security_client(client, shared.Security(auth_header = auth_header)) + if server_url is not None: if url_params is not None: server_url = utils.template_url(server_url, url_params) - self.sdk_configuration = SDKConfiguration(client, security_client, server_url, server_idx) + self.sdk_configuration = SDKConfiguration(client, security_client, server_url, server_idx, retry_config=retry_config) self._init_sdks() diff --git a/previous-versions/commerce/src/codatcommerce/sdkconfiguration.py b/previous-versions/commerce/src/codatcommerce/sdkconfiguration.py index b76f7c247..c8569daa1 100755 --- a/previous-versions/commerce/src/codatcommerce/sdkconfiguration.py +++ b/previous-versions/commerce/src/codatcommerce/sdkconfiguration.py @@ -2,6 +2,9 @@ import requests from dataclasses import dataclass +from typing import Dict, Tuple +from .utils.retries import RetryConfig +from .utils import utils SERVERS = [ @@ -18,12 +21,14 @@ class SDKConfiguration: server_idx: int = 0 language: str = 'python' openapi_doc_version: str = '3.0.0' - sdk_version: str = '0.1.0' - gen_version: str = '2.91.4' + sdk_version: str = '0.34.0' + gen_version: str = '2.159.2' + user_agent: str = 'speakeasy-sdk/python 0.34.0 2.159.2 3.0.0 codat-commerce' + retry_config: RetryConfig = None - def get_server_details(self) -> tuple[str, dict[str, str]]: + def get_server_details(self) -> Tuple[str, Dict[str, str]]: if self.server_url: - return self.server_url.removesuffix('/'), {} + return utils.remove_suffix(self.server_url, '/'), {} if self.server_idx is None: self.server_idx = 0 diff --git a/previous-versions/commerce/src/codatcommerce/tax_components.py b/previous-versions/commerce/src/codatcommerce/tax_components.py index 6a7b72fb5..2b5505c12 100755 --- a/previous-versions/commerce/src/codatcommerce/tax_components.py +++ b/previous-versions/commerce/src/codatcommerce/tax_components.py @@ -28,17 +28,21 @@ def get(self, request: operations.GetTaxComponentRequest, retries: Optional[util url = utils.generate_url(operations.GetTaxComponentRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-taxComponents/{taxId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -78,17 +82,21 @@ def list(self, request: operations.ListTaxComponentsRequest, retries: Optional[u headers = {} query_params = utils.get_query_params(operations.ListTaxComponentsRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/transactions.py b/previous-versions/commerce/src/codatcommerce/transactions.py index 3ab13f721..f8bfa8002 100755 --- a/previous-versions/commerce/src/codatcommerce/transactions.py +++ b/previous-versions/commerce/src/codatcommerce/transactions.py @@ -28,17 +28,21 @@ def get(self, request: operations.GetTransactionRequest, retries: Optional[utils url = utils.generate_url(operations.GetTransactionRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/commerce-transactions/{transactionId}', request) headers = {} headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', @@ -78,17 +82,21 @@ def list(self, request: operations.ListTransactionsRequest, retries: Optional[ut headers = {} query_params = utils.get_query_params(operations.ListTransactionsRequest, request) headers['Accept'] = 'application/json' - headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + headers['user-agent'] = self.sdk_configuration.user_agent client = self.sdk_configuration.security_client + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + if global_retry_config: + retry_config = global_retry_config + else: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): return client.request('GET', url, params=query_params, headers=headers) - + http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', diff --git a/previous-versions/commerce/src/codatcommerce/utils/retries.py b/previous-versions/commerce/src/codatcommerce/utils/retries.py index 2138c1b5e..25f49a1f2 100755 --- a/previous-versions/commerce/src/codatcommerce/utils/retries.py +++ b/previous-versions/commerce/src/codatcommerce/utils/retries.py @@ -2,6 +2,7 @@ import random import time +from typing import List import requests @@ -32,9 +33,9 @@ def __init__(self, strategy: str, backoff: BackoffStrategy, retry_connection_err class Retries: config: RetryConfig - status_codes: list[str] + status_codes: List[str] - def __init__(self, config: RetryConfig, status_codes: list[str]): + def __init__(self, config: RetryConfig, status_codes: List[str]): self.config = config self.status_codes = status_codes diff --git a/previous-versions/commerce/src/codatcommerce/utils/utils.py b/previous-versions/commerce/src/codatcommerce/utils/utils.py index ea9792d0d..ccfad9f7a 100755 --- a/previous-versions/commerce/src/codatcommerce/utils/utils.py +++ b/previous-versions/commerce/src/codatcommerce/utils/utils.py @@ -3,11 +3,14 @@ import base64 import json import re +import sys from dataclasses import Field, dataclass, fields, is_dataclass, make_dataclass from datetime import date, datetime +from decimal import Decimal from email.message import Message from enum import Enum -from typing import Any, Callable, Optional, Tuple, Union, get_args, get_origin +from typing import (Any, Callable, Dict, List, Optional, Tuple, Union, + get_args, get_origin) from xmlrpc.client import boolean import dateutil.parser @@ -17,14 +20,14 @@ class SecurityClient: client: requests.Session - query_params: dict[str, str] = {} + query_params: Dict[str, str] = {} def __init__(self, client: requests.Session): self.client = client def request(self, method, url, **kwargs): params = kwargs.get('params', {}) - kwargs["params"] = self.query_params | params + kwargs["params"] = {**self.query_params, **params} return self.client.request(method, url, **kwargs) @@ -67,7 +70,7 @@ def _parse_security_option(client: SecurityClient, option: dataclass): client, metadata, getattr(option, opt_field.name)) -def _parse_security_scheme(client: SecurityClient, scheme_metadata: dict, scheme: any): +def _parse_security_scheme(client: SecurityClient, scheme_metadata: Dict, scheme: any): scheme_type = scheme_metadata.get('type') sub_type = scheme_metadata.get('sub_type') @@ -91,7 +94,7 @@ def _parse_security_scheme(client: SecurityClient, scheme_metadata: dict, scheme client, scheme_metadata, scheme_metadata, scheme) -def _parse_security_scheme_value(client: SecurityClient, scheme_metadata: dict, security_metadata: dict, value: any): +def _parse_security_scheme_value(client: SecurityClient, scheme_metadata: Dict, security_metadata: Dict, value: any): scheme_type = scheme_metadata.get('type') sub_type = scheme_metadata.get('sub_type') @@ -112,7 +115,8 @@ def _parse_security_scheme_value(client: SecurityClient, scheme_metadata: dict, client.client.headers[header_name] = value elif scheme_type == 'http': if sub_type == 'bearer': - client.client.headers[header_name] = value.lower().startswith('bearer ') and value or f'Bearer {value}' + client.client.headers[header_name] = value.lower().startswith( + 'bearer ') and value or f'Bearer {value}' else: raise Exception('not supported') else: @@ -142,7 +146,7 @@ def _parse_basic_auth_scheme(client: SecurityClient, scheme: dataclass): def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass, - gbls: dict[str, dict[str, dict[str, Any]]] = None) -> str: + gbls: Dict[str, Dict[str, Dict[str, Any]]] = None) -> str: path_param_fields: Tuple[Field, ...] = fields(clazz) for field in path_param_fields: request_metadata = field.metadata.get('request') @@ -171,16 +175,16 @@ def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass '{' + key + '}', value, 1) else: if param_metadata.get('style', 'simple') == 'simple': - if isinstance(param, list): - pp_vals: list[str] = [] + if isinstance(param, List): + pp_vals: List[str] = [] for pp_val in param: if pp_val is None: continue pp_vals.append(_val_to_string(pp_val)) path = path.replace( '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif isinstance(param, dict): - pp_vals: list[str] = [] + elif isinstance(param, Dict): + pp_vals: List[str] = [] for pp_key in param: if param[pp_key] is None: continue @@ -192,8 +196,8 @@ def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass f"{pp_key},{_val_to_string(param[pp_key])}") path = path.replace( '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif not isinstance(param, (str, int, float, complex, bool)): - pp_vals: list[str] = [] + elif not isinstance(param, (str, int, float, complex, bool, Decimal)): + pp_vals: List[str] = [] param_fields: Tuple[Field, ...] = fields(param) for param_field in param_fields: param_value_metadata = param_field.metadata.get( @@ -219,14 +223,14 @@ def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass path = path.replace( '{' + param_metadata.get('field_name', field.name) + '}', _val_to_string(param), 1) - return server_url.removesuffix("/") + path + return remove_suffix(server_url, '/') + path def is_optional(field): return get_origin(field) is Union and type(None) in get_args(field) -def template_url(url_with_params: str, params: dict[str, str]) -> str: +def template_url(url_with_params: str, params: Dict[str, str]) -> str: for key, value in params.items(): url_with_params = url_with_params.replace( '{' + key + '}', value) @@ -234,9 +238,9 @@ def template_url(url_with_params: str, params: dict[str, str]) -> str: return url_with_params -def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[str, dict[str, Any]]] = None) -> dict[ - str, list[str]]: - params: dict[str, list[str]] = {} +def get_query_params(clazz: type, query_params: dataclass, gbls: Dict[str, Dict[str, Dict[str, Any]]] = None) -> Dict[ + str, List[str]]: + params: Dict[str, List[str]] = {} param_fields: Tuple[Field, ...] = fields(clazz) for field in param_fields: @@ -266,24 +270,24 @@ def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[ else: style = metadata.get('style', 'form') if style == 'deepObject': - params = params | _get_deep_object_query_params( - metadata, f_name, value) + params = {**params, **_get_deep_object_query_params( + metadata, f_name, value)} elif style == 'form': - params = params | _get_delimited_query_params( - metadata, f_name, value, ",") + params = {**params, **_get_delimited_query_params( + metadata, f_name, value, ",")} elif style == 'pipeDelimited': - params = params | _get_delimited_query_params( - metadata, f_name, value, "|") + params = {**params, **_get_delimited_query_params( + metadata, f_name, value, "|")} else: raise Exception('not yet implemented') return params -def get_headers(headers_params: dataclass) -> dict[str, str]: +def get_headers(headers_params: dataclass) -> Dict[str, str]: if headers_params is None: return {} - headers: dict[str, str] = {} + headers: Dict[str, str] = {} param_fields: Tuple[Field, ...] = fields(headers_params) for field in param_fields: @@ -300,8 +304,8 @@ def get_headers(headers_params: dataclass) -> dict[str, str]: return headers -def _get_serialized_params(metadata: dict, field_name: str, obj: any) -> dict[str, str]: - params: dict[str, str] = {} +def _get_serialized_params(metadata: Dict, field_name: str, obj: any) -> Dict[str, str]: + params: Dict[str, str] = {} serialization = metadata.get('serialization', '') if serialization == 'json': @@ -310,8 +314,8 @@ def _get_serialized_params(metadata: dict, field_name: str, obj: any) -> dict[st return params -def _get_deep_object_query_params(metadata: dict, field_name: str, obj: any) -> dict[str, list[str]]: - params: dict[str, list[str]] = {} +def _get_deep_object_query_params(metadata: Dict, field_name: str, obj: any) -> Dict[str, List[str]]: + params: Dict[str, List[str]] = {} if obj is None: return params @@ -327,7 +331,7 @@ def _get_deep_object_query_params(metadata: dict, field_name: str, obj: any) -> if obj_val is None: continue - if isinstance(obj_val, list): + if isinstance(obj_val, List): for val in obj_val: if val is None: continue @@ -345,12 +349,12 @@ def _get_deep_object_query_params(metadata: dict, field_name: str, obj: any) -> params[ f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [ _val_to_string(obj_val)] - elif isinstance(obj, dict): + elif isinstance(obj, Dict): for key, value in obj.items(): if value is None: continue - if isinstance(value, list): + if isinstance(value, List): for val in value: if val is None: continue @@ -376,8 +380,8 @@ def _get_query_param_field_name(obj_field: Field) -> str: return obj_param_metadata.get("field_name", obj_field.name) -def _get_delimited_query_params(metadata: dict, field_name: str, obj: any, delimiter: str) -> dict[ - str, list[str]]: +def _get_delimited_query_params(metadata: Dict, field_name: str, obj: any, delimiter: str) -> Dict[ + str, List[str]]: return _populate_form(field_name, metadata.get("explode", True), obj, _get_query_param_field_name, delimiter) @@ -390,17 +394,22 @@ def _get_delimited_query_params(metadata: dict, field_name: str, obj: any, delim } -def serialize_request_body(request: dataclass, request_field_name: str, serialization_method: str) -> Tuple[ - str, any, any]: +def serialize_request_body(request: dataclass, request_field_name: str, nullable: bool, optional: bool, serialization_method: str, encoder=None) -> Tuple[ + str, any, any]: if request is None: - return None, None, None, None + if not nullable and optional: + return None, None, None if not is_dataclass(request) or not hasattr(request, request_field_name): return serialize_content_type(request_field_name, SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], - request) + request, encoder) request_val = getattr(request, request_field_name) + if request_val is None: + if not nullable and optional: + return None, None, None + request_fields: Tuple[Field, ...] = fields(request) request_metadata = None @@ -416,9 +425,9 @@ def serialize_request_body(request: dataclass, request_field_name: str, serializ request_val) -def serialize_content_type(field_name: str, media_type: str, request: dataclass) -> Tuple[str, any, list[list[any]]]: +def serialize_content_type(field_name: str, media_type: str, request: dataclass, encoder=None) -> Tuple[str, any, List[List[any]]]: if re.match(r'(application|text)\/.*?\+*json.*', media_type) is not None: - return media_type, marshal_json(request), None + return media_type, marshal_json(request, encoder), None if re.match(r'multipart\/.*', media_type) is not None: return serialize_multipart_form(media_type, request) if re.match(r'application\/x-www-form-urlencoded.*', media_type) is not None: @@ -432,8 +441,8 @@ def serialize_content_type(field_name: str, media_type: str, request: dataclass) f"invalid request body type {type(request)} for mediaType {media_type}") -def serialize_multipart_form(media_type: str, request: dataclass) -> Tuple[str, any, list[list[any]]]: - form: list[list[any]] = [] +def serialize_multipart_form(media_type: str, request: dataclass) -> Tuple[str, any, List[List[any]]]: + form: List[List[any]] = [] request_fields = fields(request) for field in request_fields: @@ -474,7 +483,7 @@ def serialize_multipart_form(media_type: str, request: dataclass) -> Tuple[str, else: field_name = field_metadata.get( "field_name", field.name) - if isinstance(val, list): + if isinstance(val, List): for value in val: if value is None: continue @@ -485,8 +494,8 @@ def serialize_multipart_form(media_type: str, request: dataclass) -> Tuple[str, return media_type, None, form -def serialize_dict(original: dict, explode: bool, field_name, existing: Optional[dict[str, list[str]]]) -> dict[ - str, list[str]]: +def serialize_dict(original: Dict, explode: bool, field_name, existing: Optional[Dict[str, List[str]]]) -> Dict[ + str, List[str]]: if existing is None: existing = [] @@ -506,8 +515,8 @@ def serialize_dict(original: dict, explode: bool, field_name, existing: Optional return existing -def serialize_form_data(field_name: str, data: dataclass) -> dict[str, any]: - form: dict[str, list[str]] = {} +def serialize_form_data(field_name: str, data: dataclass) -> Dict[str, any]: + form: Dict[str, List[str]] = {} if is_dataclass(data): for field in fields(data): @@ -525,12 +534,12 @@ def serialize_form_data(field_name: str, data: dataclass) -> dict[str, any]: form[field_name] = [marshal_json(val)] else: if metadata.get('style', 'form') == 'form': - form = form | _populate_form( - field_name, metadata.get('explode', True), val, _get_form_field_name, ",") + form = {**form, **_populate_form( + field_name, metadata.get('explode', True), val, _get_form_field_name, ",")} else: raise Exception( f'Invalid form style for field {field.name}') - elif isinstance(data, dict): + elif isinstance(data, Dict): for key, value in data.items(): form[key] = [_val_to_string(value)] else: @@ -549,8 +558,8 @@ def _get_form_field_name(obj_field: Field) -> str: def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_func: Callable, delimiter: str) -> \ - dict[str, list[str]]: - params: dict[str, list[str]] = {} + Dict[str, List[str]]: + params: Dict[str, List[str]] = {} if obj is None: return params @@ -576,7 +585,7 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f if len(items) > 0: params[field_name] = [delimiter.join(items)] - elif isinstance(obj, dict): + elif isinstance(obj, Dict): items = [] for key, value in obj.items(): if value is None: @@ -589,7 +598,7 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f if len(items) > 0: params[field_name] = [delimiter.join(items)] - elif isinstance(obj, list): + elif isinstance(obj, List): items = [] for value in obj: @@ -604,7 +613,8 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f items.append(_val_to_string(value)) if len(items) > 0: - params[field_name] = [delimiter.join([str(item) for item in items])] + params[field_name] = [delimiter.join( + [str(item) for item in items])] else: params[field_name] = [_val_to_string(obj)] @@ -642,7 +652,7 @@ def _serialize_header(explode: bool, obj: any) -> str: if len(items) > 0: return ','.join(items) - elif isinstance(obj, dict): + elif isinstance(obj, Dict): items = [] for key, value in obj.items(): @@ -657,7 +667,7 @@ def _serialize_header(explode: bool, obj: any) -> str: if len(items) > 0: return ','.join([str(item) for item in items]) - elif isinstance(obj, list): + elif isinstance(obj, List): items = [] for value in obj: @@ -674,23 +684,28 @@ def _serialize_header(explode: bool, obj: any) -> str: return '' -def unmarshal_json(data, typ): +def unmarshal_json(data, typ, decoder=None): unmarshal = make_dataclass('Unmarshal', [('res', typ)], bases=(DataClassJsonMixin,)) json_dict = json.loads(data) try: out = unmarshal.from_dict({"res": json_dict}) except AttributeError as attr_err: - raise AttributeError(f'unable to unmarshal {data} as {typ}') from attr_err - return out.res + raise AttributeError( + f'unable to unmarshal {data} as {typ}') from attr_err + + return out.res if decoder is None else decoder(out.res) -def marshal_json(val): +def marshal_json(val, encoder=None): marshal = make_dataclass('Marshal', [('res', type(val))], bases=(DataClassJsonMixin,)) marshaller = marshal(res=val) json_dict = marshaller.to_dict() - return json.dumps(json_dict["res"]) + + val = json_dict["res"] if encoder is None else encoder(json_dict["res"]) + + return json.dumps(val) def match_content_type(content_type: str, pattern: str) -> boolean: @@ -734,6 +749,86 @@ def datefromisoformat(date_str: str): return dateutil.parser.parse(date_str).date() +def bigintencoder(optional: bool): + def bigintencode(val: int): + if optional and val is None: + return None + return str(val) + + return bigintencode + + +def bigintdecoder(val): + return int(val) + + +def decimalencoder(optional: bool, as_str: bool): + def decimalencode(val: Decimal): + if optional and val is None: + return None + + if as_str: + return str(val) + + return float(val) + + return decimalencode + + +def decimaldecoder(val): + return Decimal(str(val)) + + +def map_encoder(optional: bool, value_encoder: Callable): + def map_encode(val: Dict): + if optional and val is None: + return None + + encoded = {} + for key, value in val.items(): + encoded[key] = value_encoder(value) + + return encoded + + return map_encode + + +def map_decoder(value_decoder: Callable): + def map_decode(val: Dict): + decoded = {} + for key, value in val.items(): + decoded[key] = value_decoder(value) + + return decoded + + return map_decode + + +def list_encoder(optional: bool, value_encoder: Callable): + def list_encode(val: List): + if optional and val is None: + return None + + encoded = [] + for value in val: + encoded.append(value_encoder(value)) + + return encoded + + return list_encode + + +def list_decoder(value_decoder: Callable): + def list_decode(val: List): + decoded = [] + for value in val: + decoded.append(value_decoder(value)) + + return decoded + + return list_decode + + def get_field_name(name): def override(_, _field_name=name): return _field_name @@ -752,7 +847,7 @@ def _val_to_string(val): return str(val) -def _populate_from_globals(param_name: str, value: any, param_type: str, gbls: dict[str, dict[str, dict[str, Any]]]): +def _populate_from_globals(param_name: str, value: any, param_type: str, gbls: Dict[str, Dict[str, Dict[str, Any]]]): if value is None and gbls is not None: if 'parameters' in gbls: if param_type in gbls['parameters']: @@ -762,3 +857,16 @@ def _populate_from_globals(param_name: str, value: any, param_type: str, gbls: d value = global_value return value + + +def decoder_with_discriminator(field_name): + def decode_fx(obj): + kls = getattr(sys.modules['sdk.models.shared'], obj[field_name]) + return unmarshal_json(json.dumps(obj), kls) + return decode_fx + + +def remove_suffix(input_string, suffix): + if suffix and input_string.endswith(suffix): + return input_string[:-len(suffix)] + return input_string