diff --git a/platform/.speakeasy/gen.lock b/platform/.speakeasy/gen.lock index a7c532397..b37d16655 100755 --- a/platform/.speakeasy/gen.lock +++ b/platform/.speakeasy/gen.lock @@ -1,27 +1,28 @@ lockVersion: 2.0.0 id: ede4f28e-23c0-442d-89ba-baa76ae2da6e management: - docChecksum: 1c413a5d3d57588774d54236c89a147e + docChecksum: 6b9afa35a1ca4d8a1834643e80dd9a19 docVersion: 3.0.0 speakeasyVersion: internal - generationVersion: 2.257.2 - releaseVersion: 3.3.0 - configChecksum: 784efc81af1d53ff20fe66e5949e3428 + generationVersion: 2.277.0 + releaseVersion: 3.4.0 + configChecksum: 29197c333cff36b846fe087471e16d21 repoURL: https://github.com/codatio/client-sdk-python.git repoSubDirectory: platform installationURL: https://github.com/codatio/client-sdk-python.git#subdirectory=platform published: true features: python: - constsAndDefaults: 0.1.2 - core: 4.4.6 + constsAndDefaults: 0.1.3 + core: 4.5.0 deprecations: 2.81.1 examples: 2.81.3 - globalSecurity: 2.83.2 + globalSecurity: 2.83.4 globalServerURLs: 2.82.1 inputOutputModels: 2.83.1 nameOverrides: 2.81.1 retries: 2.82.1 + webhooks: 1.0.0 generatedFiles: - src/codatplatform/sdkconfiguration.py - src/codatplatform/settings.py @@ -83,8 +84,11 @@ generatedFiles: - src/codatplatform/models/operations/configure_supplemental_data.py - src/codatplatform/models/operations/get_supplemental_data_configuration.py - src/codatplatform/models/operations/create_rule.py + - src/codatplatform/models/operations/create_webhook_consumer.py + - src/codatplatform/models/operations/delete_webhook_consumer.py - src/codatplatform/models/operations/get_webhook.py - src/codatplatform/models/operations/list_rules.py + - src/codatplatform/models/operations/list_webhook_consumers.py - src/codatplatform/models/shared/apikeydetails.py - src/codatplatform/models/shared/errorvalidation.py - src/codatplatform/models/shared/errorvalidationitem.py @@ -146,7 +150,10 @@ generatedFiles: - src/codatplatform/models/shared/webhook.py - src/codatplatform/models/shared/webhooknotifier.py - src/codatplatform/models/shared/createrule.py + - src/codatplatform/models/shared/webhookconsumer.py + - src/codatplatform/models/shared/webhookconsumerprototype.py - src/codatplatform/models/shared/webhooks.py + - src/codatplatform/models/shared/webhookconsumers.py - src/codatplatform/models/shared/security.py - src/codatplatform/models/shared/clientratelimitreachedwebhook.py - src/codatplatform/models/shared/clientratelimitreachedwebhookdata.py @@ -254,10 +261,14 @@ generatedFiles: - docs/models/operations/getsupplementaldataconfigurationrequest.md - docs/models/operations/getsupplementaldataconfigurationresponse.md - docs/models/operations/createruleresponse.md + - docs/models/operations/createwebhookconsumerresponse.md + - docs/models/operations/deletewebhookconsumerrequest.md + - docs/models/operations/deletewebhookconsumerresponse.md - docs/models/operations/getwebhookrequest.md - docs/models/operations/getwebhookresponse.md - docs/models/operations/listrulesrequest.md - docs/models/operations/listrulesresponse.md + - docs/models/operations/listwebhookconsumersresponse.md - docs/models/shared/apikeydetails.md - docs/models/shared/errorvalidation.md - docs/models/shared/errorvalidationitem.md @@ -324,7 +335,10 @@ generatedFiles: - docs/models/shared/webhook.md - docs/models/shared/webhooknotifier.md - docs/models/shared/createrule.md + - docs/models/shared/webhookconsumer.md + - docs/models/shared/webhookconsumerprototype.md - docs/models/shared/webhooks.md + - docs/models/shared/webhookconsumers.md - docs/models/shared/security.md - docs/models/shared/clientratelimitreachedwebhook.md - docs/models/shared/clientratelimitreachedwebhookdata.md @@ -368,3 +382,7 @@ generatedFiles: - docs/sdks/webhooks/README.md - USAGE.md - .gitattributes + - src/codatplatform/_hooks/registration.py + - src/codatplatform/_hooks/sdkhooks.py + - src/codatplatform/_hooks/types.py + - src/codatplatform/_hooks/__init__.py diff --git a/platform/README.md b/platform/README.md index bda3179b2..0cbebb602 100644 --- a/platform/README.md +++ b/platform/README.md @@ -24,7 +24,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -111,9 +111,12 @@ if res.api_key_details is not None: ### [webhooks](docs/sdks/webhooks/README.md) -* [create](docs/sdks/webhooks/README.md#create) - Create webhook -* [get](docs/sdks/webhooks/README.md#get) - Get webhook -* [list](docs/sdks/webhooks/README.md#list) - List webhooks +* [~~create~~](docs/sdks/webhooks/README.md#create) - Create webhook :warning: **Deprecated** +* [create_consumer](docs/sdks/webhooks/README.md#create_consumer) - Create webhook consumer +* [delete_consumer](docs/sdks/webhooks/README.md#delete_consumer) - Delete webhook consumer +* [~~get~~](docs/sdks/webhooks/README.md#get) - Get webhook :warning: **Deprecated** +* [~~list~~](docs/sdks/webhooks/README.md#list) - List webhooks :warning: **Deprecated** +* [list_consumers](docs/sdks/webhooks/README.md#list_consumers) - List webhook consumers @@ -131,7 +134,7 @@ from codatplatform.utils import BackoffStrategy, RetryConfig s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -156,7 +159,7 @@ from codatplatform.utils import BackoffStrategy, RetryConfig s = codatplatform.CodatPlatform( retry_config=RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False) security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -190,7 +193,7 @@ from codatplatform.models import errors, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -234,7 +237,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( server_idx=0, security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -260,7 +263,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( server_url="https://api.codat.io", security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -310,7 +313,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/RELEASES.md b/platform/RELEASES.md index 4d0c9a721..983784d6f 100644 --- a/platform/RELEASES.md +++ b/platform/RELEASES.md @@ -78,4 +78,14 @@ Based on: ### Generated - [python v3.3.0] platform ### Releases -- [PyPI v3.3.0] https://pypi.org/project/codat-platform/3.3.0 - platform \ No newline at end of file +- [PyPI v3.3.0] https://pypi.org/project/codat-platform/3.3.0 - platform + +## 2024-03-06 11:07:09 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Platform.yaml +- Speakeasy CLI 1.201.1 (2.277.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v3.4.0] platform +### Releases +- [PyPI v3.4.0] https://pypi.org/project/codat-platform/3.4.0 - platform \ No newline at end of file diff --git a/platform/USAGE.md b/platform/USAGE.md index 647bbe6cc..bd52f7bb6 100644 --- a/platform/USAGE.md +++ b/platform/USAGE.md @@ -5,7 +5,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/models/operations/addcompanytogroupresponse.md b/platform/docs/models/operations/addcompanytogroupresponse.md index 05f5abd06..73d15a0d1 100644 --- a/platform/docs/models/operations/addcompanytogroupresponse.md +++ b/platform/docs/models/operations/addcompanytogroupresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | Success | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | Success | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"platform": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"groups": [
{
"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"
}
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/configurecustomdatatyperequest.md b/platform/docs/models/operations/configurecustomdatatyperequest.md index 025ad48bc..d32c9c6b9 100644 --- a/platform/docs/models/operations/configurecustomdatatyperequest.md +++ b/platform/docs/models/operations/configurecustomdatatyperequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `custom_data_identifier` | *str* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | -| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | -| `custom_data_type_configuration` | [Optional[shared.CustomDataTypeConfiguration]](../../models/shared/customdatatypeconfiguration.md) | :heavy_minus_sign: | Custom data type configuration for the specified platform. | {"dataSource":"api/purchaseOrders?$filter=currencyCode eq 'NOK'","requiredData":{"currencyCode":"$[*].currencyCode","id":"$[*].id","number":"$[*].number","orderDate":"$[*].orderDate","totalAmountExcludingTax":"$[*].totalAmountExcludingTax","totalTaxAmount":"$[*].totalTaxAmount","vendorName":"$[*].number"},"keyBy":["$[*].id"],"sourceModifiedDate":["$[*].lastModifiedDateTime"]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `custom_data_identifier` | *str* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | +| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | +| `custom_data_type_configuration` | [Optional[shared.CustomDataTypeConfiguration]](../../models/shared/customdatatypeconfiguration.md) | :heavy_minus_sign: | Custom data type configuration for the specified platform. | {
"dataSource": "api/purchaseOrders?$filter=currencyCode eq 'NOK'",
"requiredData": {
"currencyCode": "$[*].currencyCode",
"id": "$[*].id",
"number": "$[*].number",
"orderDate": "$[*].orderDate",
"totalAmountExcludingTax": "$[*].totalAmountExcludingTax",
"totalTaxAmount": "$[*].totalTaxAmount",
"vendorName": "$[*].number"
},
"keyBy": [
"$[*].id"
],
"sourceModifiedDate": [
"$[*].lastModifiedDateTime"
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/configurecustomdatatyperesponse.md b/platform/docs/models/operations/configurecustomdatatyperesponse.md index 3e01b572a..718751364 100644 --- a/platform/docs/models/operations/configurecustomdatatyperesponse.md +++ b/platform/docs/models/operations/configurecustomdatatyperesponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `custom_data_type_configuration` | [Optional[shared.CustomDataTypeConfiguration]](../../models/shared/customdatatypeconfiguration.md) | :heavy_minus_sign: | OK | {"dataSource":"api/purchaseOrders?$filter=currencyCode eq 'NOK'","requiredData":{"currencyCode":"$[*].currencyCode","id":"$[*].id","number":"$[*].number","orderDate":"$[*].orderDate","totalAmountExcludingTax":"$[*].totalAmountExcludingTax","totalTaxAmount":"$[*].totalTaxAmount","vendorName":"$[*].number"},"keyBy":["$[*].id"],"sourceModifiedDate":["$[*].lastModifiedDateTime"]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `custom_data_type_configuration` | [Optional[shared.CustomDataTypeConfiguration]](../../models/shared/customdatatypeconfiguration.md) | :heavy_minus_sign: | OK | {
"dataSource": "api/purchaseOrders?$filter=currencyCode eq 'NOK'",
"requiredData": {
"currencyCode": "$[*].currencyCode",
"id": "$[*].id",
"number": "$[*].number",
"orderDate": "$[*].orderDate",
"totalAmountExcludingTax": "$[*].totalAmountExcludingTax",
"totalTaxAmount": "$[*].totalTaxAmount",
"vendorName": "$[*].number"
},
"keyBy": [
"$[*].id"
],
"sourceModifiedDate": [
"$[*].lastModifiedDateTime"
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/configuresupplementaldatarequest.md b/platform/docs/models/operations/configuresupplementaldatarequest.md index 103acdabf..86a981f6b 100644 --- a/platform/docs/models/operations/configuresupplementaldatarequest.md +++ b/platform/docs/models/operations/configuresupplementaldatarequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data_type` | [operations.DataType](../../models/operations/datatype.md) | :heavy_check_mark: | Supported supplemental data data type. | invoices | -| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | -| `supplemental_data_configuration` | [Optional[shared.SupplementalDataConfiguration]](../../models/shared/supplementaldataconfiguration.md) | :heavy_minus_sign: | The configuration for the specified platform and data type. | {"supplementalDataConfig":{"orders-supplemental-data":{"dataSource":"/orders","pullData":{"orderNumber":"order_num"},"pushData":{"orderNumber":"order_num"}}}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data_type` | [operations.DataType](../../models/operations/datatype.md) | :heavy_check_mark: | Supported supplemental data data type. | invoices | +| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | +| `supplemental_data_configuration` | [Optional[shared.SupplementalDataConfiguration]](../../models/shared/supplementaldataconfiguration.md) | :heavy_minus_sign: | The configuration for the specified platform and data type. | {
"supplementalDataConfig": {
"orders-supplemental-data": {
"dataSource": "/orders",
"pullData": {
"orderNumber": "order_num"
},
"pushData": {
"orderNumber": "order_num"
}
}
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/createcompanyresponse.md b/platform/docs/models/operations/createcompanyresponse.md index faee951b5..2687774f3 100644 --- a/platform/docs/models/operations/createcompanyresponse.md +++ b/platform/docs/models/operations/createcompanyresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"platform": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"groups": [
{
"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"
}
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/createconnectionresponse.md b/platform/docs/models/operations/createconnectionresponse.md index 4d113122e..5bafc316c 100644 --- a/platform/docs/models/operations/createconnectionresponse.md +++ b/platform/docs/models/operations/createconnectionresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/platform/docs/models/operations/createruleresponse.md b/platform/docs/models/operations/createruleresponse.md index df77fc41f..ee2615b06 100644 --- a/platform/docs/models/operations/createruleresponse.md +++ b/platform/docs/models/operations/createruleresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `webhook` | [Optional[shared.Webhook]](../../models/shared/webhook.md) | :heavy_minus_sign: | OK | {"type":"DataConnectionStatusChanged","companyId":"39b73b17-cc2e-429e-915d-71654e9dcd1e","notifiers":{"emails":["info@client.com"],"webhook":"https://webhook.client.com"}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `webhook` | [Optional[shared.Webhook]](../../models/shared/webhook.md) | :heavy_minus_sign: | OK | {
"type": "DataConnectionStatusChanged",
"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e",
"notifiers": {
"emails": [
"info@client.com"
],
"webhook": "https://webhook.client.com"
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/createwebhookconsumerresponse.md b/platform/docs/models/operations/createwebhookconsumerresponse.md new file mode 100644 index 000000000..cc28fc5c5 --- /dev/null +++ b/platform/docs/models/operations/createwebhookconsumerresponse.md @@ -0,0 +1,11 @@ +# CreateWebhookConsumerResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `webhook_consumer` | [Optional[shared.WebhookConsumer]](../../models/shared/webhookconsumer.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/models/operations/deletewebhookconsumerrequest.md b/platform/docs/models/operations/deletewebhookconsumerrequest.md new file mode 100644 index 000000000..f024c5e52 --- /dev/null +++ b/platform/docs/models/operations/deletewebhookconsumerrequest.md @@ -0,0 +1,8 @@ +# DeleteWebhookConsumerRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `webhook_id` | *str* | :heavy_check_mark: | Unique identifier for the webhook consumer. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/models/operations/deletewebhookconsumerresponse.md b/platform/docs/models/operations/deletewebhookconsumerresponse.md new file mode 100644 index 000000000..906dcd752 --- /dev/null +++ b/platform/docs/models/operations/deletewebhookconsumerresponse.md @@ -0,0 +1,10 @@ +# DeleteWebhookConsumerResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/platform/docs/models/operations/getcompanypushhistoryresponse.md b/platform/docs/models/operations/getcompanypushhistoryresponse.md index 4f22f04b7..e451a87d9 100644 --- a/platform/docs/models/operations/getcompanypushhistoryresponse.md +++ b/platform/docs/models/operations/getcompanypushhistoryresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `push_operations` | [Optional[shared.PushOperations]](../../models/shared/pushoperations.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `push_operations` | [Optional[shared.PushOperations]](../../models/shared/pushoperations.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getcompanyresponse.md b/platform/docs/models/operations/getcompanyresponse.md index 9b44863d2..a64f3c90c 100644 --- a/platform/docs/models/operations/getcompanyresponse.md +++ b/platform/docs/models/operations/getcompanyresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"platform": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"groups": [
{
"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"
}
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getconnectionresponse.md b/platform/docs/models/operations/getconnectionresponse.md index 66e3f65f1..f1358ac2e 100644 --- a/platform/docs/models/operations/getconnectionresponse.md +++ b/platform/docs/models/operations/getconnectionresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getcustomdatatypeconfigurationrequest.md b/platform/docs/models/operations/getcustomdatatypeconfigurationrequest.md index f366ae781..3b0da743e 100644 --- a/platform/docs/models/operations/getcustomdatatypeconfigurationrequest.md +++ b/platform/docs/models/operations/getcustomdatatypeconfigurationrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `custom_data_identifier` | *str* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | -| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `custom_data_identifier` | *str* | :heavy_check_mark: | Unique identifier for a custom data type. | DynamicsPurchaseOrders | +| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | \ No newline at end of file diff --git a/platform/docs/models/operations/getintegrationrequest.md b/platform/docs/models/operations/getintegrationrequest.md index ac76c9f3c..e5f10d9ee 100644 --- a/platform/docs/models/operations/getintegrationrequest.md +++ b/platform/docs/models/operations/getintegrationrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | \ No newline at end of file diff --git a/platform/docs/models/operations/getintegrationresponse.md b/platform/docs/models/operations/getintegrationresponse.md index ba1fe0aff..67485fa77 100644 --- a/platform/docs/models/operations/getintegrationresponse.md +++ b/platform/docs/models/operations/getintegrationresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `integration` | [Optional[shared.Integration]](../../models/shared/integration.md) | :heavy_minus_sign: | OK | {"key":"gbol","logoUrl":"http://example.com","name":"Xero","enabled":true,"sourceId":"accounting","sourceType":"8193a927-ab7a-45a3-9dc2-d357a4932dfe","integrationId":"497a18ca-284e-40c0-985d-f72be35d468e","isOfflineConnector":true,"isBeta":true,"dataProvidedBy":"string","datatypeFeatures":[{"datatype":"invoices","supportedFeatures":[{"featureType":"get","featureState":"release"}]}]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `integration` | [Optional[shared.Integration]](../../models/shared/integration.md) | :heavy_minus_sign: | OK | {
"key": "gbol",
"logoUrl": "http://example.com",
"name": "Xero",
"enabled": true,
"sourceId": "accounting",
"sourceType": "8193a927-ab7a-45a3-9dc2-d357a4932dfe",
"integrationId": "497a18ca-284e-40c0-985d-f72be35d468e",
"isOfflineConnector": true,
"isBeta": true,
"dataProvidedBy": "string",
"datatypeFeatures": [
{
"datatype": "invoices",
"supportedFeatures": [
{
"featureType": "get",
"featureState": "release"
}
]
}
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getintegrationsbrandingrequest.md b/platform/docs/models/operations/getintegrationsbrandingrequest.md index cc7d37703..09a308fb5 100644 --- a/platform/docs/models/operations/getintegrationsbrandingrequest.md +++ b/platform/docs/models/operations/getintegrationsbrandingrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | \ No newline at end of file diff --git a/platform/docs/models/operations/getintegrationsbrandingresponse.md b/platform/docs/models/operations/getintegrationsbrandingresponse.md index 13d358a4d..2d18dc548 100644 --- a/platform/docs/models/operations/getintegrationsbrandingresponse.md +++ b/platform/docs/models/operations/getintegrationsbrandingresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `branding` | [Optional[shared.Branding]](../../models/shared/branding.md) | :heavy_minus_sign: | OK | {"logo":{"full":{"image":{"src":"https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png","alt":"xero full icon"}},"square":{"image":{"src":"https://static.codat.io/public/officialLogos/Square/8A156A5A-39CB-4F9D-856E-76EF9B2W3607.png","alt":"xero square icon"}}},"button":{"default":{"image":{"src":"https://static.codat.io/public/officialButtons/Full/8A156A5A-39CB-4F9D-856E-76EF9Q7A9607.png","alt":"xero default button icon"}},"hover":{"image":{"src":"https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png","alt":"xero hover button icon"}}},"sourceId":"35b92968-9851-4095-ad60-395c95cbcba4"} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `branding` | [Optional[shared.Branding]](../../models/shared/branding.md) | :heavy_minus_sign: | OK | {
"logo": {
"full": {
"image": {
"src": "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png",
"alt": "xero full icon"
}
},
"square": {
"image": {
"src": "https://static.codat.io/public/officialLogos/Square/8A156A5A-39CB-4F9D-856E-76EF9B2W3607.png",
"alt": "xero square icon"
}
}
},
"button": {
"default": {
"image": {
"src": "https://static.codat.io/public/officialButtons/Full/8A156A5A-39CB-4F9D-856E-76EF9Q7A9607.png",
"alt": "xero default button icon"
}
},
"hover": {
"image": {
"src": "https://static.codat.io/public/officialLogos/Full/8A156A5A-39CB-4F9D-856E-76EF9B9A9607.png",
"alt": "xero hover button icon"
}
}
},
"sourceId": "35b92968-9851-4095-ad60-395c95cbcba4"
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getprofileresponse.md b/platform/docs/models/operations/getprofileresponse.md index 2bdefd1d7..8c5b703de 100644 --- a/platform/docs/models/operations/getprofileresponse.md +++ b/platform/docs/models/operations/getprofileresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `profile` | [Optional[shared.Profile]](../../models/shared/profile.md) | :heavy_minus_sign: | OK | {"name":"Bob's Burgers","logoUrl":"https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png","iconUrl":"https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico","redirectUrl":"https://bobs-burgers.{countrySuffix}/{companyId}","whiteListUrls":["https://bobs-burgers.com","https://bobs-burgers.co.uk"],"confirmCompanyName":true} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `profile` | [Optional[shared.Profile]](../../models/shared/profile.md) | :heavy_minus_sign: | OK | {
"name": "Bob's Burgers",
"logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png",
"iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico",
"redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}",
"whiteListUrls": [
"https://bobs-burgers.com",
"https://bobs-burgers.co.uk"
],
"confirmCompanyName": true
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getpulloperationresponse.md b/platform/docs/models/operations/getpulloperationresponse.md index 1ee27f4e4..2223df457 100644 --- a/platform/docs/models/operations/getpulloperationresponse.md +++ b/platform/docs/models/operations/getpulloperationresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {"id":"97d60846-f07a-4d42-b5a0-0bdcc6ebf56b","companyId":"4645bd78-8988-45bc-ac9e-67ba5df6e4e5","connectionId":"51baa045-4836-4317-a42e-3542e991e581","dataType":"invoices","status":"Initial","statusDescription":"Paused until 2022-10-23T00:00:00.000Z","requested":"2022-11-14T11:18:37.2798351Z","progress":10,"isCompleted":false,"isErrored":false} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {
"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b",
"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5",
"connectionId": "51baa045-4836-4317-a42e-3542e991e581",
"dataType": "invoices",
"status": "Initial",
"statusDescription": "Paused until 2022-10-23T00:00:00.000Z",
"requested": "2022-11-14T11:18:37.2798351Z",
"progress": 10,
"isCompleted": false,
"isErrored": false
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getsupplementaldataconfigurationrequest.md b/platform/docs/models/operations/getsupplementaldataconfigurationrequest.md index 81697d2f7..6979a8eb8 100644 --- a/platform/docs/models/operations/getsupplementaldataconfigurationrequest.md +++ b/platform/docs/models/operations/getsupplementaldataconfigurationrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data_type` | [operations.PathParamDataType](../../models/operations/pathparamdatatype.md) | :heavy_check_mark: | Supported supplemental data data type. | invoices | -| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `data_type` | [operations.PathParamDataType](../../models/operations/pathparamdatatype.md) | :heavy_check_mark: | Supported supplemental data data type. | invoices | +| `platform_key` | *str* | :heavy_check_mark: | A unique 4-letter key to represent a platform in each integration. | gbol | \ No newline at end of file diff --git a/platform/docs/models/operations/getsupplementaldataconfigurationresponse.md b/platform/docs/models/operations/getsupplementaldataconfigurationresponse.md index 16cfadc4c..b3dee902e 100644 --- a/platform/docs/models/operations/getsupplementaldataconfigurationresponse.md +++ b/platform/docs/models/operations/getsupplementaldataconfigurationresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `supplemental_data_configuration` | [Optional[shared.SupplementalDataConfiguration]](../../models/shared/supplementaldataconfiguration.md) | :heavy_minus_sign: | OK | {"supplementalDataConfig":{"orders-supplemental-data":{"dataSource":"/orders","pullData":{"orderNumber":"order_num"},"pushData":{"orderNumber":"order_num"}}}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `supplemental_data_configuration` | [Optional[shared.SupplementalDataConfiguration]](../../models/shared/supplementaldataconfiguration.md) | :heavy_minus_sign: | OK | {
"supplementalDataConfig": {
"orders-supplemental-data": {
"dataSource": "/orders",
"pullData": {
"orderNumber": "order_num"
},
"pushData": {
"orderNumber": "order_num"
}
}
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getwebhookresponse.md b/platform/docs/models/operations/getwebhookresponse.md index 173e7fea6..8300b5a83 100644 --- a/platform/docs/models/operations/getwebhookresponse.md +++ b/platform/docs/models/operations/getwebhookresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `webhook` | [Optional[shared.Webhook]](../../models/shared/webhook.md) | :heavy_minus_sign: | OK | {"type":"DataConnectionStatusChanged","companyId":"39b73b17-cc2e-429e-915d-71654e9dcd1e","notifiers":{"emails":["info@client.com"],"webhook":"https://webhook.client.com"}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `webhook` | [Optional[shared.Webhook]](../../models/shared/webhook.md) | :heavy_minus_sign: | OK | {
"type": "DataConnectionStatusChanged",
"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e",
"notifiers": {
"emails": [
"info@client.com"
],
"webhook": "https://webhook.client.com"
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/listcompaniesresponse.md b/platform/docs/models/operations/listcompaniesresponse.md index 7abc40ecd..634d146a1 100644 --- a/platform/docs/models/operations/listcompaniesresponse.md +++ b/platform/docs/models/operations/listcompaniesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `companies` | [Optional[shared.Companies]](../../models/shared/companies.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `companies` | [Optional[shared.Companies]](../../models/shared/companies.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/listconnectionsresponse.md b/platform/docs/models/operations/listconnectionsresponse.md index 78b8ddd89..bf806ddc5 100644 --- a/platform/docs/models/operations/listconnectionsresponse.md +++ b/platform/docs/models/operations/listconnectionsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connections` | [Optional[shared.Connections]](../../models/shared/connections.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `connections` | [Optional[shared.Connections]](../../models/shared/connections.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/listintegrationsresponse.md b/platform/docs/models/operations/listintegrationsresponse.md index 37c3b9e4b..0fcdb98bc 100644 --- a/platform/docs/models/operations/listintegrationsresponse.md +++ b/platform/docs/models/operations/listintegrationsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `integrations` | [Optional[shared.Integrations]](../../models/shared/integrations.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `integrations` | [Optional[shared.Integrations]](../../models/shared/integrations.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/listpulloperationsresponse.md b/platform/docs/models/operations/listpulloperationsresponse.md index b51df770a..45665c995 100644 --- a/platform/docs/models/operations/listpulloperationsresponse.md +++ b/platform/docs/models/operations/listpulloperationsresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `pull_operations` | [Optional[shared.PullOperations]](../../models/shared/pulloperations.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `pull_operations` | [Optional[shared.PullOperations]](../../models/shared/pulloperations.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/listrulesresponse.md b/platform/docs/models/operations/listrulesresponse.md index b3b7870ac..8064027d6 100644 --- a/platform/docs/models/operations/listrulesresponse.md +++ b/platform/docs/models/operations/listrulesresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `webhooks` | [Optional[shared.Webhooks]](../../models/shared/webhooks.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `webhooks` | [Optional[shared.Webhooks]](../../models/shared/webhooks.md) | :heavy_minus_sign: | OK | {
"pageNumber": 1,
"pageSize": 10,
"totalResults": 1,
"_links": {
"self": {
"href": "/companies/{id}/data/{dataType}"
},
"current": {
"href": "/companies/{id}/data/{dataType}?page=1\u0026pageSize=10"
}
}
} | \ No newline at end of file diff --git a/platform/docs/models/operations/listwebhookconsumersresponse.md b/platform/docs/models/operations/listwebhookconsumersresponse.md new file mode 100644 index 000000000..aa7d3602d --- /dev/null +++ b/platform/docs/models/operations/listwebhookconsumersresponse.md @@ -0,0 +1,11 @@ +# ListWebhookConsumersResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `webhook_consumers` | [Optional[shared.WebhookConsumers]](../../models/shared/webhookconsumers.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/models/operations/refreshcustomdatatyperesponse.md b/platform/docs/models/operations/refreshcustomdatatyperesponse.md index ff115ff33..4883252c5 100644 --- a/platform/docs/models/operations/refreshcustomdatatyperesponse.md +++ b/platform/docs/models/operations/refreshcustomdatatyperesponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {"id":"97d60846-f07a-4d42-b5a0-0bdcc6ebf56b","companyId":"4645bd78-8988-45bc-ac9e-67ba5df6e4e5","connectionId":"51baa045-4836-4317-a42e-3542e991e581","dataType":"invoices","status":"Initial","statusDescription":"Paused until 2022-10-23T00:00:00.000Z","requested":"2022-11-14T11:18:37.2798351Z","progress":10,"isCompleted":false,"isErrored":false} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {
"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b",
"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5",
"connectionId": "51baa045-4836-4317-a42e-3542e991e581",
"dataType": "invoices",
"status": "Initial",
"statusDescription": "Paused until 2022-10-23T00:00:00.000Z",
"requested": "2022-11-14T11:18:37.2798351Z",
"progress": 10,
"isCompleted": false,
"isErrored": false
} | \ No newline at end of file diff --git a/platform/docs/models/operations/refreshdatatyperesponse.md b/platform/docs/models/operations/refreshdatatyperesponse.md index 7ec003a19..79184cefc 100644 --- a/platform/docs/models/operations/refreshdatatyperesponse.md +++ b/platform/docs/models/operations/refreshdatatyperesponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {"id":"97d60846-f07a-4d42-b5a0-0bdcc6ebf56b","companyId":"4645bd78-8988-45bc-ac9e-67ba5df6e4e5","connectionId":"51baa045-4836-4317-a42e-3542e991e581","dataType":"invoices","status":"Initial","statusDescription":"Paused until 2022-10-23T00:00:00.000Z","requested":"2022-11-14T11:18:37.2798351Z","progress":10,"isCompleted":false,"isErrored":false} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | {
"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b",
"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5",
"connectionId": "51baa045-4836-4317-a42e-3542e991e581",
"dataType": "invoices",
"status": "Initial",
"statusDescription": "Paused until 2022-10-23T00:00:00.000Z",
"requested": "2022-11-14T11:18:37.2798351Z",
"progress": 10,
"isCompleted": false,
"isErrored": false
} | \ No newline at end of file diff --git a/platform/docs/models/operations/unlinkconnectionresponse.md b/platform/docs/models/operations/unlinkconnectionresponse.md index 08eb976b5..927c8dae6 100644 --- a/platform/docs/models/operations/unlinkconnectionresponse.md +++ b/platform/docs/models/operations/unlinkconnectionresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/platform/docs/models/operations/updatecompanyresponse.md b/platform/docs/models/operations/updatecompanyresponse.md index 3005c9e88..13e3f91ea 100644 --- a/platform/docs/models/operations/updatecompanyresponse.md +++ b/platform/docs/models/operations/updatecompanyresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {
"id": "0498e921-9b53-4396-a412-4f2f5983b0a2",
"name": "string",
"platform": "string",
"redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739",
"lastSync": "2022-01-01T12:00:00.000Z",
"created": "2022-01-01T12:00:00.000Z",
"createdByUserName": "string",
"dataConnections": [
{
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
}
],
"groups": [
{
"id": "d7a6c4b4-dc87-45f6-b803-62f466398680"
}
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/updateconnectionauthorizationresponse.md b/platform/docs/models/operations/updateconnectionauthorizationresponse.md index accfd471b..d948afc02 100644 --- a/platform/docs/models/operations/updateconnectionauthorizationresponse.md +++ b/platform/docs/models/operations/updateconnectionauthorizationresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {
"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd",
"integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c",
"integrationKey": "dfxm",
"sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee",
"platformName": "Basiq",
"linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start",
"status": "Linked",
"lastSync": "2022-10-27T10:22:43.6464237Z",
"created": "2022-10-27T09:53:29Z",
"sourceType": "Banking"
} | \ No newline at end of file diff --git a/platform/docs/models/operations/updateprofileresponse.md b/platform/docs/models/operations/updateprofileresponse.md index 915dce5de..e46f148a8 100644 --- a/platform/docs/models/operations/updateprofileresponse.md +++ b/platform/docs/models/operations/updateprofileresponse.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `profile` | [Optional[shared.Profile]](../../models/shared/profile.md) | :heavy_minus_sign: | OK | {"name":"Bob's Burgers","logoUrl":"https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png","iconUrl":"https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico","redirectUrl":"https://bobs-burgers.{countrySuffix}/{companyId}","whiteListUrls":["https://bobs-burgers.com","https://bobs-burgers.co.uk"],"confirmCompanyName":true} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | +| `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_check_mark: | Raw HTTP response; suitable for custom response parsing | | +| `profile` | [Optional[shared.Profile]](../../models/shared/profile.md) | :heavy_minus_sign: | OK | {
"name": "Bob's Burgers",
"logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png",
"iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico",
"redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}",
"whiteListUrls": [
"https://bobs-burgers.com",
"https://bobs-burgers.co.uk"
],
"confirmCompanyName": true
} | \ No newline at end of file diff --git a/platform/docs/models/shared/clientratelimitreachedwebhook.md b/platform/docs/models/shared/clientratelimitreachedwebhook.md index 0e1855429..0f45dde24 100644 --- a/platform/docs/models/shared/clientratelimitreachedwebhook.md +++ b/platform/docs/models/shared/clientratelimitreachedwebhook.md @@ -11,6 +11,6 @@ Webhook request body for a client that has reached their rate limit. | `client_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | `client_name` | *Optional[str]* | :heavy_minus_sign: | Name of your client in Codat. | | `data` | [Optional[shared.ClientRateLimitReachedWebhookData]](../../models/shared/clientratelimitreachedwebhookdata.md) | :heavy_minus_sign: | N/A | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file diff --git a/platform/docs/models/shared/clientratelimitresetwebhook.md b/platform/docs/models/shared/clientratelimitresetwebhook.md index de4352761..a589302d2 100644 --- a/platform/docs/models/shared/clientratelimitresetwebhook.md +++ b/platform/docs/models/shared/clientratelimitresetwebhook.md @@ -11,6 +11,6 @@ Webhook request body for a client that has had their rate limit reset. | `client_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your client in Codat. | | `client_name` | *Optional[str]* | :heavy_minus_sign: | Name of your client in Codat. | | `data` | [Optional[shared.ClientRateLimitResetWebhookData]](../../models/shared/clientratelimitresetwebhookdata.md) | :heavy_minus_sign: | N/A | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file diff --git a/platform/docs/models/shared/clientratelimitresetwebhookdata.md b/platform/docs/models/shared/clientratelimitresetwebhookdata.md index e62b34279..efbbe87f9 100644 --- a/platform/docs/models/shared/clientratelimitresetwebhookdata.md +++ b/platform/docs/models/shared/clientratelimitresetwebhookdata.md @@ -7,5 +7,5 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `daily_quota` | *Optional[int]* | :heavy_minus_sign: | The number of available requests per day. | | | `expires_utc` | *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-23 00:00:00 +0000 UTC | -| `quota_remaining` | *Optional[int]* | :heavy_minus_sign: | Total number of request remaining for your client. | | +| `quota_remaining` | *Optional[int]* | :heavy_minus_sign: | Total number of requests remaining for your client. | | | `reset_reason` | *Optional[str]* | :heavy_minus_sign: | The reason for your rate limit quota being reset. | | \ No newline at end of file diff --git a/platform/docs/models/shared/companies.md b/platform/docs/models/shared/companies.md index c19c46de5..d6b5a8ea8 100644 --- a/platform/docs/models/shared/companies.md +++ b/platform/docs/models/shared/companies.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.Company](../../models/shared/company.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Company](../../models/shared/company.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/connections.md b/platform/docs/models/shared/connections.md index b2e15bef0..1323c74a1 100644 --- a/platform/docs/models/shared/connections.md +++ b/platform/docs/models/shared/connections.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/connectionstatuschangedwebhook.md b/platform/docs/models/shared/connectionstatuschangedwebhook.md index e6a9e821d..42733486e 100644 --- a/platform/docs/models/shared/connectionstatuschangedwebhook.md +++ b/platform/docs/models/shared/connectionstatuschangedwebhook.md @@ -13,6 +13,6 @@ Webhook request body for a company's data connection status changed. | `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `data` | [Optional[shared.ConnectionStatusChangedWebhookData]](../../models/shared/connectionstatuschangedwebhookdata.md) | :heavy_minus_sign: | N/A | | | `data_connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/platform/docs/models/shared/createrule.md b/platform/docs/models/shared/createrule.md index 509a878f9..3361c6e1d 100644 --- a/platform/docs/models/shared/createrule.md +++ b/platform/docs/models/shared/createrule.md @@ -1,6 +1,6 @@ # CreateRule -Create an event notification to a URL or list of email addresses based on the given type or condition. +Create a message that notifies a URL of an event based on its given type or condition. ## Fields diff --git a/platform/docs/models/shared/datasetdatachangedwebhook.md b/platform/docs/models/shared/datasetdatachangedwebhook.md index 4fca5024e..ea26e865b 100644 --- a/platform/docs/models/shared/datasetdatachangedwebhook.md +++ b/platform/docs/models/shared/datasetdatachangedwebhook.md @@ -13,6 +13,6 @@ Webhook request body to notify that a data synchronization has completed. | `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `data` | [Optional[shared.DatasetDataChangedWebhookData]](../../models/shared/datasetdatachangedwebhookdata.md) | :heavy_minus_sign: | N/A | | | `data_connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/platform/docs/models/shared/datasetdatachangedwebhookdata.md b/platform/docs/models/shared/datasetdatachangedwebhookdata.md index 91ce11c02..70b93570e 100644 --- a/platform/docs/models/shared/datasetdatachangedwebhookdata.md +++ b/platform/docs/models/shared/datasetdatachangedwebhookdata.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `dataset_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/platform/docs/models/shared/datasetstatuschangederrorwebhook.md b/platform/docs/models/shared/datasetstatuschangederrorwebhook.md index 214c8d461..78fd9cd4c 100644 --- a/platform/docs/models/shared/datasetstatuschangederrorwebhook.md +++ b/platform/docs/models/shared/datasetstatuschangederrorwebhook.md @@ -13,6 +13,6 @@ Webhook request body to notify that a data synchronization has completed. | `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `data` | [Optional[shared.DatasetStatusChangedErrorWebhookData]](../../models/shared/datasetstatuschangederrorwebhookdata.md) | :heavy_minus_sign: | N/A | | | `data_connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/platform/docs/models/shared/datasetstatuschangederrorwebhookdata.md b/platform/docs/models/shared/datasetstatuschangederrorwebhookdata.md index efc3b4f59..54f2b6dc1 100644 --- a/platform/docs/models/shared/datasetstatuschangederrorwebhookdata.md +++ b/platform/docs/models/shared/datasetstatuschangederrorwebhookdata.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `dataset_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the dataset that completed its sync. | | | `dataset_status` | *Optional[str]* | :heavy_minus_sign: | The current status of the dataset's sync. | | \ No newline at end of file diff --git a/platform/docs/models/shared/datastatus.md b/platform/docs/models/shared/datastatus.md index 3f72f0ed6..6d6e94948 100644 --- a/platform/docs/models/shared/datastatus.md +++ b/platform/docs/models/shared/datastatus.md @@ -8,7 +8,7 @@ Describes the state of data in the Codat cache for a company and data type | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `current_status` | *str* | :heavy_check_mark: | The current status of the dataset in Codat's cache. | | -| `data_type` | [shared.DataTypes](../../models/shared/datatypes.md) | :heavy_check_mark: | Available Data types | invoices | +| `data_type` | [shared.DataTypes](../../models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | | `last_successful_sync` | *str* | :heavy_check_mark: | 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-23 00:00:00 +0000 UTC | | `latest_successful_sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | | `latest_sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | \ No newline at end of file diff --git a/platform/docs/models/shared/datasynccompletedwebhook.md b/platform/docs/models/shared/datasynccompletedwebhook.md index d1c0c249b..f29d68d8e 100644 --- a/platform/docs/models/shared/datasynccompletedwebhook.md +++ b/platform/docs/models/shared/datasynccompletedwebhook.md @@ -13,6 +13,6 @@ Webhook request body to notify the completion of a data sync. | `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `data` | [Optional[shared.DataSyncCompletedWebhookData]](../../models/shared/datasynccompletedwebhookdata.md) | :heavy_minus_sign: | N/A | | | `data_connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/platform/docs/models/shared/datasynccompletedwebhookdata.md b/platform/docs/models/shared/datasynccompletedwebhookdata.md index a837a20ee..3bfd121c1 100644 --- a/platform/docs/models/shared/datasynccompletedwebhookdata.md +++ b/platform/docs/models/shared/datasynccompletedwebhookdata.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `dataset_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/platform/docs/models/shared/datatype.md b/platform/docs/models/shared/datatype.md index 7a5f16172..593192d4b 100644 --- a/platform/docs/models/shared/datatype.md +++ b/platform/docs/models/shared/datatype.md @@ -1,6 +1,6 @@ # DataType -Available Data types +Available data types ## Values diff --git a/platform/docs/models/shared/datatypefeature.md b/platform/docs/models/shared/datatypefeature.md index eeb7b5ac7..f28f56b53 100644 --- a/platform/docs/models/shared/datatypefeature.md +++ b/platform/docs/models/shared/datatypefeature.md @@ -8,4 +8,4 @@ Describes support for a given datatype and associated operations | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `supported_features` | List[[shared.SupportedFeature](../../models/shared/supportedfeature.md)] | :heavy_check_mark: | N/A | | -| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | \ No newline at end of file +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | \ No newline at end of file diff --git a/platform/docs/models/shared/datatypes.md b/platform/docs/models/shared/datatypes.md index ddabcb78f..a102001d1 100644 --- a/platform/docs/models/shared/datatypes.md +++ b/platform/docs/models/shared/datatypes.md @@ -1,6 +1,6 @@ # DataTypes -Available Data types +Available data types ## Values diff --git a/platform/docs/models/shared/integrations.md b/platform/docs/models/shared/integrations.md index 28ecd4e72..47f09dacb 100644 --- a/platform/docs/models/shared/integrations.md +++ b/platform/docs/models/shared/integrations.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.Integration](../../models/shared/integration.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Integration](../../models/shared/integration.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/newcompanysynchronizedwebhook.md b/platform/docs/models/shared/newcompanysynchronizedwebhook.md index 3c573afa9..3c738f624 100644 --- a/platform/docs/models/shared/newcompanysynchronizedwebhook.md +++ b/platform/docs/models/shared/newcompanysynchronizedwebhook.md @@ -13,6 +13,6 @@ Webhook request body to notify that a new company has successfully synchronized | `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `data` | [Optional[shared.NewCompanySynchronizedWebhookData]](../../models/shared/newcompanysynchronizedwebhookdata.md) | :heavy_minus_sign: | N/A | | | `data_connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/platform/docs/models/shared/pulloperations.md b/platform/docs/models/shared/pulloperations.md index 75bc96de7..69df81c54 100644 --- a/platform/docs/models/shared/pulloperations.md +++ b/platform/docs/models/shared/pulloperations.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.PullOperation](../../models/shared/pulloperation.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.PullOperation](../../models/shared/pulloperation.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/pushoperation.md b/platform/docs/models/shared/pushoperation.md index 8ceefbf7f..bcf668d10 100644 --- a/platform/docs/models/shared/pushoperation.md +++ b/platform/docs/models/shared/pushoperation.md @@ -13,7 +13,7 @@ | `status_code` | *int* | :heavy_check_mark: | Push status code. | | | `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | | `completed_on_utc` | *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-23 00:00:00 +0000 UTC | -| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about the error. | | | `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | | ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | diff --git a/platform/docs/models/shared/pushoperationref.md b/platform/docs/models/shared/pushoperationref.md index 44929acb0..7c26e1c4f 100644 --- a/platform/docs/models/shared/pushoperationref.md +++ b/platform/docs/models/shared/pushoperationref.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a push operation. | | \ No newline at end of file diff --git a/platform/docs/models/shared/pushoperations.md b/platform/docs/models/shared/pushoperations.md index fbdf79507..91dea4734 100644 --- a/platform/docs/models/shared/pushoperations.md +++ b/platform/docs/models/shared/pushoperations.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.PushOperation](../../models/shared/pushoperation.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.PushOperation](../../models/shared/pushoperation.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/pushoperationstatuschangedwebhook.md b/platform/docs/models/shared/pushoperationstatuschangedwebhook.md index a16453290..490171d11 100644 --- a/platform/docs/models/shared/pushoperationstatuschangedwebhook.md +++ b/platform/docs/models/shared/pushoperationstatuschangedwebhook.md @@ -13,6 +13,6 @@ Webhook request body for a push operation status change. | `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `data` | [Optional[shared.PushOperationStatusChangedWebhookData]](../../models/shared/pushoperationstatuschangedwebhookdata.md) | :heavy_minus_sign: | N/A | | | `data_connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/platform/docs/models/shared/pushoperationstatuschangedwebhookdata.md b/platform/docs/models/shared/pushoperationstatuschangedwebhookdata.md index 76c5a764c..ca38617d3 100644 --- a/platform/docs/models/shared/pushoperationstatuschangedwebhookdata.md +++ b/platform/docs/models/shared/pushoperationstatuschangedwebhookdata.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `push_operation_key` | *Optional[str]* | :heavy_minus_sign: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | | `status` | [Optional[shared.PushOperationStatus]](../../models/shared/pushoperationstatus.md) | :heavy_minus_sign: | The current status of the push operation. | | \ No newline at end of file diff --git a/platform/docs/models/shared/pushoperationtimedoutwebhook.md b/platform/docs/models/shared/pushoperationtimedoutwebhook.md index 81cc29bf9..fd4a9c891 100644 --- a/platform/docs/models/shared/pushoperationtimedoutwebhook.md +++ b/platform/docs/models/shared/pushoperationtimedoutwebhook.md @@ -13,6 +13,6 @@ Webhook request body notifying that a push push operation has timed out. | `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `data` | [Optional[shared.PushOperationTimedOutWebhookData]](../../models/shared/pushoperationtimedoutwebhookdata.md) | :heavy_minus_sign: | N/A | | | `data_connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | | | `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | | | `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | | \ No newline at end of file diff --git a/platform/docs/models/shared/pushoperationtimedoutwebhookdata.md b/platform/docs/models/shared/pushoperationtimedoutwebhookdata.md index a2bc21302..eb354cf62 100644 --- a/platform/docs/models/shared/pushoperationtimedoutwebhookdata.md +++ b/platform/docs/models/shared/pushoperationtimedoutwebhookdata.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | | `push_operation_guid` | *Optional[str]* | :heavy_minus_sign: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | | `push_operation_key` | *Optional[str]* | :heavy_minus_sign: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | \ No newline at end of file diff --git a/platform/docs/models/shared/schemadatatype.md b/platform/docs/models/shared/schemadatatype.md index 6f6f50a0c..a7b7e6ae3 100644 --- a/platform/docs/models/shared/schemadatatype.md +++ b/platform/docs/models/shared/schemadatatype.md @@ -1,6 +1,6 @@ # SchemaDataType -Available Data types +Available data types ## Values diff --git a/platform/docs/models/shared/security.md b/platform/docs/models/shared/security.md index 83f6bbe38..2b68bd0e7 100644 --- a/platform/docs/models/shared/security.md +++ b/platform/docs/models/shared/security.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `auth_header` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `auth_header` | *str* | :heavy_check_mark: | N/A | Basic BASE_64_ENCODED(API_KEY) | \ No newline at end of file diff --git a/platform/docs/models/shared/syncsetting.md b/platform/docs/models/shared/syncsetting.md index 77c3b3dba..7e1cfb735 100644 --- a/platform/docs/models/shared/syncsetting.md +++ b/platform/docs/models/shared/syncsetting.md @@ -7,7 +7,7 @@ Describes how often, and how much history, should be fetched for the given data | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data_type` | [shared.DataType](../../models/shared/datatype.md) | :heavy_check_mark: | Available Data types | invoices | +| `data_type` | [shared.DataType](../../models/shared/datatype.md) | :heavy_check_mark: | Available data types | invoices | | `fetch_on_first_link` | *bool* | :heavy_check_mark: | Whether this data type should be queued after a company has authorized a connection. | | | `sync_order` | *int* | :heavy_check_mark: | The sync in which data types are queued for a sync. | | | `sync_schedule` | *int* | :heavy_check_mark: | Number of hours after which this data type should be refreshed. | 24 | diff --git a/platform/docs/models/shared/webhookconsumer.md b/platform/docs/models/shared/webhookconsumer.md new file mode 100644 index 000000000..a449de275 --- /dev/null +++ b/platform/docs/models/shared/webhookconsumer.md @@ -0,0 +1,16 @@ +# WebhookConsumer + +A webhook consumer is an HTTP endpoint that developers can configure to subscribe to Codat's supported event types. + +See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `disabled` | *Optional[bool]* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | | +| `event_types` | List[*str*] | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the webhook consumer. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `url` | *Optional[str]* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | | \ No newline at end of file diff --git a/platform/docs/models/shared/webhookconsumerprototype.md b/platform/docs/models/shared/webhookconsumerprototype.md new file mode 100644 index 000000000..f4e0ccd59 --- /dev/null +++ b/platform/docs/models/shared/webhookconsumerprototype.md @@ -0,0 +1,10 @@ +# WebhookConsumerPrototype + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `disabled` | *Optional[bool]* | :heavy_minus_sign: | Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`. | +| `event_types` | List[*str*] | :heavy_minus_sign: | An array of event types the webhook consumer subscribes to. | +| `url` | *Optional[str]* | :heavy_minus_sign: | The URL that will consume webhook events dispatched by Codat. | \ No newline at end of file diff --git a/platform/docs/models/shared/webhookconsumers.md b/platform/docs/models/shared/webhookconsumers.md new file mode 100644 index 000000000..151edc9ec --- /dev/null +++ b/platform/docs/models/shared/webhookconsumers.md @@ -0,0 +1,8 @@ +# WebhookConsumers + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `results` | List[[shared.WebhookConsumer](../../models/shared/webhookconsumer.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/platform/docs/models/shared/webhooknotifier.md b/platform/docs/models/shared/webhooknotifier.md index 8d51b497a..cc81a9724 100644 --- a/platform/docs/models/shared/webhooknotifier.md +++ b/platform/docs/models/shared/webhooknotifier.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `emails` | List[*str*] | :heavy_minus_sign: | N/A | | -| `webhook` | *Optional[str]* | :heavy_minus_sign: | The URI the webhook service will POST events. | https://webhook.client.com | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `emails` | List[*str*] | :heavy_minus_sign: | N/A | | +| `webhook` | *Optional[str]* | :heavy_minus_sign: | The URI the webhook service will use to post events. | https://webhook.client.com | \ No newline at end of file diff --git a/platform/docs/models/shared/webhooks.md b/platform/docs/models/shared/webhooks.md index c473b0026..a13278415 100644 --- a/platform/docs/models/shared/webhooks.md +++ b/platform/docs/models/shared/webhooks.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.Webhook](../../models/shared/webhook.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Webhook](../../models/shared/webhook.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/sdks/companies/README.md b/platform/docs/sdks/companies/README.md index 166806cc9..1a003bb4b 100644 --- a/platform/docs/sdks/companies/README.md +++ b/platform/docs/sdks/companies/README.md @@ -30,7 +30,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -80,7 +80,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -129,7 +129,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -177,7 +177,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -228,7 +228,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/connections/README.md b/platform/docs/sdks/connections/README.md index 83038f9d0..318a1f1a1 100644 --- a/platform/docs/sdks/connections/README.md +++ b/platform/docs/sdks/connections/README.md @@ -28,7 +28,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -74,7 +74,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -120,7 +120,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -166,7 +166,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -214,7 +214,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -260,7 +260,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/customdatatype/README.md b/platform/docs/sdks/customdatatype/README.md index 98ca7fc47..ede8c01d4 100644 --- a/platform/docs/sdks/customdatatype/README.md +++ b/platform/docs/sdks/customdatatype/README.md @@ -34,7 +34,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -100,7 +100,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -148,7 +148,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -197,7 +197,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/groups/README.md b/platform/docs/sdks/groups/README.md index 52c56bc60..fb3a630d9 100644 --- a/platform/docs/sdks/groups/README.md +++ b/platform/docs/sdks/groups/README.md @@ -26,7 +26,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -78,7 +78,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -125,7 +125,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -168,7 +168,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/integrations/README.md b/platform/docs/sdks/integrations/README.md index f591795a1..d4c012012 100644 --- a/platform/docs/sdks/integrations/README.md +++ b/platform/docs/sdks/integrations/README.md @@ -23,7 +23,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -68,7 +68,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -113,7 +113,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/pushdata/README.md b/platform/docs/sdks/pushdata/README.md index d6bd5570d..26df6ae2d 100644 --- a/platform/docs/sdks/pushdata/README.md +++ b/platform/docs/sdks/pushdata/README.md @@ -32,7 +32,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -79,7 +79,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -125,7 +125,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/refreshdata/README.md b/platform/docs/sdks/refreshdata/README.md index 700e52fb8..58e8fabf1 100644 --- a/platform/docs/sdks/refreshdata/README.md +++ b/platform/docs/sdks/refreshdata/README.md @@ -29,7 +29,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -76,7 +76,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -122,7 +122,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -167,7 +167,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -213,7 +213,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/settings/README.md b/platform/docs/sdks/settings/README.md index 71a069c13..115c2c1d1 100644 --- a/platform/docs/sdks/settings/README.md +++ b/platform/docs/sdks/settings/README.md @@ -37,7 +37,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -91,7 +91,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -136,7 +136,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -177,7 +177,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -222,7 +222,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -263,7 +263,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -318,7 +318,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/supplementaldata/README.md b/platform/docs/sdks/supplementaldata/README.md index 822c6c76f..24b81cfcc 100644 --- a/platform/docs/sdks/supplementaldata/README.md +++ b/platform/docs/sdks/supplementaldata/README.md @@ -27,7 +27,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -88,7 +88,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) diff --git a/platform/docs/sdks/webhooks/README.md b/platform/docs/sdks/webhooks/README.md index 2684faafc..77bff7e3d 100644 --- a/platform/docs/sdks/webhooks/README.md +++ b/platform/docs/sdks/webhooks/README.md @@ -7,14 +7,19 @@ Manage webhooks, rules, and events. ### Available Operations -* [create](#create) - Create webhook -* [get](#get) - Get webhook -* [list](#list) - List webhooks +* [~~create~~](#create) - Create webhook :warning: **Deprecated** +* [create_consumer](#create_consumer) - Create webhook consumer +* [delete_consumer](#delete_consumer) - Delete webhook consumer +* [~~get~~](#get) - Get webhook :warning: **Deprecated** +* [~~list~~](#list) - List webhooks :warning: **Deprecated** +* [list_consumers](#list_consumers) - List webhook consumers -## create +## ~~create~~ Create a new webhook configuration +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + ### Example Usage ```python @@ -23,7 +28,7 @@ from codatplatform.models import shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -63,10 +68,104 @@ if res.webhook is not None: | errors.ErrorMessage | 401,402,403,429,500,503 | application/json | | errors.SDKError | 4x-5xx | */* | -## get +## create_consumer + +Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you. + +[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + +### Example Usage + +```python +import codatplatform +from codatplatform.models import shared + +s = codatplatform.CodatPlatform( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = shared.WebhookConsumerPrototype() + +res = s.webhooks.create_consumer(req) + +if res.webhook_consumer is not None: + # handle response + pass +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [shared.WebhookConsumerPrototype](../../models/shared/webhookconsumerprototype.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.CreateWebhookConsumerResponse](../../models/operations/createwebhookconsumerresponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | +| errors.SDKError | 4x-5xx | */* | + +## delete_consumer + +Use the *Delete webhook consumer* endpoint to delete an existing webhoook consumer, providing its valid `id` as a parameter. + +[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + +### Example Usage + +```python +import codatplatform +from codatplatform.models import operations, shared + +s = codatplatform.CodatPlatform( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.DeleteWebhookConsumerRequest( + webhook_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.webhooks.delete_consumer(req) + +if res.status_code == 200: + # handle response + pass +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `request` | [operations.DeleteWebhookConsumerRequest](../../models/operations/deletewebhookconsumerrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.DeleteWebhookConsumerResponse](../../models/operations/deletewebhookconsumerresponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------- | --------------------------- | --------------------------- | +| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | +| errors.SDKError | 4x-5xx | */* | + +## ~~get~~ Get a single webhook +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + ### Example Usage ```python @@ -75,7 +174,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -108,10 +207,12 @@ if res.webhook is not None: | errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | | errors.SDKError | 4x-5xx | */* | -## list +## ~~list~~ List webhooks that you are subscribed to. +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + ### Example Usage ```python @@ -120,7 +221,7 @@ from codatplatform.models import operations, shared s = codatplatform.CodatPlatform( security=shared.Security( - auth_header="", + auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) @@ -154,3 +255,46 @@ if res.webhooks is not None: | ------------------------------- | ------------------------------- | ------------------------------- | | errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | | errors.SDKError | 4x-5xx | */* | + +## list_consumers + +Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. + +[Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + +### Example Usage + +```python +import codatplatform +from codatplatform.models import shared + +s = codatplatform.CodatPlatform( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + + +res = s.webhooks.list_consumers() + +if res.webhook_consumers is not None: + # handle response + pass +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + + +### Response + +**[operations.ListWebhookConsumersResponse](../../models/operations/listwebhookconsumersresponse.md)** +### Errors + +| Error Object | Status Code | Content Type | +| --------------------------- | --------------------------- | --------------------------- | +| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | +| errors.SDKError | 4x-5xx | */* | diff --git a/platform/gen.yaml b/platform/gen.yaml index 8d67052a7..e67abde1f 100644 --- a/platform/gen.yaml +++ b/platform/gen.yaml @@ -7,9 +7,15 @@ generation: nameResolutionDec2023: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false + auth: + oAuth2ClientCredentialsEnabled: false telemetryEnabled: true python: - version: 3.3.0 + version: 3.4.0 + additionalDependencies: + dependencies: {} + extraDependencies: + dev: {} author: Codat clientServerStatusCodesAsErrors: true description: Manage the building blocks of Codat, including companies, connections, and more. diff --git a/platform/pylintrc b/platform/pylintrc index cebe76d49..0690edafd 100644 --- a/platform/pylintrc +++ b/platform/pylintrc @@ -180,6 +180,7 @@ good-names=i, ex, Run, _, + e, id # Good variable names regexes, separated by a comma. If names match any regex, diff --git a/platform/setup.py b/platform/setup.py index 2002c6980..7b798d0d5 100644 --- a/platform/setup.py +++ b/platform/setup.py @@ -10,7 +10,7 @@ setuptools.setup( name="codat-platform", - version="3.3.0", + version="3.4.0", author="Codat", description="Manage the building blocks of Codat, including companies, connections, and more.", long_description=long_description, @@ -19,9 +19,9 @@ install_requires=[ "certifi>=2023.7.22", "charset-normalizer>=3.2.0", - "dataclasses-json-speakeasy>=0.5.11", + "dataclasses-json>=0.6.4", "idna>=3.4", - "jsonpath-python>=1.0.6 ", + "jsonpath-python>=1.0.6", "marshmallow>=3.19.0", "mypy-extensions>=1.0.0", "packaging>=23.1", @@ -33,7 +33,9 @@ "urllib3>=1.26.18", ], extras_require={ - "dev":["pylint==2.16.2"] + "dev": [ + "pylint==2.16.2", + ], }, package_dir={'': 'src'}, python_requires='>=3.8', diff --git a/platform/src/codatplatform/_hooks/__init__.py b/platform/src/codatplatform/_hooks/__init__.py new file mode 100644 index 000000000..5fd985a8a --- /dev/null +++ b/platform/src/codatplatform/_hooks/__init__.py @@ -0,0 +1,5 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from .sdkhooks import * +from .types import * +from .registration import * diff --git a/platform/src/codatplatform/_hooks/registration.py b/platform/src/codatplatform/_hooks/registration.py new file mode 100644 index 000000000..1db6a5293 --- /dev/null +++ b/platform/src/codatplatform/_hooks/registration.py @@ -0,0 +1,13 @@ +from .types import Hooks + + +# This file is only ever generated once on the first generation and then is free to be modified. +# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them +# in this file or in separate files in the hooks folder. + + +def init_hooks(hooks: Hooks): + # pylint: disable=unused-argument + """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook + with an instance of a hook that implements that specific Hook interface + Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance""" diff --git a/platform/src/codatplatform/_hooks/sdkhooks.py b/platform/src/codatplatform/_hooks/sdkhooks.py new file mode 100644 index 000000000..a9ba878fa --- /dev/null +++ b/platform/src/codatplatform/_hooks/sdkhooks.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +import requests +from .types import SDKInitHook, BeforeRequestContext, BeforeRequestHook, AfterSuccessContext, AfterSuccessHook, AfterErrorContext, AfterErrorHook, Hooks +from .registration import init_hooks +from typing import List, Optional, Tuple, Union + + +class SDKHooks(Hooks): + sdk_init_hooks: List[SDKInitHook] = [] + before_request_hooks: List[BeforeRequestHook] = [] + after_success_hooks: List[AfterSuccessHook] = [] + after_error_hooks: List[AfterErrorHook] = [] + + def __init__(self): + init_hooks(self) + + def register_sdk_init_hook(self, hook: SDKInitHook) -> None: + self.sdk_init_hooks.append(hook) + + def register_before_request_hook(self, hook: BeforeRequestHook) -> None: + self.before_request_hooks.append(hook) + + def register_after_success_hook(self, hook: AfterSuccessHook) -> None: + self.after_success_hooks.append(hook) + + def register_after_error_hook(self, hook: AfterErrorHook) -> None: + self.after_error_hooks.append(hook) + + def sdk_init(self, base_url: str, client: requests.Session) -> Tuple[str, requests.Session]: + for hook in self.sdk_init_hooks: + base_url, client = hook.sdk_init(base_url, client) + return base_url, client + + def before_request(self, hook_ctx: BeforeRequestContext, request: requests.PreparedRequest) -> Union[requests.PreparedRequest, Exception]: + for hook in self.before_request_hooks: + request = hook.before_request(hook_ctx, request) + if isinstance(request, Exception): + raise request + + return request + + def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Response) -> requests.Response: + for hook in self.after_success_hooks: + response = hook.after_success(hook_ctx, response) + if isinstance(response, Exception): + raise response + return response + + def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests.Response], error: Optional[Exception]) -> Tuple[Optional[requests.Response], Optional[Exception]]: + for hook in self.after_error_hooks: + result = hook.after_error(hook_ctx, response, error) + if isinstance(result, Exception): + raise result + response, error = result + return response, error diff --git a/platform/src/codatplatform/_hooks/types.py b/platform/src/codatplatform/_hooks/types.py new file mode 100644 index 000000000..d2fa8629f --- /dev/null +++ b/platform/src/codatplatform/_hooks/types.py @@ -0,0 +1,70 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +import requests as requests_http +from abc import ABC, abstractmethod +from typing import Any, Callable, List, Optional, Tuple, Union + + +class HookContext: + operation_id: str + oauth2_scopes: Optional[List[str]] = None + security_source: Optional[Union[Any, Callable[[], Any]]] = None + + def __init__(self, operation_id: str, oauth2_scopes: Optional[List[str]], security_source: Optional[Union[Any, Callable[[], Any]]]): + self.operation_id = operation_id + self.oauth2_scopes = oauth2_scopes + self.security_source = security_source + + +class BeforeRequestContext(HookContext): + pass + + +class AfterSuccessContext(HookContext): + pass + + +class AfterErrorContext(HookContext): + pass + + +class SDKInitHook(ABC): + @abstractmethod + def sdk_init(self, base_url: str, client: requests_http.Session) -> Tuple[str, requests_http.Session]: + pass + + +class BeforeRequestHook(ABC): + @abstractmethod + def before_request(self, hook_ctx: BeforeRequestContext, request: requests_http.PreparedRequest) -> Union[requests_http.PreparedRequest, Exception]: + pass + + +class AfterSuccessHook(ABC): + @abstractmethod + def after_success(self, hook_ctx: AfterSuccessContext, response: requests_http.Response) -> Union[requests_http.PreparedRequest, Exception]: + pass + + +class AfterErrorHook(ABC): + @abstractmethod + def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests_http.Response], error: Optional[Exception]) -> Union[Tuple[Optional[requests_http.PreparedRequest], Optional[Exception]], Exception]: + pass + + +class Hooks(ABC): + @abstractmethod + def register_sdk_init_hook(self, hook: SDKInitHook): + pass + + @abstractmethod + def register_before_request_hook(self, hook: BeforeRequestHook): + pass + + @abstractmethod + def register_after_success_hook(self, hook: AfterSuccessHook): + pass + + @abstractmethod + def register_after_error_hook(self, hook: AfterErrorHook): + pass diff --git a/platform/src/codatplatform/companies.py b/platform/src/codatplatform/companies.py index 3c1e7ce8d..4a69d60c8 100644 --- a/platform/src/codatplatform/companies.py +++ b/platform/src/codatplatform/companies.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -23,12 +25,13 @@ def create(self, request: Optional[shared.CompanyRequestBody], retries: Optional If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. """ + hook_ctx = HookContext(operation_id='create-company', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/companies' headers = {} req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CompanyRequestBody], "request", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -38,6 +41,7 @@ def create(self, request: Optional[shared.CompanyRequestBody], retries: Optional else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -47,13 +51,34 @@ def create(self, request: Optional[shared.CompanyRequestBody], retries: Optional retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.CreateCompanyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -85,6 +110,7 @@ def delete(self, request: operations.DeleteCompanyRequest, retries: Optional[uti A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. """ + hook_ctx = HookContext(operation_id='delete-company', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.DeleteCompanyRequest, base_url, '/companies/{companyId}', request) @@ -97,6 +123,7 @@ def delete(self, request: operations.DeleteCompanyRequest, retries: Optional[uti else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -106,13 +133,34 @@ def delete(self, request: operations.DeleteCompanyRequest, retries: Optional[uti retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('DELETE', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('DELETE', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.DeleteCompanyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -140,6 +188,7 @@ def get(self, request: operations.GetCompanyRequest, retries: Optional[utils.Ret A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. """ + hook_ctx = HookContext(operation_id='get-company', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetCompanyRequest, base_url, '/companies/{companyId}', request) @@ -152,6 +201,7 @@ def get(self, request: operations.GetCompanyRequest, retries: Optional[utils.Ret else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -161,13 +211,34 @@ def get(self, request: operations.GetCompanyRequest, retries: Optional[utils.Ret retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetCompanyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -199,6 +270,7 @@ def list(self, request: operations.ListCompaniesRequest, retries: Optional[utils A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. """ + hook_ctx = HookContext(operation_id='list-companies', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/companies' @@ -212,6 +284,7 @@ def list(self, request: operations.ListCompaniesRequest, retries: Optional[utils else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -221,13 +294,34 @@ def list(self, request: operations.ListCompaniesRequest, retries: Optional[utils 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) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, params=query_params, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ListCompaniesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -260,12 +354,13 @@ def update(self, request: operations.UpdateCompanyRequest, retries: Optional[uti A [company](https://docs.codat.io/platform-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/platform-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. """ + hook_ctx = HookContext(operation_id='update-company', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.UpdateCompanyRequest, base_url, '/companies/{companyId}', request) headers = {} req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateCompanyRequest, "company_request_body", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -275,6 +370,7 @@ def update(self, request: operations.UpdateCompanyRequest, retries: Optional[uti else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -284,13 +380,34 @@ def update(self, request: operations.UpdateCompanyRequest, retries: Optional[uti retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('PUT', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('PUT', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.UpdateCompanyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/connections.py b/platform/src/codatplatform/connections.py index 9abe04bb1..b747f5f40 100644 --- a/platform/src/codatplatform/connections.py +++ b/platform/src/codatplatform/connections.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -20,12 +22,13 @@ def create(self, request: operations.CreateConnectionRequest, retries: Optional[ Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. """ + hook_ctx = HookContext(operation_id='create-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.CreateConnectionRequest, base_url, '/companies/{companyId}/connections', request) headers = {} req_content_type, data, form = utils.serialize_request_body(request, operations.CreateConnectionRequest, "request_body", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -35,6 +38,7 @@ def create(self, request: operations.CreateConnectionRequest, retries: Optional[ else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -44,13 +48,34 @@ def create(self, request: operations.CreateConnectionRequest, retries: Optional[ retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.CreateConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -80,6 +105,7 @@ def delete(self, request: operations.DeleteConnectionRequest, retries: Optional[ Revoke and remove a connection from a company. This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. """ + hook_ctx = HookContext(operation_id='delete-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.DeleteConnectionRequest, base_url, '/companies/{companyId}/connections/{connectionId}', request) @@ -92,6 +118,7 @@ def delete(self, request: operations.DeleteConnectionRequest, retries: Optional[ else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -101,13 +128,34 @@ def delete(self, request: operations.DeleteConnectionRequest, retries: Optional[ retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('DELETE', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('DELETE', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.DeleteConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -132,6 +180,7 @@ def get(self, request: operations.GetConnectionRequest, retries: Optional[utils. r"""Get connection Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. """ + hook_ctx = HookContext(operation_id='get-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetConnectionRequest, base_url, '/companies/{companyId}/connections/{connectionId}', request) @@ -144,6 +193,7 @@ def get(self, request: operations.GetConnectionRequest, retries: Optional[utils. else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -153,13 +203,34 @@ def get(self, request: operations.GetConnectionRequest, retries: Optional[utils. retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -188,6 +259,7 @@ def list(self, request: operations.ListConnectionsRequest, retries: Optional[uti r"""List connections List the connections for a company. """ + hook_ctx = HookContext(operation_id='list-connections', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.ListConnectionsRequest, base_url, '/companies/{companyId}/connections', request) @@ -201,6 +273,7 @@ def list(self, request: operations.ListConnectionsRequest, retries: Optional[uti else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -210,13 +283,34 @@ def list(self, request: operations.ListConnectionsRequest, retries: Optional[uti 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) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, params=query_params, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ListConnectionsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -245,12 +339,13 @@ def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[ r"""Unlink connection This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. """ + hook_ctx = HookContext(operation_id='unlink-connection', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.UnlinkConnectionRequest, base_url, '/companies/{companyId}/connections/{connectionId}', request) headers = {} req_content_type, data, form = utils.serialize_request_body(request, operations.UnlinkConnectionRequest, "update_connection_status", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -260,6 +355,7 @@ def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[ else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -269,13 +365,34 @@ def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[ retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('PATCH', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('PATCH', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.UnlinkConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -304,12 +421,13 @@ def update_authorization(self, request: operations.UpdateConnectionAuthorization r"""Update authorization Update data connection's authorization. """ + hook_ctx = HookContext(operation_id='update-connection-authorization', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.UpdateConnectionAuthorizationRequest, base_url, '/companies/{companyId}/connections/{connectionId}/authorization', request) headers = {} req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateConnectionAuthorizationRequest, "request_body", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -319,6 +437,7 @@ def update_authorization(self, request: operations.UpdateConnectionAuthorization else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -328,13 +447,34 @@ def update_authorization(self, request: operations.UpdateConnectionAuthorization retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('PUT', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('PUT', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.UpdateConnectionAuthorizationResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/custom_data_type.py b/platform/src/codatplatform/custom_data_type.py index 58945f8d6..737669dd9 100644 --- a/platform/src/codatplatform/custom_data_type.py +++ b/platform/src/codatplatform/custom_data_type.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -28,12 +30,13 @@ def configure(self, request: operations.ConfigureCustomDataTypeRequest, retries: - Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. """ + hook_ctx = HookContext(operation_id='configure-custom-data-type', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.ConfigureCustomDataTypeRequest, base_url, '/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}', request) headers = {} req_content_type, data, form = utils.serialize_request_body(request, operations.ConfigureCustomDataTypeRequest, "custom_data_type_configuration", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -43,6 +46,7 @@ def configure(self, request: operations.ConfigureCustomDataTypeRequest, retries: else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -52,13 +56,34 @@ def configure(self, request: operations.ConfigureCustomDataTypeRequest, retries: retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('PUT', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('PUT', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ConfigureCustomDataTypeResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -89,6 +114,7 @@ def get_configuration(self, request: operations.GetCustomDataTypeConfigurationRe A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model. """ + hook_ctx = HookContext(operation_id='get-custom-data-type-configuration', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetCustomDataTypeConfigurationRequest, base_url, '/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}', request) @@ -101,6 +127,7 @@ def get_configuration(self, request: operations.GetCustomDataTypeConfigurationRe else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -110,13 +137,34 @@ def get_configuration(self, request: operations.GetCustomDataTypeConfigurationRe retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetCustomDataTypeConfigurationResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -147,6 +195,7 @@ def list(self, request: operations.ListCustomDataTypeRecordsRequest, retries: Op A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an additional data type you can create that is not included in Codat's standardized data model.s endpoint returns a paginated list of records whose schema is defined [Configure custom data type](https://docs.codat.io/platform-api#/operations/configure-custom-data-type) """ + hook_ctx = HookContext(operation_id='list-custom-data-type-records', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.ListCustomDataTypeRecordsRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/custom/{customDataIdentifier}', request) @@ -160,6 +209,7 @@ def list(self, request: operations.ListCustomDataTypeRecordsRequest, retries: Op else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -169,13 +219,34 @@ def list(self, request: operations.ListCustomDataTypeRecordsRequest, retries: Op 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) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, params=query_params, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','404','429','451','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ListCustomDataTypeRecordsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -204,6 +275,7 @@ def refresh(self, request: operations.RefreshCustomDataTypeRequest, retries: Opt r"""Refresh custom data type The *Refresh custom data type* endpoint refreshes the specified custom data type for a given company. This is an asynchronous operation that will sync updated data from the linked integration into Codat for you to view. """ + hook_ctx = HookContext(operation_id='refresh-custom-data-type', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.RefreshCustomDataTypeRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/queue/custom/{customDataIdentifier}', request) @@ -216,6 +288,7 @@ def refresh(self, request: operations.RefreshCustomDataTypeRequest, retries: Opt else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -225,13 +298,34 @@ def refresh(self, request: operations.RefreshCustomDataTypeRequest, retries: Opt retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','451','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.RefreshCustomDataTypeResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/groups.py b/platform/src/codatplatform/groups.py index 7f6cd8823..c697a8555 100644 --- a/platform/src/codatplatform/groups.py +++ b/platform/src/codatplatform/groups.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -20,12 +22,13 @@ def add_company(self, request: operations.AddCompanyToGroupRequest, retries: Opt [Groups](https://docs.codat.io/platform-api#/schemas/Group) define a set of companies that are organized based on a chosen characteristic and can be managed in the same way. """ + hook_ctx = HookContext(operation_id='add-company-to-group', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.AddCompanyToGroupRequest, base_url, '/companies/{companyId}/groups', request) headers = {} req_content_type, data, form = utils.serialize_request_body(request, operations.AddCompanyToGroupRequest, "company_group_assignment", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -35,6 +38,7 @@ def add_company(self, request: operations.AddCompanyToGroupRequest, retries: Opt else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -44,13 +48,34 @@ def add_company(self, request: operations.AddCompanyToGroupRequest, retries: Opt retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('PATCH', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('PATCH', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.AddCompanyToGroupResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -86,12 +111,13 @@ def create(self, request: Optional[shared.GroupPrototype], retries: Optional[uti * The maximum length for the group name is 50 characters. * It's possible to create up to 20 groups per client. """ + hook_ctx = HookContext(operation_id='create-group', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/groups' headers = {} req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.GroupPrototype], "request", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -101,6 +127,7 @@ def create(self, request: Optional[shared.GroupPrototype], retries: Optional[uti else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -110,13 +137,34 @@ def create(self, request: Optional[shared.GroupPrototype], retries: Optional[uti retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','409','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.CreateGroupResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -147,6 +195,7 @@ def list(self, retries: Optional[utils.RetryConfig] = None) -> operations.ListGr [Groups](https://docs.codat.io/platform-api#/schemas/Group) define a set of companies that are organized based on a chosen characteristic and can be managed in the same way. """ + hook_ctx = HookContext(operation_id='list-groups', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/groups' @@ -159,6 +208,7 @@ def list(self, retries: Optional[utils.RetryConfig] = None) -> operations.ListGr else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -168,13 +218,34 @@ def list(self, retries: Optional[utils.RetryConfig] = None) -> operations.ListGr retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ListGroupsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -205,6 +276,7 @@ def remove_company(self, request: operations.RemoveCompanyFromGroupRequest, retr [Groups](https://docs.codat.io/platform-api#/schemas/Group) define a set of companies that are organized based on a chosen characteristic and can be managed in the same way. """ + hook_ctx = HookContext(operation_id='remove-company-from-group', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.RemoveCompanyFromGroupRequest, base_url, '/companies/{companyId}/groups/{groupId}', request) @@ -217,6 +289,7 @@ def remove_company(self, request: operations.RemoveCompanyFromGroupRequest, retr else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -226,13 +299,34 @@ def remove_company(self, request: operations.RemoveCompanyFromGroupRequest, retr retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('DELETE', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('DELETE', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.RemoveCompanyFromGroupResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/integrations.py b/platform/src/codatplatform/integrations.py index 356928159..5139840c7 100644 --- a/platform/src/codatplatform/integrations.py +++ b/platform/src/codatplatform/integrations.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -18,6 +20,7 @@ def get(self, request: operations.GetIntegrationRequest, retries: Optional[utils r"""Get integration Get single integration, by platformKey """ + hook_ctx = HookContext(operation_id='get-integration', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetIntegrationRequest, base_url, '/integrations/{platformKey}', request) @@ -30,6 +33,7 @@ def get(self, request: operations.GetIntegrationRequest, retries: Optional[utils else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -39,13 +43,34 @@ def get(self, request: operations.GetIntegrationRequest, retries: Optional[utils retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetIntegrationResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -74,6 +99,7 @@ def get_branding(self, request: operations.GetIntegrationsBrandingRequest, retri r"""Get branding Get branding for platform. """ + hook_ctx = HookContext(operation_id='get-integrations-branding', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetIntegrationsBrandingRequest, base_url, '/integrations/{platformKey}/branding', request) @@ -86,6 +112,7 @@ def get_branding(self, request: operations.GetIntegrationsBrandingRequest, retri else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -95,13 +122,34 @@ def get_branding(self, request: operations.GetIntegrationsBrandingRequest, retri retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetIntegrationsBrandingResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -130,6 +178,7 @@ def list(self, request: operations.ListIntegrationsRequest, retries: Optional[ut r"""List integrations List your available integrations """ + hook_ctx = HookContext(operation_id='list-integrations', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/integrations' @@ -143,6 +192,7 @@ def list(self, request: operations.ListIntegrationsRequest, retries: Optional[ut else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -152,13 +202,34 @@ def list(self, request: operations.ListIntegrationsRequest, retries: Optional[ut 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) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, params=query_params, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ListIntegrationsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/models/operations/__init__.py b/platform/src/codatplatform/models/operations/__init__.py index 191122c55..09c7bba09 100644 --- a/platform/src/codatplatform/models/operations/__init__.py +++ b/platform/src/codatplatform/models/operations/__init__.py @@ -8,9 +8,11 @@ from .create_connection import * from .create_group import * from .create_rule import * +from .create_webhook_consumer import * from .delete_api_key import * from .delete_company import * from .delete_connection import * +from .delete_webhook_consumer import * from .get_company import * from .get_company_data_status import * from .get_company_push_history import * @@ -33,6 +35,7 @@ from .list_integrations import * from .list_pull_operations import * from .list_rules import * +from .list_webhook_consumers import * from .refresh_company_data import * from .refresh_custom_data_type import * from .refresh_data_type import * @@ -43,4 +46,4 @@ from .update_profile import * from .update_profile_syncsettings import * -__all__ = ["AddCompanyToGroupRequest","AddCompanyToGroupResponse","ConfigureCustomDataTypeRequest","ConfigureCustomDataTypeResponse","ConfigureSupplementalDataRequest","ConfigureSupplementalDataResponse","CreateAPIKeyResponse","CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","CreateGroupResponse","CreateRuleResponse","DataType","DeleteAPIKeyRequest","DeleteAPIKeyResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","GetCompanyDataStatusRequest","GetCompanyDataStatusResponse","GetCompanyPushHistoryRequest","GetCompanyPushHistoryResponse","GetCompanyRequest","GetCompanyResponse","GetConnectionRequest","GetConnectionResponse","GetCreateUpdateModelOptionsByDataTypeRequest","GetCreateUpdateModelOptionsByDataTypeResponse","GetCustomDataTypeConfigurationRequest","GetCustomDataTypeConfigurationResponse","GetIntegrationRequest","GetIntegrationResponse","GetIntegrationsBrandingRequest","GetIntegrationsBrandingResponse","GetProfileResponse","GetProfileSyncSettingsResponse","GetPullOperationRequest","GetPullOperationResponse","GetPushOperationRequest","GetPushOperationResponse","GetSupplementalDataConfigurationRequest","GetSupplementalDataConfigurationResponse","GetWebhookRequest","GetWebhookResponse","ListAPIKeysResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","ListCustomDataTypeRecordsRequest","ListCustomDataTypeRecordsResponse","ListGroupsResponse","ListIntegrationsRequest","ListIntegrationsResponse","ListPullOperationsRequest","ListPullOperationsResponse","ListRulesRequest","ListRulesResponse","PathParamDataType","RefreshCompanyDataRequest","RefreshCompanyDataResponse","RefreshCustomDataTypeRequest","RefreshCustomDataTypeResponse","RefreshDataTypeRequest","RefreshDataTypeResponse","RemoveCompanyFromGroupRequest","RemoveCompanyFromGroupResponse","UnlinkConnectionRequest","UnlinkConnectionResponse","UpdateCompanyRequest","UpdateCompanyResponse","UpdateConnectionAuthorizationRequest","UpdateConnectionAuthorizationResponse","UpdateProfileResponse","UpdateProfileSyncSettingsRequestBody","UpdateProfileSyncSettingsResponse"] +__all__ = ["AddCompanyToGroupRequest","AddCompanyToGroupResponse","ConfigureCustomDataTypeRequest","ConfigureCustomDataTypeResponse","ConfigureSupplementalDataRequest","ConfigureSupplementalDataResponse","CreateAPIKeyResponse","CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","CreateGroupResponse","CreateRuleResponse","CreateWebhookConsumerResponse","DataType","DeleteAPIKeyRequest","DeleteAPIKeyResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","DeleteWebhookConsumerRequest","DeleteWebhookConsumerResponse","GetCompanyDataStatusRequest","GetCompanyDataStatusResponse","GetCompanyPushHistoryRequest","GetCompanyPushHistoryResponse","GetCompanyRequest","GetCompanyResponse","GetConnectionRequest","GetConnectionResponse","GetCreateUpdateModelOptionsByDataTypeRequest","GetCreateUpdateModelOptionsByDataTypeResponse","GetCustomDataTypeConfigurationRequest","GetCustomDataTypeConfigurationResponse","GetIntegrationRequest","GetIntegrationResponse","GetIntegrationsBrandingRequest","GetIntegrationsBrandingResponse","GetProfileResponse","GetProfileSyncSettingsResponse","GetPullOperationRequest","GetPullOperationResponse","GetPushOperationRequest","GetPushOperationResponse","GetSupplementalDataConfigurationRequest","GetSupplementalDataConfigurationResponse","GetWebhookRequest","GetWebhookResponse","ListAPIKeysResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","ListCustomDataTypeRecordsRequest","ListCustomDataTypeRecordsResponse","ListGroupsResponse","ListIntegrationsRequest","ListIntegrationsResponse","ListPullOperationsRequest","ListPullOperationsResponse","ListRulesRequest","ListRulesResponse","ListWebhookConsumersResponse","PathParamDataType","RefreshCompanyDataRequest","RefreshCompanyDataResponse","RefreshCustomDataTypeRequest","RefreshCustomDataTypeResponse","RefreshDataTypeRequest","RefreshDataTypeResponse","RemoveCompanyFromGroupRequest","RemoveCompanyFromGroupResponse","UnlinkConnectionRequest","UnlinkConnectionResponse","UpdateCompanyRequest","UpdateCompanyResponse","UpdateConnectionAuthorizationRequest","UpdateConnectionAuthorizationResponse","UpdateProfileResponse","UpdateProfileSyncSettingsRequestBody","UpdateProfileSyncSettingsResponse"] diff --git a/platform/src/codatplatform/models/operations/configure_custom_data_type.py b/platform/src/codatplatform/models/operations/configure_custom_data_type.py index 65b0390dc..839fb1649 100644 --- a/platform/src/codatplatform/models/operations/configure_custom_data_type.py +++ b/platform/src/codatplatform/models/operations/configure_custom_data_type.py @@ -12,7 +12,7 @@ class ConfigureCustomDataTypeRequest: custom_data_identifier: str = dataclasses.field(metadata={'path_param': { 'field_name': 'customDataIdentifier', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a custom data type.""" platform_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'platformKey', 'style': 'simple', 'explode': False }}) - r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + r"""A unique 4-letter key to represent a platform in each integration.""" custom_data_type_configuration: Optional[shared_customdatatypeconfiguration.CustomDataTypeConfiguration] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) r"""Custom data type configuration for the specified platform.""" diff --git a/platform/src/codatplatform/models/operations/configure_supplemental_data.py b/platform/src/codatplatform/models/operations/configure_supplemental_data.py index 2d4bec2c1..119c362f7 100644 --- a/platform/src/codatplatform/models/operations/configure_supplemental_data.py +++ b/platform/src/codatplatform/models/operations/configure_supplemental_data.py @@ -37,7 +37,7 @@ class ConfigureSupplementalDataRequest: data_type: DataType = dataclasses.field(metadata={'path_param': { 'field_name': 'dataType', 'style': 'simple', 'explode': False }}) r"""Supported supplemental data data type.""" platform_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'platformKey', 'style': 'simple', 'explode': False }}) - r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + r"""A unique 4-letter key to represent a platform in each integration.""" supplemental_data_configuration: Optional[shared_supplementaldataconfiguration.SupplementalDataConfiguration] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) r"""The configuration for the specified platform and data type.""" diff --git a/platform/src/codatplatform/models/operations/create_webhook_consumer.py b/platform/src/codatplatform/models/operations/create_webhook_consumer.py new file mode 100644 index 000000000..795be21fe --- /dev/null +++ b/platform/src/codatplatform/models/operations/create_webhook_consumer.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ...models.shared import webhookconsumer as shared_webhookconsumer +from typing import Optional + + +@dataclasses.dataclass +class CreateWebhookConsumerResponse: + 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""" + raw_response: requests_http.Response = dataclasses.field() + r"""Raw HTTP response; suitable for custom response parsing""" + webhook_consumer: Optional[shared_webhookconsumer.WebhookConsumer] = dataclasses.field(default=None) + r"""OK""" + + diff --git a/platform/src/codatplatform/models/operations/delete_webhook_consumer.py b/platform/src/codatplatform/models/operations/delete_webhook_consumer.py new file mode 100644 index 000000000..c139eb4b7 --- /dev/null +++ b/platform/src/codatplatform/models/operations/delete_webhook_consumer.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http + + +@dataclasses.dataclass +class DeleteWebhookConsumerRequest: + webhook_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'webhookId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for the webhook consumer.""" + + + + +@dataclasses.dataclass +class DeleteWebhookConsumerResponse: + 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""" + raw_response: requests_http.Response = dataclasses.field() + r"""Raw HTTP response; suitable for custom response parsing""" + + diff --git a/platform/src/codatplatform/models/operations/get_custom_data_type_configuration.py b/platform/src/codatplatform/models/operations/get_custom_data_type_configuration.py index 85628ad02..faaab882c 100644 --- a/platform/src/codatplatform/models/operations/get_custom_data_type_configuration.py +++ b/platform/src/codatplatform/models/operations/get_custom_data_type_configuration.py @@ -12,7 +12,7 @@ class GetCustomDataTypeConfigurationRequest: custom_data_identifier: str = dataclasses.field(metadata={'path_param': { 'field_name': 'customDataIdentifier', 'style': 'simple', 'explode': False }}) r"""Unique identifier for a custom data type.""" platform_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'platformKey', 'style': 'simple', 'explode': False }}) - r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + r"""A unique 4-letter key to represent a platform in each integration.""" diff --git a/platform/src/codatplatform/models/operations/get_integration.py b/platform/src/codatplatform/models/operations/get_integration.py index 983128328..aeaa32b6a 100644 --- a/platform/src/codatplatform/models/operations/get_integration.py +++ b/platform/src/codatplatform/models/operations/get_integration.py @@ -10,7 +10,7 @@ @dataclasses.dataclass class GetIntegrationRequest: platform_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'platformKey', 'style': 'simple', 'explode': False }}) - r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + r"""A unique 4-letter key to represent a platform in each integration.""" diff --git a/platform/src/codatplatform/models/operations/get_integrations_branding.py b/platform/src/codatplatform/models/operations/get_integrations_branding.py index 9cf9d74e3..4ff6f972d 100644 --- a/platform/src/codatplatform/models/operations/get_integrations_branding.py +++ b/platform/src/codatplatform/models/operations/get_integrations_branding.py @@ -10,7 +10,7 @@ @dataclasses.dataclass class GetIntegrationsBrandingRequest: platform_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'platformKey', 'style': 'simple', 'explode': False }}) - r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + r"""A unique 4-letter key to represent a platform in each integration.""" diff --git a/platform/src/codatplatform/models/operations/get_supplemental_data_configuration.py b/platform/src/codatplatform/models/operations/get_supplemental_data_configuration.py index 128b2b142..d21564e90 100644 --- a/platform/src/codatplatform/models/operations/get_supplemental_data_configuration.py +++ b/platform/src/codatplatform/models/operations/get_supplemental_data_configuration.py @@ -37,7 +37,7 @@ class GetSupplementalDataConfigurationRequest: data_type: PathParamDataType = dataclasses.field(metadata={'path_param': { 'field_name': 'dataType', 'style': 'simple', 'explode': False }}) r"""Supported supplemental data data type.""" platform_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'platformKey', 'style': 'simple', 'explode': False }}) - r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + r"""A unique 4-letter key to represent a platform in each integration.""" diff --git a/platform/src/codatplatform/models/operations/list_webhook_consumers.py b/platform/src/codatplatform/models/operations/list_webhook_consumers.py new file mode 100644 index 000000000..496b49d7f --- /dev/null +++ b/platform/src/codatplatform/models/operations/list_webhook_consumers.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ...models.shared import webhookconsumers as shared_webhookconsumers +from typing import Optional + + +@dataclasses.dataclass +class ListWebhookConsumersResponse: + 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""" + raw_response: requests_http.Response = dataclasses.field() + r"""Raw HTTP response; suitable for custom response parsing""" + webhook_consumers: Optional[shared_webhookconsumers.WebhookConsumers] = dataclasses.field(default=None) + r"""OK""" + + diff --git a/platform/src/codatplatform/models/shared/__init__.py b/platform/src/codatplatform/models/shared/__init__.py index a10cf5dd6..28a0976a2 100644 --- a/platform/src/codatplatform/models/shared/__init__.py +++ b/platform/src/codatplatform/models/shared/__init__.py @@ -78,7 +78,10 @@ from .validation import * from .validationitem import * from .webhook import * +from .webhookconsumer import * +from .webhookconsumerprototype import * +from .webhookconsumers import * from .webhooknotifier import * from .webhooks import * -__all__ = ["APIKeyDetails","APIKeys","Branding","BrandingButton","BrandingImage","BrandingLogo","ClientRateLimitReachedWebhook","ClientRateLimitReachedWebhookData","ClientRateLimitResetWebhook","ClientRateLimitResetWebhookData","Companies","Company","CompanyGroupAssignment","CompanyRequestBody","Connection","ConnectionStatusChangedWebhook","ConnectionStatusChangedWebhookData","Connections","Content","CreateAPIKey","CreateRule","CustomDataTypeConfiguration","CustomDataTypeRecord","CustomDataTypeRecords","DataConnectionError","DataConnectionStatus","DataStatus","DataSyncCompletedWebhook","DataSyncCompletedWebhookData","DataType","DataTypeFeature","DataTypes","DatasetDataChangedWebhook","DatasetDataChangedWebhookData","DatasetStatusChangedErrorWebhook","DatasetStatusChangedErrorWebhookData","ErrorValidation","ErrorValidationItem","FeatureState","FeatureType","Group","GroupPrototype","GroupRef","Groups","HalRef","ImageReference","Integration","Integrations","Links","ModifiedDate","NewCompanySynchronizedWebhook","NewCompanySynchronizedWebhookData","Profile","PullOperation","PullOperations","PushChangeType","PushFieldValidation","PushOperation","PushOperationChange","PushOperationRef","PushOperationStatus","PushOperationStatusChangedWebhook","PushOperationStatusChangedWebhookData","PushOperationTimedOutWebhook","PushOperationTimedOutWebhookData","PushOperations","PushOption","PushOptionChoice","PushOptionProperty","PushOptionType","PushValidationInfo","SchemaDataType","Security","SourceType","Status","SupplementalDataConfiguration","SupplementalDataSourceConfiguration","SupportedFeature","SyncSetting","SyncSettings","UpdateConnectionStatus","Validation","ValidationItem","Webhook","WebhookNotifier","Webhooks"] +__all__ = ["APIKeyDetails","APIKeys","Branding","BrandingButton","BrandingImage","BrandingLogo","ClientRateLimitReachedWebhook","ClientRateLimitReachedWebhookData","ClientRateLimitResetWebhook","ClientRateLimitResetWebhookData","Companies","Company","CompanyGroupAssignment","CompanyRequestBody","Connection","ConnectionStatusChangedWebhook","ConnectionStatusChangedWebhookData","Connections","Content","CreateAPIKey","CreateRule","CustomDataTypeConfiguration","CustomDataTypeRecord","CustomDataTypeRecords","DataConnectionError","DataConnectionStatus","DataStatus","DataSyncCompletedWebhook","DataSyncCompletedWebhookData","DataType","DataTypeFeature","DataTypes","DatasetDataChangedWebhook","DatasetDataChangedWebhookData","DatasetStatusChangedErrorWebhook","DatasetStatusChangedErrorWebhookData","ErrorValidation","ErrorValidationItem","FeatureState","FeatureType","Group","GroupPrototype","GroupRef","Groups","HalRef","ImageReference","Integration","Integrations","Links","ModifiedDate","NewCompanySynchronizedWebhook","NewCompanySynchronizedWebhookData","Profile","PullOperation","PullOperations","PushChangeType","PushFieldValidation","PushOperation","PushOperationChange","PushOperationRef","PushOperationStatus","PushOperationStatusChangedWebhook","PushOperationStatusChangedWebhookData","PushOperationTimedOutWebhook","PushOperationTimedOutWebhookData","PushOperations","PushOption","PushOptionChoice","PushOptionProperty","PushOptionType","PushValidationInfo","SchemaDataType","Security","SourceType","Status","SupplementalDataConfiguration","SupplementalDataSourceConfiguration","SupportedFeature","SyncSetting","SyncSettings","UpdateConnectionStatus","Validation","ValidationItem","Webhook","WebhookConsumer","WebhookConsumerPrototype","WebhookConsumers","WebhookNotifier","Webhooks"] diff --git a/platform/src/codatplatform/models/shared/clientratelimitreachedwebhook.py b/platform/src/codatplatform/models/shared/clientratelimitreachedwebhook.py index b030a7bd0..9340cf545 100644 --- a/platform/src/codatplatform/models/shared/clientratelimitreachedwebhook.py +++ b/platform/src/codatplatform/models/shared/clientratelimitreachedwebhook.py @@ -20,7 +20,7 @@ class ClientRateLimitReachedWebhook: r"""Name of your client in Codat.""" data: Optional[ClientRateLimitReachedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/clientratelimitresetwebhook.py b/platform/src/codatplatform/models/shared/clientratelimitresetwebhook.py index df1a7f4bc..b9f937d16 100644 --- a/platform/src/codatplatform/models/shared/clientratelimitresetwebhook.py +++ b/platform/src/codatplatform/models/shared/clientratelimitresetwebhook.py @@ -20,7 +20,7 @@ class ClientRateLimitResetWebhook: r"""Name of your client in Codat.""" data: Optional[ClientRateLimitResetWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/clientratelimitresetwebhookdata.py b/platform/src/codatplatform/models/shared/clientratelimitresetwebhookdata.py index 9907406fa..368201d28 100644 --- a/platform/src/codatplatform/models/shared/clientratelimitresetwebhookdata.py +++ b/platform/src/codatplatform/models/shared/clientratelimitresetwebhookdata.py @@ -35,7 +35,7 @@ class ClientRateLimitResetWebhookData: > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. """ quota_remaining: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('QuotaRemaining'), 'exclude': lambda f: f is ClientRateLimitResetWebhookData.UNSET }}) - r"""Total number of request remaining for your client.""" + r"""Total number of requests remaining for your client.""" reset_reason: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ResetReason'), 'exclude': lambda f: f is None }}) r"""The reason for your rate limit quota being reset.""" diff --git a/platform/src/codatplatform/models/shared/connectionstatuschangedwebhook.py b/platform/src/codatplatform/models/shared/connectionstatuschangedwebhook.py index e71f0515d..aa725a16a 100644 --- a/platform/src/codatplatform/models/shared/connectionstatuschangedwebhook.py +++ b/platform/src/codatplatform/models/shared/connectionstatuschangedwebhook.py @@ -24,7 +24,7 @@ class ConnectionStatusChangedWebhook: data_connection_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DataConnectionId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for a company's data connection.""" message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/createrule.py b/platform/src/codatplatform/models/shared/createrule.py index fc091e482..e96e3e61e 100644 --- a/platform/src/codatplatform/models/shared/createrule.py +++ b/platform/src/codatplatform/models/shared/createrule.py @@ -11,7 +11,7 @@ @dataclass_json(undefined=Undefined.EXCLUDE) @dataclasses.dataclass class CreateRule: - r"""Create an event notification to a URL or list of email addresses based on the given type or condition.""" + r"""Create a message that notifies a URL of an event based on its given type or condition.""" notifiers: WebhookNotifier = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('notifiers') }}) type: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) r"""The type of webhook.""" diff --git a/platform/src/codatplatform/models/shared/datasetdatachangedwebhook.py b/platform/src/codatplatform/models/shared/datasetdatachangedwebhook.py index c1ebcda9e..63bcaa34d 100644 --- a/platform/src/codatplatform/models/shared/datasetdatachangedwebhook.py +++ b/platform/src/codatplatform/models/shared/datasetdatachangedwebhook.py @@ -12,7 +12,7 @@ @dataclasses.dataclass class DatasetDataChangedWebhookData: data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" + r"""Available data types""" dataset_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datasetId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the dataset that completed its sync.""" @@ -35,7 +35,7 @@ class DatasetDataChangedWebhook: data_connection_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DataConnectionId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for a company's data connection.""" message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py b/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py index d26e816d5..dac725aa7 100644 --- a/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py +++ b/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py @@ -24,7 +24,7 @@ class DatasetStatusChangedErrorWebhook: data_connection_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DataConnectionId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for a company's data connection.""" message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py b/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py index cc1ca26dd..bbf9f0327 100644 --- a/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py +++ b/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py @@ -12,7 +12,7 @@ @dataclasses.dataclass class DatasetStatusChangedErrorWebhookData: data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" + r"""Available data types""" dataset_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datasetId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the dataset that completed its sync.""" dataset_status: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datasetStatus'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/datastatus.py b/platform/src/codatplatform/models/shared/datastatus.py index e0d6300fa..6fa0fdca2 100644 --- a/platform/src/codatplatform/models/shared/datastatus.py +++ b/platform/src/codatplatform/models/shared/datastatus.py @@ -8,7 +8,7 @@ from typing import Optional class DataTypes(str, Enum): - r"""Available Data types""" + r"""Available data types""" ACCOUNT_TRANSACTIONS = 'accountTransactions' BALANCE_SHEET = 'balanceSheet' BANK_ACCOUNTS = 'bankAccounts' @@ -61,7 +61,7 @@ class DataStatus: current_status: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentStatus') }}) r"""The current status of the dataset in Codat's cache.""" data_type: DataTypes = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType') }}) - r"""Available Data types""" + r"""Available data types""" last_successful_sync: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lastSuccessfulSync') }}) 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: diff --git a/platform/src/codatplatform/models/shared/datasynccompletedwebhook.py b/platform/src/codatplatform/models/shared/datasynccompletedwebhook.py index 3978f8651..74b0f107e 100644 --- a/platform/src/codatplatform/models/shared/datasynccompletedwebhook.py +++ b/platform/src/codatplatform/models/shared/datasynccompletedwebhook.py @@ -24,7 +24,7 @@ class DataSyncCompletedWebhook: data_connection_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DataConnectionId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for a company's data connection.""" message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/datasynccompletedwebhookdata.py b/platform/src/codatplatform/models/shared/datasynccompletedwebhookdata.py index 14089e489..f1abc012b 100644 --- a/platform/src/codatplatform/models/shared/datasynccompletedwebhookdata.py +++ b/platform/src/codatplatform/models/shared/datasynccompletedwebhookdata.py @@ -12,7 +12,7 @@ @dataclasses.dataclass class DataSyncCompletedWebhookData: data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" + r"""Available data types""" dataset_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datasetId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the dataset that completed its sync.""" diff --git a/platform/src/codatplatform/models/shared/datatype.py b/platform/src/codatplatform/models/shared/datatype.py index df149bcf0..76eee21a3 100644 --- a/platform/src/codatplatform/models/shared/datatype.py +++ b/platform/src/codatplatform/models/shared/datatype.py @@ -4,7 +4,7 @@ from enum import Enum class DataType(str, Enum): - r"""Available Data types""" + r"""Available data types""" ACCOUNT_TRANSACTIONS = 'accountTransactions' BALANCE_SHEET = 'balanceSheet' BANK_ACCOUNTS = 'bankAccounts' diff --git a/platform/src/codatplatform/models/shared/datatypefeature.py b/platform/src/codatplatform/models/shared/datatypefeature.py index 7cbef858e..9fc937293 100644 --- a/platform/src/codatplatform/models/shared/datatypefeature.py +++ b/platform/src/codatplatform/models/shared/datatypefeature.py @@ -15,6 +15,6 @@ class DataTypeFeature: r"""Describes support for a given datatype and associated operations""" supported_features: List[SupportedFeature] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supportedFeatures') }}) data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" + r"""Available data types""" diff --git a/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhook.py b/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhook.py index 4e21158b9..bfac3a7e1 100644 --- a/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhook.py +++ b/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhook.py @@ -24,7 +24,7 @@ class NewCompanySynchronizedWebhook: data_connection_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DataConnectionId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for a company's data connection.""" message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/pushoperation.py b/platform/src/codatplatform/models/shared/pushoperation.py index 5a0987e4f..6b431523a 100644 --- a/platform/src/codatplatform/models/shared/pushoperation.py +++ b/platform/src/codatplatform/models/shared/pushoperation.py @@ -70,7 +70,7 @@ class PushOperation: > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. """ data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" + r"""Available data types""" error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is PushOperation.UNSET }}) r"""A message about the error.""" timeout_in_minutes: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is PushOperation.UNSET }}) diff --git a/platform/src/codatplatform/models/shared/pushoperationref.py b/platform/src/codatplatform/models/shared/pushoperationref.py index 871f10c92..029dffd71 100644 --- a/platform/src/codatplatform/models/shared/pushoperationref.py +++ b/platform/src/codatplatform/models/shared/pushoperationref.py @@ -12,7 +12,7 @@ @dataclasses.dataclass class PushOperationRef: data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" + r"""Available data types""" id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) r"""Unique identifier for a push operation.""" diff --git a/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py b/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py index 0ff3436c0..3159e49d5 100644 --- a/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py +++ b/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py @@ -24,7 +24,7 @@ class PushOperationStatusChangedWebhook: data_connection_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DataConnectionId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for a company's data connection.""" message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py b/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py index 1120f1d42..83623e5e4 100644 --- a/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py +++ b/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py @@ -13,7 +13,7 @@ @dataclasses.dataclass class PushOperationStatusChangedWebhookData: data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" + r"""Available data types""" push_operation_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey'), 'exclude': lambda f: f is None }}) r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" status: Optional[PushOperationStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhook.py b/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhook.py index 19c752c4f..c34e006f0 100644 --- a/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhook.py +++ b/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhook.py @@ -24,7 +24,7 @@ class PushOperationTimedOutWebhook: data_connection_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DataConnectionId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for a company's data connection.""" message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" + r"""A human-readable message about the webhook.""" rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) r"""Unique identifier for the rule.""" rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py b/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py index fd944606c..f30a30691 100644 --- a/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py +++ b/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py @@ -12,7 +12,7 @@ @dataclasses.dataclass class PushOperationTimedOutWebhookData: data_type: Optional[DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) - r"""Available Data types""" + r"""Available data types""" push_operation_guid: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationGuid'), 'exclude': lambda f: f is None }}) r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" push_operation_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey'), 'exclude': lambda f: f is None }}) diff --git a/platform/src/codatplatform/models/shared/schema_datatype.py b/platform/src/codatplatform/models/shared/schema_datatype.py index c6811c63c..38faff212 100644 --- a/platform/src/codatplatform/models/shared/schema_datatype.py +++ b/platform/src/codatplatform/models/shared/schema_datatype.py @@ -4,7 +4,7 @@ from enum import Enum class SchemaDataType(str, Enum): - r"""Available Data types""" + r"""Available data types""" ACCOUNT_TRANSACTIONS = 'accountTransactions' BALANCE_SHEET = 'balanceSheet' BANK_ACCOUNTS = 'bankAccounts' diff --git a/platform/src/codatplatform/models/shared/syncsetting.py b/platform/src/codatplatform/models/shared/syncsetting.py index 39fa1d594..c33c94e89 100644 --- a/platform/src/codatplatform/models/shared/syncsetting.py +++ b/platform/src/codatplatform/models/shared/syncsetting.py @@ -13,7 +13,7 @@ class SyncSetting: r"""Describes how often, and how much history, should be fetched for the given data type when a pull operation is queued.""" data_type: DataType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType') }}) - r"""Available Data types""" + r"""Available data types""" fetch_on_first_link: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fetchOnFirstLink') }}) r"""Whether this data type should be queued after a company has authorized a connection.""" sync_order: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncOrder') }}) diff --git a/platform/src/codatplatform/models/shared/webhookconsumer.py b/platform/src/codatplatform/models/shared/webhookconsumer.py new file mode 100644 index 000000000..694b64932 --- /dev/null +++ b/platform/src/codatplatform/models/shared/webhookconsumer.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from codatplatform import utils +from dataclasses_json import Undefined, dataclass_json +from typing import List, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class WebhookConsumer: + r"""A webhook consumer is an HTTP endpoint that developers can configure to subscribe to Codat's supported event types. + + See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + """ + UNSET='__SPEAKEASY_UNSET__' + disabled: Optional[bool] = dataclasses.field(default=False, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('disabled'), 'exclude': lambda f: f is WebhookConsumer.UNSET }}) + r"""Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`.""" + event_types: Optional[List[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('eventTypes'), 'exclude': lambda f: f is None }}) + r"""An array of event types the webhook consumer subscribes to.""" + id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) + r"""Unique identifier for the webhook consumer.""" + url: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('url'), 'exclude': lambda f: f is None }}) + r"""The URL that will consume webhook events dispatched by Codat.""" + + diff --git a/platform/src/codatplatform/models/shared/webhookconsumerprototype.py b/platform/src/codatplatform/models/shared/webhookconsumerprototype.py new file mode 100644 index 000000000..1383f2d31 --- /dev/null +++ b/platform/src/codatplatform/models/shared/webhookconsumerprototype.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from codatplatform import utils +from dataclasses_json import Undefined, dataclass_json +from typing import List, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class WebhookConsumerPrototype: + UNSET='__SPEAKEASY_UNSET__' + disabled: Optional[bool] = dataclasses.field(default=False, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('disabled'), 'exclude': lambda f: f is WebhookConsumerPrototype.UNSET }}) + r"""Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`.""" + event_types: Optional[List[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('eventTypes'), 'exclude': lambda f: f is None }}) + r"""An array of event types the webhook consumer subscribes to.""" + url: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('url'), 'exclude': lambda f: f is None }}) + r"""The URL that will consume webhook events dispatched by Codat.""" + + diff --git a/platform/src/codatplatform/models/shared/webhookconsumers.py b/platform/src/codatplatform/models/shared/webhookconsumers.py new file mode 100644 index 000000000..6026d3bf2 --- /dev/null +++ b/platform/src/codatplatform/models/shared/webhookconsumers.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from .webhookconsumer import WebhookConsumer +from codatplatform import utils +from dataclasses_json import Undefined, dataclass_json +from typing import List, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) +@dataclasses.dataclass +class WebhookConsumers: + results: Optional[List[WebhookConsumer]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/platform/src/codatplatform/models/shared/webhooknotifier.py b/platform/src/codatplatform/models/shared/webhooknotifier.py index d3b41f3a1..220766bc4 100644 --- a/platform/src/codatplatform/models/shared/webhooknotifier.py +++ b/platform/src/codatplatform/models/shared/webhooknotifier.py @@ -12,6 +12,6 @@ class WebhookNotifier: emails: Optional[List[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('emails'), 'exclude': lambda f: f is None }}) webhook: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('webhook'), 'exclude': lambda f: f is None }}) - r"""The URI the webhook service will POST events.""" + r"""The URI the webhook service will use to post events.""" diff --git a/platform/src/codatplatform/push_data.py b/platform/src/codatplatform/push_data.py index 2563d3a52..3b7c60ca1 100644 --- a/platform/src/codatplatform/push_data.py +++ b/platform/src/codatplatform/push_data.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -27,6 +29,7 @@ def get_model_options(self, request: operations.GetCreateUpdateModelOptionsByDat > > Check out our [coverage explorer](https://knowledge.codat.io/) for integrations that support push (POST/PUT methods). """ + hook_ctx = HookContext(operation_id='get-create-update-model-options-by-data-type', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetCreateUpdateModelOptionsByDataTypeRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/{dataType}', request) @@ -39,6 +42,7 @@ def get_model_options(self, request: operations.GetCreateUpdateModelOptionsByDat else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -48,13 +52,34 @@ def get_model_options(self, request: operations.GetCreateUpdateModelOptionsByDat retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetCreateUpdateModelOptionsByDataTypeResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -83,6 +108,7 @@ def get_operation(self, request: operations.GetPushOperationRequest, retries: Op r"""Get push operation Retrieve push operation. """ + hook_ctx = HookContext(operation_id='get-push-operation', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetPushOperationRequest, base_url, '/companies/{companyId}/push/{pushOperationKey}', request) @@ -95,6 +121,7 @@ def get_operation(self, request: operations.GetPushOperationRequest, retries: Op else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -104,13 +131,34 @@ def get_operation(self, request: operations.GetPushOperationRequest, retries: Op retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetPushOperationResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -139,6 +187,7 @@ def list_operations(self, request: operations.GetCompanyPushHistoryRequest, retr r"""List push operations List push operation records. """ + hook_ctx = HookContext(operation_id='get-company-push-history', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetCompanyPushHistoryRequest, base_url, '/companies/{companyId}/push', request) @@ -152,6 +201,7 @@ def list_operations(self, request: operations.GetCompanyPushHistoryRequest, retr else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -161,13 +211,34 @@ def list_operations(self, request: operations.GetCompanyPushHistoryRequest, retr 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) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, params=query_params, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetCompanyPushHistoryResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/refresh_data.py b/platform/src/codatplatform/refresh_data.py index a339dc3f6..4fe3de7e8 100644 --- a/platform/src/codatplatform/refresh_data.py +++ b/platform/src/codatplatform/refresh_data.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Dict, Optional @@ -22,6 +24,7 @@ def all(self, request: operations.RefreshCompanyDataRequest, retries: Optional[u [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. """ + hook_ctx = HookContext(operation_id='refresh-company-data', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.RefreshCompanyDataRequest, base_url, '/companies/{companyId}/data/all', request) @@ -34,6 +37,7 @@ def all(self, request: operations.RefreshCompanyDataRequest, retries: Optional[u else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -43,13 +47,34 @@ def all(self, request: operations.RefreshCompanyDataRequest, retries: Optional[u retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.RefreshCompanyDataResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -76,6 +101,7 @@ def by_data_type(self, request: operations.RefreshDataTypeRequest, retries: Opti This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. """ + hook_ctx = HookContext(operation_id='refresh-data-type', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.RefreshDataTypeRequest, base_url, '/companies/{companyId}/data/queue/{dataType}', request) @@ -89,6 +115,7 @@ def by_data_type(self, request: operations.RefreshDataTypeRequest, retries: Opti else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -98,13 +125,34 @@ def by_data_type(self, request: operations.RefreshDataTypeRequest, retries: Opti retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, params=query_params, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, params=query_params, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.RefreshDataTypeResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -133,6 +181,7 @@ def get(self, request: operations.GetCompanyDataStatusRequest, retries: Optional r"""Get data status Get the state of each data type for a company """ + hook_ctx = HookContext(operation_id='get-company-data-status', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetCompanyDataStatusRequest, base_url, '/companies/{companyId}/dataStatus', request) @@ -145,6 +194,7 @@ def get(self, request: operations.GetCompanyDataStatusRequest, retries: Optional else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -154,13 +204,34 @@ def get(self, request: operations.GetCompanyDataStatusRequest, retries: Optional retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetCompanyDataStatusResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -189,6 +260,7 @@ def get_pull_operation(self, request: operations.GetPullOperationRequest, retrie r"""Get pull operation Retrieve information about a single dataset or pull operation. """ + hook_ctx = HookContext(operation_id='get-pull-operation', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetPullOperationRequest, base_url, '/companies/{companyId}/data/history/{datasetId}', request) @@ -201,6 +273,7 @@ def get_pull_operation(self, request: operations.GetPullOperationRequest, retrie else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -210,13 +283,34 @@ def get_pull_operation(self, request: operations.GetPullOperationRequest, retrie retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetPullOperationResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -245,6 +339,7 @@ def list_pull_operations(self, request: operations.ListPullOperationsRequest, re r"""List pull operations Gets the pull operation history (datasets) for a given company. """ + hook_ctx = HookContext(operation_id='list-pull-operations', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.ListPullOperationsRequest, base_url, '/companies/{companyId}/data/history', request) @@ -258,6 +353,7 @@ def list_pull_operations(self, request: operations.ListPullOperationsRequest, re else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -267,13 +363,34 @@ def list_pull_operations(self, request: operations.ListPullOperationsRequest, re 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) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, params=query_params, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ListPullOperationsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/sdk.py b/platform/src/codatplatform/sdk.py index 3007a74a5..35eb7c598 100644 --- a/platform/src/codatplatform/sdk.py +++ b/platform/src/codatplatform/sdk.py @@ -13,6 +13,7 @@ from .supplemental_data import SupplementalData from .webhooks import Webhooks from codatplatform import utils +from codatplatform._hooks import SDKHooks from codatplatform.models import shared from typing import Callable, Dict, Union @@ -80,6 +81,16 @@ def __init__(self, server_url = utils.template_url(server_url, url_params) self.sdk_configuration = SDKConfiguration(client, security, server_url, server_idx, retry_config=retry_config) + + hooks = SDKHooks() + + current_server_url, *_ = self.sdk_configuration.get_server_details() + server_url, self.sdk_configuration.client = hooks.sdk_init(current_server_url, self.sdk_configuration.client) + if current_server_url != server_url: + self.sdk_configuration.server_url = server_url + + # pylint: disable=protected-access + self.sdk_configuration._hooks=hooks self._init_sdks() diff --git a/platform/src/codatplatform/sdkconfiguration.py b/platform/src/codatplatform/sdkconfiguration.py index 5aaf765fb..6d23b9f6b 100644 --- a/platform/src/codatplatform/sdkconfiguration.py +++ b/platform/src/codatplatform/sdkconfiguration.py @@ -2,6 +2,7 @@ import requests as requests_http +from ._hooks import SDKHooks from .utils import utils from .utils.retries import RetryConfig from codatplatform.models import shared @@ -23,10 +24,11 @@ class SDKConfiguration: server_idx: int = 0 language: str = 'python' openapi_doc_version: str = '3.0.0' - sdk_version: str = '3.3.0' - gen_version: str = '2.257.2' - user_agent: str = 'speakeasy-sdk/python 3.3.0 2.257.2 3.0.0 codat-platform' + sdk_version: str = '3.4.0' + gen_version: str = '2.277.0' + user_agent: str = 'speakeasy-sdk/python 3.4.0 2.277.0 3.0.0 codat-platform' retry_config: RetryConfig = None + _hooks: SDKHooks = None def get_server_details(self) -> Tuple[str, Dict[str, str]]: if self.server_url: @@ -35,3 +37,7 @@ def get_server_details(self) -> Tuple[str, Dict[str, str]]: self.server_idx = 0 return SERVERS[self.server_idx], {} + + + def get_hooks(self) -> SDKHooks: + return self._hooks diff --git a/platform/src/codatplatform/settings.py b/platform/src/codatplatform/settings.py index 9fb133624..ac54c0586 100644 --- a/platform/src/codatplatform/settings.py +++ b/platform/src/codatplatform/settings.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -28,12 +30,13 @@ def create_api_key(self, request: Optional[shared.CreateAPIKey], retries: Option * If you require multiple API keys, perform multiple calls to the *Create API keys* endpoint. * The number of API keys is limited to 10. If you have reached the maximum amount of keys, use the *Delete API key* endpoint to delete an unused key first. """ + hook_ctx = HookContext(operation_id='create-api-key', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/apiKeys' headers = {} req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CreateAPIKey], "request", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -43,6 +46,7 @@ def create_api_key(self, request: Optional[shared.CreateAPIKey], retries: Option else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -52,13 +56,34 @@ def create_api_key(self, request: Optional[shared.CreateAPIKey], retries: Option retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','409','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.CreateAPIKeyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -96,6 +121,7 @@ def delete_api_key(self, request: operations.DeleteAPIKeyRequest, retries: Optio * It is possible to delete the last remaining API key. If this happens, a new key can be created via the [API key management page](https://app.codat.io/developers/api-keys) of the Portal. * It is possible to delete the API key used to authenticate the *Delete API key* request. """ + hook_ctx = HookContext(operation_id='delete-api-key', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.DeleteAPIKeyRequest, base_url, '/apiKeys/{apiKeyId}', request) @@ -108,6 +134,7 @@ def delete_api_key(self, request: operations.DeleteAPIKeyRequest, retries: Optio else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -117,13 +144,34 @@ def delete_api_key(self, request: operations.DeleteAPIKeyRequest, retries: Optio retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('DELETE', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('DELETE', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.DeleteAPIKeyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -152,6 +200,7 @@ def get_profile(self, retries: Optional[utils.RetryConfig] = None) -> operations r"""Get profile Fetch your Codat profile. """ + hook_ctx = HookContext(operation_id='get-profile', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/profile' @@ -164,6 +213,7 @@ def get_profile(self, retries: Optional[utils.RetryConfig] = None) -> operations else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -173,13 +223,34 @@ def get_profile(self, retries: Optional[utils.RetryConfig] = None) -> operations retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetProfileResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -208,6 +279,7 @@ def get_sync_settings(self, retries: Optional[utils.RetryConfig] = None) -> oper r"""Get sync settings Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for your client. This includes how often data types should be queued to be updated, and how much history should be fetched. """ + hook_ctx = HookContext(operation_id='get-profile-syncSettings', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/profile/syncSettings' @@ -220,6 +292,7 @@ def get_sync_settings(self, retries: Optional[utils.RetryConfig] = None) -> oper else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -229,13 +302,34 @@ def get_sync_settings(self, retries: Optional[utils.RetryConfig] = None) -> oper retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetProfileSyncSettingsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -268,6 +362,7 @@ def list_api_keys(self, retries: Optional[utils.RetryConfig] = None) -> operatio You can [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat and managing API keys via the Portal UI or API. """ + hook_ctx = HookContext(operation_id='list-api-keys', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/apiKeys' @@ -280,6 +375,7 @@ def list_api_keys(self, retries: Optional[utils.RetryConfig] = None) -> operatio else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -289,13 +385,34 @@ def list_api_keys(self, retries: Optional[utils.RetryConfig] = None) -> operatio retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ListAPIKeysResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -324,12 +441,13 @@ def update_profile(self, request: Optional[shared.Profile], retries: Optional[ut r"""Update profile Update your Codat profile """ + hook_ctx = HookContext(operation_id='update-profile', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/profile' headers = {} req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.Profile], "request", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -339,6 +457,7 @@ def update_profile(self, request: Optional[shared.Profile], retries: Optional[ut else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -348,13 +467,34 @@ def update_profile(self, request: Optional[shared.Profile], retries: Optional[ut retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('PUT', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('PUT', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.UpdateProfileResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -383,12 +523,13 @@ def update_sync_settings(self, request: Optional[operations.UpdateProfileSyncSet r"""Update all sync settings Update sync settings for all data types. """ + hook_ctx = HookContext(operation_id='update-profile-syncSettings', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/profile/syncSettings' headers = {} req_content_type, data, form = utils.serialize_request_body(request, Optional[operations.UpdateProfileSyncSettingsRequestBody], "request", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -398,6 +539,7 @@ def update_sync_settings(self, request: Optional[operations.UpdateProfileSyncSet else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -407,13 +549,34 @@ def update_sync_settings(self, request: Optional[operations.UpdateProfileSyncSet retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.UpdateProfileSyncSettingsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/supplemental_data.py b/platform/src/codatplatform/supplemental_data.py index 21b0537d6..10f7866f3 100644 --- a/platform/src/codatplatform/supplemental_data.py +++ b/platform/src/codatplatform/supplemental_data.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -23,12 +25,13 @@ def configure(self, request: operations.ConfigureSupplementalDataRequest, retrie **Integration-specific behaviour** See the *examples* for integration-specific frequently requested properties. """ + hook_ctx = HookContext(operation_id='configure-supplemental-data', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.ConfigureSupplementalDataRequest, base_url, '/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig', request) headers = {} req_content_type, data, form = utils.serialize_request_body(request, operations.ConfigureSupplementalDataRequest, "supplemental_data_configuration", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -38,6 +41,7 @@ def configure(self, request: operations.ConfigureSupplementalDataRequest, retrie else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -47,13 +51,34 @@ def configure(self, request: operations.ConfigureSupplementalDataRequest, retrie retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('PUT', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('PUT', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ConfigureSupplementalDataResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -80,6 +105,7 @@ def get_configuration(self, request: operations.GetSupplementalDataConfiguration [Supplemental data](https://docs.codat.io/using-the-api/additional-data) is additional data you can include in Codat's standard data types. """ + hook_ctx = HookContext(operation_id='get-supplemental-data-configuration', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetSupplementalDataConfigurationRequest, base_url, '/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig', request) @@ -92,6 +118,7 @@ def get_configuration(self, request: operations.GetSupplementalDataConfiguration else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -101,13 +128,34 @@ def get_configuration(self, request: operations.GetSupplementalDataConfiguration retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetSupplementalDataConfigurationResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/platform/src/codatplatform/utils/utils.py b/platform/src/codatplatform/utils/utils.py index 52434025e..691091c81 100644 --- a/platform/src/codatplatform/utils/utils.py +++ b/platform/src/codatplatform/utils/utils.py @@ -21,15 +21,16 @@ class SecurityClient: client: requests.Session query_params: Dict[str, str] = {} + headers: 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} + def send(self, request: requests.PreparedRequest, **kwargs): + request.prepare_url(url=request.url, params=self.query_params) + request.headers.update(self.headers) - return self.client.request(method, url, **kwargs) + return self.client.send(request, **kwargs) def configure_security_client(client: requests.Session, security: dataclass): @@ -102,20 +103,19 @@ def _parse_security_scheme_value(client: SecurityClient, scheme_metadata: Dict, if scheme_type == "apiKey": if sub_type == 'header': - client.client.headers[header_name] = value + client.headers[header_name] = value elif sub_type == 'query': client.query_params[header_name] = value - elif sub_type == 'cookie': - client.client.cookies[header_name] = value else: raise Exception('not supported') elif scheme_type == "openIdConnect": - client.client.headers[header_name] = _apply_bearer(value) + client.headers[header_name] = _apply_bearer(value) elif scheme_type == 'oauth2': - client.client.headers[header_name] = _apply_bearer(value) + if sub_type != 'client_credentials': + client.headers[header_name] = _apply_bearer(value) elif scheme_type == 'http': if sub_type == 'bearer': - client.client.headers[header_name] = _apply_bearer(value) + client.headers[header_name] = _apply_bearer(value) else: raise Exception('not supported') else: @@ -145,7 +145,7 @@ def _parse_basic_auth_scheme(client: SecurityClient, scheme: dataclass): password = value data = f'{username}:{password}'.encode() - client.client.headers['Authorization'] = f'Basic {base64.b64encode(data).decode()}' + client.headers['Authorization'] = f'Basic {base64.b64encode(data).decode()}' def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass, @@ -264,7 +264,8 @@ def get_query_params(clazz: type, query_params: dataclass, gbls: Dict[str, Dict[ f_name = metadata.get("field_name") serialization = metadata.get('serialization', '') if serialization != '': - serialized_parms = _get_serialized_params(metadata, field.type, f_name, value) + serialized_parms = _get_serialized_params( + metadata, field.type, f_name, value) for key, value in serialized_parms.items(): if key in params: params[key].extend(value) @@ -312,7 +313,8 @@ def _get_serialized_params(metadata: Dict, field_type: type, field_name: str, ob serialization = metadata.get('serialization', '') if serialization == 'json': - params[metadata.get("field_name", field_name)] = marshal_json(obj, field_type) + params[metadata.get("field_name", field_name) + ] = marshal_json(obj, field_type) return params @@ -702,7 +704,8 @@ def unmarshal_json(data, typ, decoder=None): def marshal_json(val, typ, encoder=None): if not is_optional_type(typ) and val is None: - raise ValueError(f"Could not marshal None into non-optional type: {typ}") + raise ValueError( + f"Could not marshal None into non-optional type: {typ}") marshal = make_dataclass('Marshal', [('res', typ)], bases=(DataClassJsonMixin,)) @@ -732,6 +735,16 @@ def match_content_type(content_type: str, pattern: str) -> boolean: return False +def match_status_codes(status_codes: List[str], status_code: int) -> bool: + for code in status_codes: + if code == str(status_code): + return True + + if code.endswith("XX") and code.startswith(str(status_code)[:1]): + return True + return False + + def datetimeisoformat(optional: bool): def isoformatoptional(val): if optional and val is None: @@ -835,6 +848,7 @@ def list_decode(val: List): return list_decode + def union_encoder(all_encoders: Dict[str, Callable]): def selective_encoder(val: any): if type(val) in all_encoders: @@ -842,6 +856,7 @@ def selective_encoder(val: any): return val return selective_encoder + def union_decoder(all_decoders: List[Callable]): def selective_decoder(val: any): decoded = val @@ -854,6 +869,7 @@ def selective_decoder(val: any): return decoded return selective_decoder + def get_field_name(name): def override(_, _field_name=name): return _field_name diff --git a/platform/src/codatplatform/webhooks.py b/platform/src/codatplatform/webhooks.py index bfc341601..3043ae39d 100644 --- a/platform/src/codatplatform/webhooks.py +++ b/platform/src/codatplatform/webhooks.py @@ -1,7 +1,9 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +import requests as requests_http from .sdkconfiguration import SDKConfiguration from codatplatform import utils +from codatplatform._hooks import HookContext from codatplatform.models import errors, operations, shared from typing import Optional @@ -17,13 +19,16 @@ def __init__(self, sdk_config: SDKConfiguration) -> None: def create(self, request: Optional[shared.CreateRule], retries: Optional[utils.RetryConfig] = None) -> operations.CreateRuleResponse: r"""Create webhook Create a new webhook configuration + + Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. """ + hook_ctx = HookContext(operation_id='create-rule', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/rules' headers = {} req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CreateRule], "request", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type headers['Accept'] = 'application/json' headers['user-agent'] = self.sdk_configuration.user_agent @@ -33,6 +38,7 @@ def create(self, request: Optional[shared.CreateRule], retries: Optional[utils.R else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -42,13 +48,34 @@ def create(self, request: Optional[shared.CreateRule], retries: Optional[utils.R retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('POST', url, data=data, files=form, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.CreateRuleResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -73,10 +100,174 @@ def do_request(): + def create_consumer(self, request: Optional[shared.WebhookConsumerPrototype], retries: Optional[utils.RetryConfig] = None) -> operations.CreateWebhookConsumerResponse: + r"""Create webhook consumer + Use the *Create webhook consumer* endpoint to create a new webhook consumer that will listen to messages we send you. + + [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + """ + hook_ctx = HookContext(operation_id='create-webhook-consumer', oauth2_scopes=[], security_source=self.sdk_configuration.security) + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = base_url + '/webhooks' + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.WebhookConsumerPrototype], "request", False, True, 'json') + if req_content_type is not None and req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + headers['Accept'] = 'application/json' + headers['user-agent'] = self.sdk_configuration.user_agent + + if callable(self.sdk_configuration.security): + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) + else: + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + 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(): + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('POST', url, data=data, files=form, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + + content_type = http_res.headers.get('Content-Type') + + res = operations.CreateWebhookConsumerResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 201: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.WebhookConsumer]) + res.webhook_consumer = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code in [401, 402, 403, 429, 500, 503]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) + out.raw_response = http_res + raise out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: + raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) + + return res + + + + def delete_consumer(self, request: operations.DeleteWebhookConsumerRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteWebhookConsumerResponse: + r"""Delete webhook consumer + Use the *Delete webhook consumer* endpoint to delete an existing webhoook consumer, providing its valid `id` as a parameter. + + [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + """ + hook_ctx = HookContext(operation_id='delete-webhook-consumer', oauth2_scopes=[], security_source=self.sdk_configuration.security) + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.DeleteWebhookConsumerRequest, base_url, '/webhooks/{webhookId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = self.sdk_configuration.user_agent + + if callable(self.sdk_configuration.security): + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) + else: + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + 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(): + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('DELETE', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + + content_type = http_res.headers.get('Content-Type') + + res = operations.DeleteWebhookConsumerResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 204: + pass + elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) + out.raw_response = http_res + raise out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: + raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) + + return res + + + def get(self, request: operations.GetWebhookRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetWebhookResponse: r"""Get webhook Get a single webhook + + Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. """ + hook_ctx = HookContext(operation_id='get-webhook', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetWebhookRequest, base_url, '/rules/{ruleId}', request) @@ -89,6 +280,7 @@ def get(self, request: operations.GetWebhookRequest, retries: Optional[utils.Ret else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -98,13 +290,34 @@ def get(self, request: operations.GetWebhookRequest, retries: Optional[utils.Ret retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) def do_request(): - return client.request('GET', url, headers=headers) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.GetWebhookResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -132,7 +345,10 @@ def do_request(): def list(self, request: operations.ListRulesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListRulesResponse: r"""List webhooks List webhooks that you are subscribed to. + + Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. """ + hook_ctx = HookContext(operation_id='list-rules', oauth2_scopes=[], security_source=self.sdk_configuration.security) base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = base_url + '/rules' @@ -146,6 +362,7 @@ def list(self, request: operations.ListRulesRequest, retries: Optional[utils.Ret else: client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + global_retry_config = self.sdk_configuration.retry_config retry_config = retries if retry_config is None: @@ -155,13 +372,34 @@ def list(self, request: operations.ListRulesRequest, retries: Optional[utils.Ret 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) + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, params=query_params, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res http_res = utils.retry(do_request, utils.Retries(retry_config, [ '408', '429', '5XX' ])) + content_type = http_res.headers.get('Content-Type') res = operations.ListRulesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -184,4 +422,85 @@ def do_request(): return res + + + def list_consumers(self, retries: Optional[utils.RetryConfig] = None) -> operations.ListWebhookConsumersResponse: + r"""List webhook consumers + Use the *List webhook consumers* endpoint to return a list of all webhook consumers that currently exist for your client. + + [Webhook consumer](https://docs.codat.io/platform-api#/schemas/WebhookConsumer) is an HTTP endpoint that you configure to subscribe to specific events. See our documentation for more details on [Codat's webhook service](https://docs.codat.io/using-the-api/webhooks/overview). + """ + hook_ctx = HookContext(operation_id='list-webhook-consumers', oauth2_scopes=[], security_source=self.sdk_configuration.security) + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = base_url + '/webhooks' + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = self.sdk_configuration.user_agent + + if callable(self.sdk_configuration.security): + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) + else: + client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) + + + global_retry_config = self.sdk_configuration.retry_config + retry_config = retries + if retry_config is None: + 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(): + try: + req = self.sdk_configuration.get_hooks().before_request( + hook_ctx, + requests_http.Request('GET', url, headers=headers).prepare(), + ) + http_res = client.send(req) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e) + raise e + + if utils.match_status_codes(['400','401','402','403','429','4XX','500','503','5XX'], http_res.status_code): + http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None) + if e: + raise e + else: + result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res) + if isinstance(result, Exception): + raise result + http_res = result + + return http_res + + http_res = utils.retry(do_request, utils.Retries(retry_config, [ + '408', + '429', + '5XX' + ])) + + content_type = http_res.headers.get('Content-Type') + + res = operations.ListWebhookConsumersResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) + + if http_res.status_code == 200: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.WebhookConsumers]) + res.webhook_consumers = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code in [400, 401, 402, 403, 429, 500, 503]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) + out.raw_response = http_res + raise out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: + raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) + + return res + \ No newline at end of file