From e2ec0f20ceeff159cea55dc7f2fc8ca7c0e9a8a6 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 26 Nov 2024 15:15:51 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.446.1 --- .speakeasy/workflow.lock | 17 +- platform/.gitignore | 3 + platform/.speakeasy/gen.lock | 1590 +++++++++++---- platform/.speakeasy/gen.yaml | 20 +- platform/.vscode/settings.json | 6 + platform/CONTRIBUTING.md | 26 + platform/README.md | 456 +++-- platform/RELEASES.md | 12 +- platform/USAGE.md | 45 +- platform/docs/models/errors/errormessage.md | 4 +- .../operations/addcompanytogrouprequest.md | 9 - .../models/operations/addproductrequest.md | 9 + .../configurecustomdatatyperesponse.md | 11 - .../configuresupplementaldataresponse.md | 10 - .../models/operations/createapikeyresponse.md | 11 - .../operations/createconnectionresponse.md | 11 - .../models/operations/creategroupresponse.md | 11 - .../models/operations/createruleresponse.md | 11 - .../createwebhookconsumerresponse.md | 11 - .../models/operations/deleteapikeyresponse.md | 11 - .../operations/deletecompanyresponse.md | 10 - .../operations/deleteconnectionresponse.md | 10 - .../deletewebhookconsumerresponse.md | 10 - ...est.md => getcompanyaccesstokenrequest.md} | 5 +- .../getcompanydatastatusresponse.md | 11 - .../getcompanypushhistoryrequest.md | 2 +- .../getcompanypushhistoryresponse.md | 11 - ...connectionmanagementaccesstokenresponse.md | 11 - ...onnectionmanagementcorssettingsresponse.md | 11 - ...eateupdatemodeloptionsbydatatyperequest.md | 2 +- ...ateupdatemodeloptionsbydatatyperesponse.md | 11 - .../getcustomdatatypeconfigurationresponse.md | 11 - .../operations/getintegrationresponse.md | 11 - .../models/operations/getprofileresponse.md | 11 - .../getprofilesyncsettingsresponse.md | 11 - .../operations/getpulloperationresponse.md | 11 - .../operations/getpushoperationresponse.md | 11 - ...etsupplementaldataconfigurationresponse.md | 11 - .../models/operations/getwebhookresponse.md | 11 - .../models/operations/listapikeysresponse.md | 11 - .../models/operations/listcompaniesrequest.md | 2 +- .../operations/listcompaniesresponse.md | 11 - .../operations/listconnectionsrequest.md | 2 +- .../operations/listconnectionsresponse.md | 11 - .../listcustomdatatyperecordsresponse.md | 11 - .../models/operations/listgroupsresponse.md | 11 - .../operations/listintegrationsrequest.md | 2 +- .../operations/listintegrationsresponse.md | 11 - .../operations/listpulloperationsrequest.md | 2 +- .../operations/listpulloperationsresponse.md | 11 - .../models/operations/listrulesrequest.md | 2 +- .../models/operations/listrulesresponse.md | 11 - .../listwebhookconsumersresponse.md | 11 - .../operations/refreshcompanydataresponse.md | 10 - .../refreshcustomdatatyperesponse.md | 11 - .../operations/refreshdatatyperequest.md | 2 +- .../operations/refreshdatatyperesponse.md | 11 - .../removecompanyfromgroupresponse.md | 10 - .../models/operations/removeproductrequest.md | 9 + ...onnectionmanagementcorssettingsresponse.md | 11 - .../operations/unlinkconnectionresponse.md | 11 - .../updateconnectionauthorizationresponse.md | 11 - .../operations/updateprofileresponse.md | 11 - .../updateprofilesyncsettingsresponse.md | 10 - platform/docs/models/shared/apikeydetails.md | 2 +- .../shared/clientratelimitresetwebhookdata.md | 2 +- .../clientratelimitwebhook.md} | 14 +- .../clientratelimitwebhookpayload.md} | 13 +- platform/docs/models/shared/company.md | 8 +- .../docs/models/shared/companyaccesstoken.md | 12 + platform/docs/models/shared/companydetails.md | 18 + .../models/shared/companygroupassignment.md | 8 - .../docs/models/shared/companyreference.md | 12 + .../models/shared/companyreferencelinks.md | 10 + .../docs/models/shared/companyrequestbody.md | 2 +- .../companywebhook.md} | 14 +- platform/docs/models/shared/connection.md | 1 - .../connectionmanagementallowedorigins.md | 2 + .../connectionwebhook.md} | 14 +- .../connectionwebhookpayload.md} | 12 +- platform/docs/models/shared/createapikey.md | 2 +- .../docs/models/shared/dataconnectionerror.md | 8 +- platform/docs/models/shared/datastatus.md | 2 +- .../docs/models/shared/datastatusdatatypes.md | 52 + platform/docs/models/shared/datatypes.md | 55 +- .../datatypewritewebhook.md} | 14 +- .../shared/datatypewritewebhookpayload.md | 16 + .../shared/datatypewritewebhookrecord.md | 8 + platform/docs/models/shared/errormessage.md | 16 + platform/docs/models/shared/errorstatus.md | 11 + .../docs/models/shared/errorvalidationitem.md | 6 +- platform/docs/models/shared/group.md | 11 - platform/docs/models/shared/groupprototype.md | 10 - platform/docs/models/shared/groupref.md | 8 - platform/docs/models/shared/groups.md | 8 - .../shared/newcompanysynchronizedwebhook.md | 1 - .../newcompanysynchronizedwebhookdata.md | 7 - platform/docs/models/shared/pulloperation.md | 4 +- .../docs/models/shared/pushfieldvalidation.md | 2 +- platform/docs/models/shared/pushoperation.md | 6 +- .../docs/models/shared/pushoperationchange.md | 2 +- .../models/shared/readcompletedwebhook.md | 11 + .../shared/readcompletedwebhookpayload.md | 10 + platform/docs/models/shared/validationitem.md | 6 +- .../docs/models/shared/webhookconsumer.md | 15 +- .../models/shared/webhookconsumerprototype.md | 13 +- platform/docs/models/shared/writestatus.md | 13 + platform/docs/models/shared/writetype.md | 13 + .../clientratelimitreachedresponse.md | 10 - .../webhooks/clientratelimitresetresponse.md | 10 - ...panydataconnectionstatuschangedresponse.md | 10 - .../webhooks/datasetdatachangedresponse.md | 10 - ...tstatushaschangedtoanerrorstateresponse.md | 10 - .../webhooks/datasynccompletedresponse.md | 10 - .../newcompanysynchronizedresponse.md | 10 - .../pushoperationhastimedoutresponse.md | 10 - .../pushoperationstatushaschangedresponse.md | 10 - platform/docs/sdks/codatplatform/README.md | 3 - platform/docs/sdks/companies/README.md | 314 ++- .../docs/sdks/connectionmanagement/README.md | 41 +- platform/docs/sdks/connections/README.md | 235 +-- platform/docs/sdks/corssettings/README.md | 79 +- platform/docs/sdks/customdatatype/README.md | 191 +- platform/docs/sdks/groups/README.md | 207 -- platform/docs/sdks/integrations/README.md | 112 +- platform/docs/sdks/pushdata/README.md | 130 +- platform/docs/sdks/refreshdata/README.md | 186 +- platform/docs/sdks/settings/README.md | 274 ++- platform/docs/sdks/supplementaldata/README.md | 90 +- platform/docs/sdks/webhooks/README.md | 251 ++- platform/poetry.lock | 557 ++++++ platform/poetry.toml | 2 + platform/pylintrc | 44 +- platform/pyproject.toml | 55 + platform/scripts/prepare-readme.py | 33 + platform/scripts/publish.sh | 7 + platform/setup.py | 55 - platform/src/codat_platform/__init__.py | 8 + .../src/codat_platform/_hooks/__init__.py | 5 + .../src/codat_platform/_hooks/registration.py | 13 + .../_hooks/sdkhooks.py | 35 +- .../_hooks/types.py | 42 +- platform/src/codat_platform/_version.py | 12 + platform/src/codat_platform/basesdk.py | 339 ++++ platform/src/codat_platform/companies.py | 1752 +++++++++++++++++ .../codat_platform/connection_management.py | 246 +++ platform/src/codat_platform/connections.py | 1316 +++++++++++++ platform/src/codat_platform/cors_settings.py | 456 +++++ .../src/codat_platform/custom_data_type.py | 924 +++++++++ platform/src/codat_platform/httpclient.py | 84 + platform/src/codat_platform/integrations.py | 644 ++++++ .../codat_platform/models/errors/__init__.py | 6 + .../models/errors/errormessage.py | 50 + .../codat_platform/models/errors/sdkerror.py | 22 + .../models/operations/__init__.py | 181 ++ .../models/operations/add_product.py | 30 + .../operations/configure_custom_data_type.py | 44 + .../operations/configure_supplemental_data.py | 71 + .../models/operations/create_connection.py | 38 + .../models/operations/delete_api_key.py | 21 + .../models/operations/delete_company.py | 21 + .../models/operations/delete_connection.py | 30 + .../operations/delete_webhook_consumer.py | 21 + .../models/operations/get_company.py | 21 + .../operations/get_company_access_token.py | 21 + .../operations/get_company_data_status.py | 21 + .../operations/get_company_push_history.py | 56 + .../models/operations/get_connection.py | 30 + .../get_connection_management_access_token.py | 21 + ...reate_update_model_options_by_data_type.py | 40 + .../get_custom_data_type_configuration.py | 30 + .../models/operations/get_integration.py | 21 + .../operations/get_integrations_branding.py | 21 + .../models/operations/get_pull_operation.py | 30 + .../models/operations/get_push_operation.py | 30 + .../get_supplemental_data_configuration.py | 57 + .../models/operations/get_webhook.py | 21 + .../models/operations/list_companies.py | 47 + .../models/operations/list_connections.py | 56 + .../list_custom_data_type_records.py | 57 + .../models/operations/list_integrations.py | 47 + .../models/operations/list_pull_operations.py | 56 + .../models/operations/list_rules.py | 47 + .../models/operations/refresh_company_data.py | 21 + .../operations/refresh_custom_data_type.py | 39 + .../models/operations/refresh_data_type.py | 41 + .../models/operations/remove_product.py | 30 + .../models/operations/unlink_connection.py | 42 + .../models/operations/update_company.py | 31 + .../update_connection_authorization.py | 37 + .../operations/update_profile_syncsettings.py | 36 + .../codat_platform/models/shared/__init__.py | 405 ++++ .../models/shared/apikeydetails.py | 111 ++ .../codat_platform/models/shared/apikeys.py | 15 + .../codat_platform/models/shared/branding.py | 29 + .../models/shared/brandingbutton.py | 22 + .../models/shared/brandingimage.py | 17 + .../models/shared/brandinglogo.py | 22 + .../shared/clientratelimitreachedwebhook.py | 61 + .../clientratelimitreachedwebhookdata.py | 60 + .../shared/clientratelimitresetwebhook.py | 61 + .../shared/clientratelimitresetwebhookdata.py | 109 + .../models/shared/clientratelimitwebhook.py | 74 + .../shared/clientratelimitwebhookpayload.py | 67 + .../codat_platform/models/shared/companies.py | 35 + .../codat_platform/models/shared/company.py | 216 ++ .../models/shared/companyaccesstoken.py | 30 + .../models/shared/companydetails.py | 195 ++ .../models/shared/companyreference.py | 50 + .../models/shared/companyrequestbody.py | 26 + .../models/shared/companywebhook.py | 71 + .../models/shared/connection.py | 213 ++ .../shared/connectionmanagementaccesstoken.py | 17 + .../connectionmanagementallowedorigins.py | 23 + .../models/shared/connections.py | 35 + .../shared/connectionstatuschangedwebhook.py | 73 + .../connectionstatuschangedwebhookdata.py | 39 + .../models/shared/connectionwebhook.py | 74 + .../models/shared/connectionwebhookpayload.py | 44 + .../models/shared/createapikey.py | 56 + .../models/shared/createrule.py | 30 + .../shared/customdatatypeconfiguration.py | 77 + .../models/shared/customdatatyperecord.py | 43 + .../models/shared/customdatatyperecords.py | 35 + .../models/shared/dataconnectionerror.py | 174 ++ .../models/shared/dataconnectionstatus.py | 13 + .../shared/datasetdatachangedwebhook.py | 85 + .../datasetstatuschangederrorwebhook.py | 73 + .../datasetstatuschangederrorwebhookdata.py | 30 + .../models/shared/datastatus.py | 133 ++ .../models/shared/datastatuses.py | 294 +++ .../models/shared/datasynccompletedwebhook.py | 73 + .../shared/datasynccompletedwebhookdata.py | 23 + .../codat_platform/models/shared/datatype.py | 52 + .../models/shared/datatypefeature.py | 28 + .../models/shared/datatypewritewebhook.py | 74 + .../shared/datatypewritewebhookpayload.py | 191 ++ .../shared/datatypewritewebhookrecord.py | 16 + .../models/shared/errormessage.py | 103 + .../models/shared/errorvalidation.py | 59 + .../models/shared/errorvalidationitem.py | 65 + .../models/shared/featurestate.py | 15 + .../models/shared/featuretype.py | 19 + .../codat_platform/models/shared/halref.py | 16 + .../models/shared/imagereference.py | 25 + .../models/shared/integration.py | 81 + .../models/shared/integrations.py | 35 + .../src/codat_platform/models/shared/links.py | 25 + .../shared/newcompanysynchronizedwebhook.py | 64 + .../codat_platform/models/shared/profile.py | 72 + .../models/shared/pulloperation.py | 224 +++ .../models/shared/pulloperations.py | 35 + .../models/shared/pushchangetype.py | 14 + .../models/shared/pushfieldvalidation.py | 63 + .../models/shared/pushoperation.py | 219 +++ .../models/shared/pushoperationchange.py | 68 + .../models/shared/pushoperationref.py | 23 + .../models/shared/pushoperations.py | 35 + .../models/shared/pushoperationstatus.py | 13 + .../pushoperationstatuschangedwebhook.py | 73 + .../pushoperationstatuschangedwebhookdata.py | 31 + .../shared/pushoperationtimedoutwebhook.py | 73 + .../pushoperationtimedoutwebhookdata.py | 32 + .../models/shared/pushoption.py | 82 + .../models/shared/pushoptionchoice.py | 38 + .../models/shared/pushoptionproperty.py | 81 + .../models/shared/pushoptiontype.py | 17 + .../models/shared/pushvalidationinfo.py | 55 + .../models/shared/readcompletedwebhook.py | 74 + .../shared/readcompletedwebhookpayload.py | 97 + .../models/shared/schema_datatype.py | 52 + .../codat_platform/models/shared/security.py | 24 + .../models/shared/sourcetype.py | 16 + .../codat_platform/models/shared/status.py | 30 + .../shared/supplementaldataconfiguration.py | 48 + .../models/shared/supportedfeature.py | 23 + .../models/shared/syncsetting.py | 99 + .../models/shared/syncsettings.py | 28 + .../models/shared/updateconnectionstatus.py | 17 + .../models/shared/validation.py | 59 + .../models/shared/validationitem.py | 65 + .../codat_platform/models/shared/webhook.py | 35 + .../models/shared/webhookconsumer.py | 108 + .../models/shared/webhookconsumerprototype.py | 84 + .../models/shared/webhookconsumers.py | 15 + .../models/shared/webhooknotifier.py | 19 + .../codat_platform/models/shared/webhooks.py | 35 + .../models/shared/writestatus.py | 13 + .../codat_platform/models/shared/writetype.py | 13 + platform/src/codat_platform/push_data.py | 674 +++++++ platform/src/codat_platform/py.typed | 1 + platform/src/codat_platform/refresh_data.py | 1076 ++++++++++ .../{codatplatform => codat_platform}/sdk.py | 148 +- .../src/codat_platform/sdkconfiguration.py | 48 + platform/src/codat_platform/settings.py | 1378 +++++++++++++ .../src/codat_platform/supplemental_data.py | 472 +++++ platform/src/codat_platform/types/__init__.py | 21 + .../src/codat_platform/types/basemodel.py | 39 + platform/src/codat_platform/utils/__init__.py | 97 + .../src/codat_platform/utils/annotations.py | 55 + platform/src/codat_platform/utils/enums.py | 34 + .../codat_platform/utils/eventstreaming.py | 238 +++ platform/src/codat_platform/utils/forms.py | 208 ++ platform/src/codat_platform/utils/headers.py | 136 ++ platform/src/codat_platform/utils/logger.py | 22 + platform/src/codat_platform/utils/metadata.py | 118 ++ .../src/codat_platform/utils/queryparams.py | 205 ++ .../src/codat_platform/utils/requestbodies.py | 66 + platform/src/codat_platform/utils/retries.py | 217 ++ platform/src/codat_platform/utils/security.py | 174 ++ .../src/codat_platform/utils/serializers.py | 215 ++ platform/src/codat_platform/utils/url.py | 155 ++ platform/src/codat_platform/utils/values.py | 134 ++ platform/src/codat_platform/webhooks.py | 1293 ++++++++++++ platform/src/codatplatform/__init__.py | 4 - platform/src/codatplatform/_hooks/__init__.py | 5 - platform/src/codatplatform/companies.py | 443 ----- .../codatplatform/connection_management.py | 107 - platform/src/codatplatform/connections.py | 512 ----- platform/src/codatplatform/cors_settings.py | 190 -- .../src/codatplatform/custom_data_type.py | 360 ---- platform/src/codatplatform/groups.py | 356 ---- platform/src/codatplatform/integrations.py | 262 --- platform/src/codatplatform/models/__init__.py | 4 - .../codatplatform/models/errors/__init__.py | 6 - .../models/errors/errormessage.py | 34 - .../codatplatform/models/errors/sdkerror.py | 24 - .../models/operations/__init__.py | 52 - .../models/operations/add_company_to_group.py | 31 - .../operations/configure_custom_data_type.py | 33 - .../operations/configure_supplemental_data.py | 56 - .../models/operations/create_api_key.py | 22 - .../models/operations/create_company.py | 21 - .../models/operations/create_connection.py | 41 - .../models/operations/create_group.py | 21 - .../models/operations/create_rule.py | 21 - .../operations/create_webhook_consumer.py | 21 - .../models/operations/delete_api_key.py | 29 - .../models/operations/delete_company.py | 25 - .../models/operations/delete_connection.py | 27 - .../operations/delete_webhook_consumer.py | 25 - .../models/operations/get_company.py | 29 - .../operations/get_company_data_status.py | 29 - .../operations/get_company_push_history.py | 37 - .../models/operations/get_connection.py | 31 - .../get_connection_management_access_token.py | 29 - ...get_connection_management_cors_settings.py | 21 - ...reate_update_model_options_by_data_type.py | 34 - .../get_custom_data_type_configuration.py | 31 - .../models/operations/get_integration.py | 29 - .../operations/get_integrations_branding.py | 29 - .../models/operations/get_profile.py | 21 - .../operations/get_profile_syncsettings.py | 21 - .../models/operations/get_pull_operation.py | 31 - .../models/operations/get_push_operation.py | 31 - .../get_supplemental_data_configuration.py | 56 - .../models/operations/get_webhook.py | 29 - .../models/operations/list_api_keys.py | 21 - .../models/operations/list_companies.py | 35 - .../models/operations/list_connections.py | 37 - .../list_custom_data_type_records.py | 37 - .../models/operations/list_groups.py | 21 - .../models/operations/list_integrations.py | 35 - .../models/operations/list_pull_operations.py | 37 - .../models/operations/list_rules.py | 35 - .../operations/list_webhook_consumers.py | 21 - .../models/operations/refresh_company_data.py | 25 - .../operations/refresh_custom_data_type.py | 33 - .../models/operations/refresh_data_type.py | 34 - .../operations/remove_company_from_group.py | 27 - ...set_connection_management_cors_settings.py | 21 - .../models/operations/unlink_connection.py | 33 - .../models/operations/update_company.py | 31 - .../update_connection_authorization.py | 32 - .../models/operations/update_profile.py | 21 - .../operations/update_profile_syncsettings.py | 36 - .../codatplatform/models/shared/__init__.py | 91 - .../models/shared/apikeydetails.py | 43 - .../codatplatform/models/shared/apikeys.py | 16 - .../codatplatform/models/shared/branding.py | 22 - .../models/shared/brandingbutton.py | 18 - .../models/shared/brandingimage.py | 17 - .../models/shared/brandinglogo.py | 18 - .../shared/clientratelimitreachedwebhook.py | 32 - .../clientratelimitreachedwebhookdata.py | 37 - .../shared/clientratelimitresetwebhook.py | 32 - .../shared/clientratelimitresetwebhookdata.py | 42 - .../codatplatform/models/shared/companies.py | 24 - .../codatplatform/models/shared/company.py | 82 - .../models/shared/companygroupassignment.py | 15 - .../models/shared/companyrequestbody.py | 21 - .../codatplatform/models/shared/connection.py | 89 - .../shared/connectionmanagementaccesstoken.py | 16 - .../connectionmanagementallowedorigins.py | 16 - .../models/shared/connections.py | 24 - .../shared/connectionstatuschangedwebhook.py | 36 - .../connectionstatuschangedwebhookdata.py | 23 - .../models/shared/createapikey.py | 18 - .../codatplatform/models/shared/createrule.py | 21 - .../shared/customdatatypeconfiguration.py | 24 - .../models/shared/customdatatyperecord.py | 32 - .../models/shared/customdatatyperecords.py | 23 - .../models/shared/dataconnectionerror.py | 41 - .../models/shared/dataconnectionstatus.py | 11 - .../shared/datasetdatachangedwebhook.py | 47 - .../datasetstatuschangederrorwebhook.py | 36 - .../datasetstatuschangederrorwebhookdata.py | 21 - .../codatplatform/models/shared/datastatus.py | 92 - .../models/shared/datastatuses.py | 101 - .../models/shared/datasynccompletedwebhook.py | 36 - .../shared/datasynccompletedwebhookdata.py | 19 - .../codatplatform/models/shared/datatype.py | 50 - .../models/shared/datatypefeature.py | 20 - .../models/shared/errorvalidation.py | 19 - .../models/shared/errorvalidationitem.py | 21 - .../models/shared/featurestate.py | 13 - .../models/shared/featuretype.py | 17 - .../src/codatplatform/models/shared/group.py | 19 - .../models/shared/groupprototype.py | 17 - .../codatplatform/models/shared/groupref.py | 16 - .../src/codatplatform/models/shared/groups.py | 16 - .../src/codatplatform/models/shared/halref.py | 16 - .../models/shared/imagereference.py | 19 - .../models/shared/integration.py | 38 - .../models/shared/integrations.py | 24 - .../src/codatplatform/models/shared/links.py | 19 - .../shared/newcompanysynchronizedwebhook.py | 36 - .../newcompanysynchronizedwebhookdata.py | 9 - .../codatplatform/models/shared/profile.py | 37 - .../models/shared/pulloperation.py | 105 - .../models/shared/pulloperations.py | 24 - .../models/shared/pushchangetype.py | 12 - .../models/shared/pushfieldvalidation.py | 21 - .../models/shared/pushoperation.py | 86 - .../models/shared/pushoperationchange.py | 22 - .../models/shared/pushoperationref.py | 19 - .../models/shared/pushoperations.py | 24 - .../models/shared/pushoperationstatus.py | 11 - .../pushoperationstatuschangedwebhook.py | 36 - .../pushoperationstatuschangedwebhookdata.py | 22 - .../shared/pushoperationtimedoutwebhook.py | 36 - .../pushoperationtimedoutwebhookdata.py | 21 - .../codatplatform/models/shared/pushoption.py | 30 - .../models/shared/pushoptionchoice.py | 25 - .../models/shared/pushoptionproperty.py | 29 - .../models/shared/pushoptiontype.py | 15 - .../models/shared/pushvalidationinfo.py | 18 - .../models/shared/schema_datatype.py | 50 - .../codatplatform/models/shared/security.py | 11 - .../codatplatform/models/shared/sourcetype.py | 14 - .../src/codatplatform/models/shared/status.py | 28 - .../shared/supplementaldataconfiguration.py | 29 - .../models/shared/supportedfeature.py | 19 - .../models/shared/syncsetting.py | 51 - .../models/shared/syncsettings.py | 20 - .../models/shared/updateconnectionstatus.py | 17 - .../codatplatform/models/shared/validation.py | 19 - .../models/shared/validationitem.py | 21 - .../codatplatform/models/shared/webhook.py | 23 - .../models/shared/webhookconsumer.py | 29 - .../models/shared/webhookconsumerprototype.py | 23 - .../models/shared/webhookconsumers.py | 16 - .../models/shared/webhooknotifier.py | 17 - .../codatplatform/models/shared/webhooks.py | 24 - .../codatplatform/models/webhooks/__init__.py | 13 - .../webhooks/client_rate_limit_reached.py | 17 - .../webhooks/client_rate_limit_reset.py | 17 - .../company_data_connection_status_changed.py | 17 - .../models/webhooks/data_sync_completed.py | 17 - .../models/webhooks/dataset_data_changed.py | 17 - ...et_status_has_changed_to_an_error_state.py | 17 - .../webhooks/new_company_synchronized.py | 17 - .../webhooks/push_operation_has_timed_out.py | 17 - .../push_operation_status_has_changed.py | 17 - platform/src/codatplatform/push_data.py | 271 --- platform/src/codatplatform/refresh_data.py | 426 ---- .../src/codatplatform/sdkconfiguration.py | 45 - platform/src/codatplatform/settings.py | 612 ------ .../src/codatplatform/supplemental_data.py | 185 -- platform/src/codatplatform/utils/__init__.py | 4 - platform/src/codatplatform/utils/retries.py | 119 -- platform/src/codatplatform/utils/utils.py | 1060 ---------- platform/src/codatplatform/webhooks.py | 518 ----- platform/tests/helpers.py | 61 - 484 files changed, 24553 insertions(+), 12472 deletions(-) create mode 100644 platform/.vscode/settings.json create mode 100644 platform/CONTRIBUTING.md delete mode 100644 platform/docs/models/operations/addcompanytogrouprequest.md create mode 100644 platform/docs/models/operations/addproductrequest.md delete mode 100644 platform/docs/models/operations/configurecustomdatatyperesponse.md delete mode 100644 platform/docs/models/operations/configuresupplementaldataresponse.md delete mode 100644 platform/docs/models/operations/createapikeyresponse.md delete mode 100644 platform/docs/models/operations/createconnectionresponse.md delete mode 100644 platform/docs/models/operations/creategroupresponse.md delete mode 100644 platform/docs/models/operations/createruleresponse.md delete mode 100644 platform/docs/models/operations/createwebhookconsumerresponse.md delete mode 100644 platform/docs/models/operations/deleteapikeyresponse.md delete mode 100644 platform/docs/models/operations/deletecompanyresponse.md delete mode 100644 platform/docs/models/operations/deleteconnectionresponse.md delete mode 100644 platform/docs/models/operations/deletewebhookconsumerresponse.md rename platform/docs/models/operations/{removecompanyfromgrouprequest.md => getcompanyaccesstokenrequest.md} (72%) delete mode 100644 platform/docs/models/operations/getcompanydatastatusresponse.md delete mode 100644 platform/docs/models/operations/getcompanypushhistoryresponse.md delete mode 100644 platform/docs/models/operations/getconnectionmanagementaccesstokenresponse.md delete mode 100644 platform/docs/models/operations/getconnectionmanagementcorssettingsresponse.md delete mode 100644 platform/docs/models/operations/getcreateupdatemodeloptionsbydatatyperesponse.md delete mode 100644 platform/docs/models/operations/getcustomdatatypeconfigurationresponse.md delete mode 100644 platform/docs/models/operations/getintegrationresponse.md delete mode 100644 platform/docs/models/operations/getprofileresponse.md delete mode 100644 platform/docs/models/operations/getprofilesyncsettingsresponse.md delete mode 100644 platform/docs/models/operations/getpulloperationresponse.md delete mode 100644 platform/docs/models/operations/getpushoperationresponse.md delete mode 100644 platform/docs/models/operations/getsupplementaldataconfigurationresponse.md delete mode 100644 platform/docs/models/operations/getwebhookresponse.md delete mode 100644 platform/docs/models/operations/listapikeysresponse.md delete mode 100644 platform/docs/models/operations/listcompaniesresponse.md delete mode 100644 platform/docs/models/operations/listconnectionsresponse.md delete mode 100644 platform/docs/models/operations/listcustomdatatyperecordsresponse.md delete mode 100644 platform/docs/models/operations/listgroupsresponse.md delete mode 100644 platform/docs/models/operations/listintegrationsresponse.md delete mode 100644 platform/docs/models/operations/listpulloperationsresponse.md delete mode 100644 platform/docs/models/operations/listrulesresponse.md delete mode 100644 platform/docs/models/operations/listwebhookconsumersresponse.md delete mode 100644 platform/docs/models/operations/refreshcompanydataresponse.md delete mode 100644 platform/docs/models/operations/refreshcustomdatatyperesponse.md delete mode 100644 platform/docs/models/operations/refreshdatatyperesponse.md delete mode 100644 platform/docs/models/operations/removecompanyfromgroupresponse.md create mode 100644 platform/docs/models/operations/removeproductrequest.md delete mode 100644 platform/docs/models/operations/setconnectionmanagementcorssettingsresponse.md delete mode 100644 platform/docs/models/operations/unlinkconnectionresponse.md delete mode 100644 platform/docs/models/operations/updateconnectionauthorizationresponse.md delete mode 100644 platform/docs/models/operations/updateprofileresponse.md delete mode 100644 platform/docs/models/operations/updateprofilesyncsettingsresponse.md rename platform/docs/models/{operations/createcompanyresponse.md => shared/clientratelimitwebhook.md} (82%) rename platform/docs/models/{operations/getintegrationsbrandingresponse.md => shared/clientratelimitwebhookpayload.md} (80%) create mode 100644 platform/docs/models/shared/companyaccesstoken.md create mode 100644 platform/docs/models/shared/companydetails.md delete mode 100644 platform/docs/models/shared/companygroupassignment.md create mode 100644 platform/docs/models/shared/companyreference.md create mode 100644 platform/docs/models/shared/companyreferencelinks.md rename platform/docs/models/{operations/getcompanyresponse.md => shared/companywebhook.md} (82%) rename platform/docs/models/{operations/updatecompanyresponse.md => shared/connectionwebhook.md} (82%) rename platform/docs/models/{operations/getconnectionresponse.md => shared/connectionwebhookpayload.md} (63%) create mode 100644 platform/docs/models/shared/datastatusdatatypes.md rename platform/docs/models/{operations/addcompanytogroupresponse.md => shared/datatypewritewebhook.md} (82%) create mode 100644 platform/docs/models/shared/datatypewritewebhookpayload.md create mode 100644 platform/docs/models/shared/datatypewritewebhookrecord.md create mode 100644 platform/docs/models/shared/errormessage.md create mode 100644 platform/docs/models/shared/errorstatus.md delete mode 100644 platform/docs/models/shared/group.md delete mode 100644 platform/docs/models/shared/groupprototype.md delete mode 100644 platform/docs/models/shared/groupref.md delete mode 100644 platform/docs/models/shared/groups.md delete mode 100644 platform/docs/models/shared/newcompanysynchronizedwebhookdata.md create mode 100644 platform/docs/models/shared/readcompletedwebhook.md create mode 100644 platform/docs/models/shared/readcompletedwebhookpayload.md create mode 100644 platform/docs/models/shared/writestatus.md create mode 100644 platform/docs/models/shared/writetype.md delete mode 100644 platform/docs/models/webhooks/clientratelimitreachedresponse.md delete mode 100644 platform/docs/models/webhooks/clientratelimitresetresponse.md delete mode 100644 platform/docs/models/webhooks/companydataconnectionstatuschangedresponse.md delete mode 100644 platform/docs/models/webhooks/datasetdatachangedresponse.md delete mode 100644 platform/docs/models/webhooks/datasetstatushaschangedtoanerrorstateresponse.md delete mode 100644 platform/docs/models/webhooks/datasynccompletedresponse.md delete mode 100644 platform/docs/models/webhooks/newcompanysynchronizedresponse.md delete mode 100644 platform/docs/models/webhooks/pushoperationhastimedoutresponse.md delete mode 100644 platform/docs/models/webhooks/pushoperationstatushaschangedresponse.md delete mode 100644 platform/docs/sdks/groups/README.md create mode 100644 platform/poetry.lock create mode 100644 platform/poetry.toml create mode 100644 platform/pyproject.toml create mode 100644 platform/scripts/prepare-readme.py create mode 100755 platform/scripts/publish.sh delete mode 100644 platform/setup.py create mode 100644 platform/src/codat_platform/__init__.py create mode 100644 platform/src/codat_platform/_hooks/__init__.py create mode 100644 platform/src/codat_platform/_hooks/registration.py rename platform/src/{codatplatform => codat_platform}/_hooks/sdkhooks.py (65%) rename platform/src/{codatplatform => codat_platform}/_hooks/types.py (51%) create mode 100644 platform/src/codat_platform/_version.py create mode 100644 platform/src/codat_platform/basesdk.py create mode 100644 platform/src/codat_platform/companies.py create mode 100644 platform/src/codat_platform/connection_management.py create mode 100644 platform/src/codat_platform/connections.py create mode 100644 platform/src/codat_platform/cors_settings.py create mode 100644 platform/src/codat_platform/custom_data_type.py create mode 100644 platform/src/codat_platform/httpclient.py create mode 100644 platform/src/codat_platform/integrations.py create mode 100644 platform/src/codat_platform/models/errors/__init__.py create mode 100644 platform/src/codat_platform/models/errors/errormessage.py create mode 100644 platform/src/codat_platform/models/errors/sdkerror.py create mode 100644 platform/src/codat_platform/models/operations/__init__.py create mode 100644 platform/src/codat_platform/models/operations/add_product.py create mode 100644 platform/src/codat_platform/models/operations/configure_custom_data_type.py create mode 100644 platform/src/codat_platform/models/operations/configure_supplemental_data.py create mode 100644 platform/src/codat_platform/models/operations/create_connection.py create mode 100644 platform/src/codat_platform/models/operations/delete_api_key.py create mode 100644 platform/src/codat_platform/models/operations/delete_company.py create mode 100644 platform/src/codat_platform/models/operations/delete_connection.py create mode 100644 platform/src/codat_platform/models/operations/delete_webhook_consumer.py create mode 100644 platform/src/codat_platform/models/operations/get_company.py create mode 100644 platform/src/codat_platform/models/operations/get_company_access_token.py create mode 100644 platform/src/codat_platform/models/operations/get_company_data_status.py create mode 100644 platform/src/codat_platform/models/operations/get_company_push_history.py create mode 100644 platform/src/codat_platform/models/operations/get_connection.py create mode 100644 platform/src/codat_platform/models/operations/get_connection_management_access_token.py create mode 100644 platform/src/codat_platform/models/operations/get_create_update_model_options_by_data_type.py create mode 100644 platform/src/codat_platform/models/operations/get_custom_data_type_configuration.py create mode 100644 platform/src/codat_platform/models/operations/get_integration.py create mode 100644 platform/src/codat_platform/models/operations/get_integrations_branding.py create mode 100644 platform/src/codat_platform/models/operations/get_pull_operation.py create mode 100644 platform/src/codat_platform/models/operations/get_push_operation.py create mode 100644 platform/src/codat_platform/models/operations/get_supplemental_data_configuration.py create mode 100644 platform/src/codat_platform/models/operations/get_webhook.py create mode 100644 platform/src/codat_platform/models/operations/list_companies.py create mode 100644 platform/src/codat_platform/models/operations/list_connections.py create mode 100644 platform/src/codat_platform/models/operations/list_custom_data_type_records.py create mode 100644 platform/src/codat_platform/models/operations/list_integrations.py create mode 100644 platform/src/codat_platform/models/operations/list_pull_operations.py create mode 100644 platform/src/codat_platform/models/operations/list_rules.py create mode 100644 platform/src/codat_platform/models/operations/refresh_company_data.py create mode 100644 platform/src/codat_platform/models/operations/refresh_custom_data_type.py create mode 100644 platform/src/codat_platform/models/operations/refresh_data_type.py create mode 100644 platform/src/codat_platform/models/operations/remove_product.py create mode 100644 platform/src/codat_platform/models/operations/unlink_connection.py create mode 100644 platform/src/codat_platform/models/operations/update_company.py create mode 100644 platform/src/codat_platform/models/operations/update_connection_authorization.py create mode 100644 platform/src/codat_platform/models/operations/update_profile_syncsettings.py create mode 100644 platform/src/codat_platform/models/shared/__init__.py create mode 100644 platform/src/codat_platform/models/shared/apikeydetails.py create mode 100644 platform/src/codat_platform/models/shared/apikeys.py create mode 100644 platform/src/codat_platform/models/shared/branding.py create mode 100644 platform/src/codat_platform/models/shared/brandingbutton.py create mode 100644 platform/src/codat_platform/models/shared/brandingimage.py create mode 100644 platform/src/codat_platform/models/shared/brandinglogo.py create mode 100644 platform/src/codat_platform/models/shared/clientratelimitreachedwebhook.py create mode 100644 platform/src/codat_platform/models/shared/clientratelimitreachedwebhookdata.py create mode 100644 platform/src/codat_platform/models/shared/clientratelimitresetwebhook.py create mode 100644 platform/src/codat_platform/models/shared/clientratelimitresetwebhookdata.py create mode 100644 platform/src/codat_platform/models/shared/clientratelimitwebhook.py create mode 100644 platform/src/codat_platform/models/shared/clientratelimitwebhookpayload.py create mode 100644 platform/src/codat_platform/models/shared/companies.py create mode 100644 platform/src/codat_platform/models/shared/company.py create mode 100644 platform/src/codat_platform/models/shared/companyaccesstoken.py create mode 100644 platform/src/codat_platform/models/shared/companydetails.py create mode 100644 platform/src/codat_platform/models/shared/companyreference.py create mode 100644 platform/src/codat_platform/models/shared/companyrequestbody.py create mode 100644 platform/src/codat_platform/models/shared/companywebhook.py create mode 100644 platform/src/codat_platform/models/shared/connection.py create mode 100644 platform/src/codat_platform/models/shared/connectionmanagementaccesstoken.py create mode 100644 platform/src/codat_platform/models/shared/connectionmanagementallowedorigins.py create mode 100644 platform/src/codat_platform/models/shared/connections.py create mode 100644 platform/src/codat_platform/models/shared/connectionstatuschangedwebhook.py create mode 100644 platform/src/codat_platform/models/shared/connectionstatuschangedwebhookdata.py create mode 100644 platform/src/codat_platform/models/shared/connectionwebhook.py create mode 100644 platform/src/codat_platform/models/shared/connectionwebhookpayload.py create mode 100644 platform/src/codat_platform/models/shared/createapikey.py create mode 100644 platform/src/codat_platform/models/shared/createrule.py create mode 100644 platform/src/codat_platform/models/shared/customdatatypeconfiguration.py create mode 100644 platform/src/codat_platform/models/shared/customdatatyperecord.py create mode 100644 platform/src/codat_platform/models/shared/customdatatyperecords.py create mode 100644 platform/src/codat_platform/models/shared/dataconnectionerror.py create mode 100644 platform/src/codat_platform/models/shared/dataconnectionstatus.py create mode 100644 platform/src/codat_platform/models/shared/datasetdatachangedwebhook.py create mode 100644 platform/src/codat_platform/models/shared/datasetstatuschangederrorwebhook.py create mode 100644 platform/src/codat_platform/models/shared/datasetstatuschangederrorwebhookdata.py create mode 100644 platform/src/codat_platform/models/shared/datastatus.py create mode 100644 platform/src/codat_platform/models/shared/datastatuses.py create mode 100644 platform/src/codat_platform/models/shared/datasynccompletedwebhook.py create mode 100644 platform/src/codat_platform/models/shared/datasynccompletedwebhookdata.py create mode 100644 platform/src/codat_platform/models/shared/datatype.py create mode 100644 platform/src/codat_platform/models/shared/datatypefeature.py create mode 100644 platform/src/codat_platform/models/shared/datatypewritewebhook.py create mode 100644 platform/src/codat_platform/models/shared/datatypewritewebhookpayload.py create mode 100644 platform/src/codat_platform/models/shared/datatypewritewebhookrecord.py create mode 100644 platform/src/codat_platform/models/shared/errormessage.py create mode 100644 platform/src/codat_platform/models/shared/errorvalidation.py create mode 100644 platform/src/codat_platform/models/shared/errorvalidationitem.py create mode 100644 platform/src/codat_platform/models/shared/featurestate.py create mode 100644 platform/src/codat_platform/models/shared/featuretype.py create mode 100644 platform/src/codat_platform/models/shared/halref.py create mode 100644 platform/src/codat_platform/models/shared/imagereference.py create mode 100644 platform/src/codat_platform/models/shared/integration.py create mode 100644 platform/src/codat_platform/models/shared/integrations.py create mode 100644 platform/src/codat_platform/models/shared/links.py create mode 100644 platform/src/codat_platform/models/shared/newcompanysynchronizedwebhook.py create mode 100644 platform/src/codat_platform/models/shared/profile.py create mode 100644 platform/src/codat_platform/models/shared/pulloperation.py create mode 100644 platform/src/codat_platform/models/shared/pulloperations.py create mode 100644 platform/src/codat_platform/models/shared/pushchangetype.py create mode 100644 platform/src/codat_platform/models/shared/pushfieldvalidation.py create mode 100644 platform/src/codat_platform/models/shared/pushoperation.py create mode 100644 platform/src/codat_platform/models/shared/pushoperationchange.py create mode 100644 platform/src/codat_platform/models/shared/pushoperationref.py create mode 100644 platform/src/codat_platform/models/shared/pushoperations.py create mode 100644 platform/src/codat_platform/models/shared/pushoperationstatus.py create mode 100644 platform/src/codat_platform/models/shared/pushoperationstatuschangedwebhook.py create mode 100644 platform/src/codat_platform/models/shared/pushoperationstatuschangedwebhookdata.py create mode 100644 platform/src/codat_platform/models/shared/pushoperationtimedoutwebhook.py create mode 100644 platform/src/codat_platform/models/shared/pushoperationtimedoutwebhookdata.py create mode 100644 platform/src/codat_platform/models/shared/pushoption.py create mode 100644 platform/src/codat_platform/models/shared/pushoptionchoice.py create mode 100644 platform/src/codat_platform/models/shared/pushoptionproperty.py create mode 100644 platform/src/codat_platform/models/shared/pushoptiontype.py create mode 100644 platform/src/codat_platform/models/shared/pushvalidationinfo.py create mode 100644 platform/src/codat_platform/models/shared/readcompletedwebhook.py create mode 100644 platform/src/codat_platform/models/shared/readcompletedwebhookpayload.py create mode 100644 platform/src/codat_platform/models/shared/schema_datatype.py create mode 100644 platform/src/codat_platform/models/shared/security.py create mode 100644 platform/src/codat_platform/models/shared/sourcetype.py create mode 100644 platform/src/codat_platform/models/shared/status.py create mode 100644 platform/src/codat_platform/models/shared/supplementaldataconfiguration.py create mode 100644 platform/src/codat_platform/models/shared/supportedfeature.py create mode 100644 platform/src/codat_platform/models/shared/syncsetting.py create mode 100644 platform/src/codat_platform/models/shared/syncsettings.py create mode 100644 platform/src/codat_platform/models/shared/updateconnectionstatus.py create mode 100644 platform/src/codat_platform/models/shared/validation.py create mode 100644 platform/src/codat_platform/models/shared/validationitem.py create mode 100644 platform/src/codat_platform/models/shared/webhook.py create mode 100644 platform/src/codat_platform/models/shared/webhookconsumer.py create mode 100644 platform/src/codat_platform/models/shared/webhookconsumerprototype.py create mode 100644 platform/src/codat_platform/models/shared/webhookconsumers.py create mode 100644 platform/src/codat_platform/models/shared/webhooknotifier.py create mode 100644 platform/src/codat_platform/models/shared/webhooks.py create mode 100644 platform/src/codat_platform/models/shared/writestatus.py create mode 100644 platform/src/codat_platform/models/shared/writetype.py create mode 100644 platform/src/codat_platform/push_data.py create mode 100644 platform/src/codat_platform/py.typed create mode 100644 platform/src/codat_platform/refresh_data.py rename platform/src/{codatplatform => codat_platform}/sdk.py (52%) create mode 100644 platform/src/codat_platform/sdkconfiguration.py create mode 100644 platform/src/codat_platform/settings.py create mode 100644 platform/src/codat_platform/supplemental_data.py create mode 100644 platform/src/codat_platform/types/__init__.py create mode 100644 platform/src/codat_platform/types/basemodel.py create mode 100644 platform/src/codat_platform/utils/__init__.py create mode 100644 platform/src/codat_platform/utils/annotations.py create mode 100644 platform/src/codat_platform/utils/enums.py create mode 100644 platform/src/codat_platform/utils/eventstreaming.py create mode 100644 platform/src/codat_platform/utils/forms.py create mode 100644 platform/src/codat_platform/utils/headers.py create mode 100644 platform/src/codat_platform/utils/logger.py create mode 100644 platform/src/codat_platform/utils/metadata.py create mode 100644 platform/src/codat_platform/utils/queryparams.py create mode 100644 platform/src/codat_platform/utils/requestbodies.py create mode 100644 platform/src/codat_platform/utils/retries.py create mode 100644 platform/src/codat_platform/utils/security.py create mode 100644 platform/src/codat_platform/utils/serializers.py create mode 100644 platform/src/codat_platform/utils/url.py create mode 100644 platform/src/codat_platform/utils/values.py create mode 100644 platform/src/codat_platform/webhooks.py delete mode 100644 platform/src/codatplatform/__init__.py delete mode 100644 platform/src/codatplatform/_hooks/__init__.py delete mode 100644 platform/src/codatplatform/companies.py delete mode 100644 platform/src/codatplatform/connection_management.py delete mode 100644 platform/src/codatplatform/connections.py delete mode 100644 platform/src/codatplatform/cors_settings.py delete mode 100644 platform/src/codatplatform/custom_data_type.py delete mode 100644 platform/src/codatplatform/groups.py delete mode 100644 platform/src/codatplatform/integrations.py delete mode 100644 platform/src/codatplatform/models/__init__.py delete mode 100644 platform/src/codatplatform/models/errors/__init__.py delete mode 100644 platform/src/codatplatform/models/errors/errormessage.py delete mode 100644 platform/src/codatplatform/models/errors/sdkerror.py delete mode 100644 platform/src/codatplatform/models/operations/__init__.py delete mode 100644 platform/src/codatplatform/models/operations/add_company_to_group.py delete mode 100644 platform/src/codatplatform/models/operations/configure_custom_data_type.py delete mode 100644 platform/src/codatplatform/models/operations/configure_supplemental_data.py delete mode 100644 platform/src/codatplatform/models/operations/create_api_key.py delete mode 100644 platform/src/codatplatform/models/operations/create_company.py delete mode 100644 platform/src/codatplatform/models/operations/create_connection.py delete mode 100644 platform/src/codatplatform/models/operations/create_group.py delete mode 100644 platform/src/codatplatform/models/operations/create_rule.py delete mode 100644 platform/src/codatplatform/models/operations/create_webhook_consumer.py delete mode 100644 platform/src/codatplatform/models/operations/delete_api_key.py delete mode 100644 platform/src/codatplatform/models/operations/delete_company.py delete mode 100644 platform/src/codatplatform/models/operations/delete_connection.py delete mode 100644 platform/src/codatplatform/models/operations/delete_webhook_consumer.py delete mode 100644 platform/src/codatplatform/models/operations/get_company.py delete mode 100644 platform/src/codatplatform/models/operations/get_company_data_status.py delete mode 100644 platform/src/codatplatform/models/operations/get_company_push_history.py delete mode 100644 platform/src/codatplatform/models/operations/get_connection.py delete mode 100644 platform/src/codatplatform/models/operations/get_connection_management_access_token.py delete mode 100644 platform/src/codatplatform/models/operations/get_connection_management_cors_settings.py delete mode 100644 platform/src/codatplatform/models/operations/get_create_update_model_options_by_data_type.py delete mode 100644 platform/src/codatplatform/models/operations/get_custom_data_type_configuration.py delete mode 100644 platform/src/codatplatform/models/operations/get_integration.py delete mode 100644 platform/src/codatplatform/models/operations/get_integrations_branding.py delete mode 100644 platform/src/codatplatform/models/operations/get_profile.py delete mode 100644 platform/src/codatplatform/models/operations/get_profile_syncsettings.py delete mode 100644 platform/src/codatplatform/models/operations/get_pull_operation.py delete mode 100644 platform/src/codatplatform/models/operations/get_push_operation.py delete mode 100644 platform/src/codatplatform/models/operations/get_supplemental_data_configuration.py delete mode 100644 platform/src/codatplatform/models/operations/get_webhook.py delete mode 100644 platform/src/codatplatform/models/operations/list_api_keys.py delete mode 100644 platform/src/codatplatform/models/operations/list_companies.py delete mode 100644 platform/src/codatplatform/models/operations/list_connections.py delete mode 100644 platform/src/codatplatform/models/operations/list_custom_data_type_records.py delete mode 100644 platform/src/codatplatform/models/operations/list_groups.py delete mode 100644 platform/src/codatplatform/models/operations/list_integrations.py delete mode 100644 platform/src/codatplatform/models/operations/list_pull_operations.py delete mode 100644 platform/src/codatplatform/models/operations/list_rules.py delete mode 100644 platform/src/codatplatform/models/operations/list_webhook_consumers.py delete mode 100644 platform/src/codatplatform/models/operations/refresh_company_data.py delete mode 100644 platform/src/codatplatform/models/operations/refresh_custom_data_type.py delete mode 100644 platform/src/codatplatform/models/operations/refresh_data_type.py delete mode 100644 platform/src/codatplatform/models/operations/remove_company_from_group.py delete mode 100644 platform/src/codatplatform/models/operations/set_connection_management_cors_settings.py delete mode 100644 platform/src/codatplatform/models/operations/unlink_connection.py delete mode 100644 platform/src/codatplatform/models/operations/update_company.py delete mode 100644 platform/src/codatplatform/models/operations/update_connection_authorization.py delete mode 100644 platform/src/codatplatform/models/operations/update_profile.py delete mode 100644 platform/src/codatplatform/models/operations/update_profile_syncsettings.py delete mode 100644 platform/src/codatplatform/models/shared/__init__.py delete mode 100644 platform/src/codatplatform/models/shared/apikeydetails.py delete mode 100644 platform/src/codatplatform/models/shared/apikeys.py delete mode 100644 platform/src/codatplatform/models/shared/branding.py delete mode 100644 platform/src/codatplatform/models/shared/brandingbutton.py delete mode 100644 platform/src/codatplatform/models/shared/brandingimage.py delete mode 100644 platform/src/codatplatform/models/shared/brandinglogo.py delete mode 100644 platform/src/codatplatform/models/shared/clientratelimitreachedwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/clientratelimitreachedwebhookdata.py delete mode 100644 platform/src/codatplatform/models/shared/clientratelimitresetwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/clientratelimitresetwebhookdata.py delete mode 100644 platform/src/codatplatform/models/shared/companies.py delete mode 100644 platform/src/codatplatform/models/shared/company.py delete mode 100644 platform/src/codatplatform/models/shared/companygroupassignment.py delete mode 100644 platform/src/codatplatform/models/shared/companyrequestbody.py delete mode 100644 platform/src/codatplatform/models/shared/connection.py delete mode 100644 platform/src/codatplatform/models/shared/connectionmanagementaccesstoken.py delete mode 100644 platform/src/codatplatform/models/shared/connectionmanagementallowedorigins.py delete mode 100644 platform/src/codatplatform/models/shared/connections.py delete mode 100644 platform/src/codatplatform/models/shared/connectionstatuschangedwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/connectionstatuschangedwebhookdata.py delete mode 100644 platform/src/codatplatform/models/shared/createapikey.py delete mode 100644 platform/src/codatplatform/models/shared/createrule.py delete mode 100644 platform/src/codatplatform/models/shared/customdatatypeconfiguration.py delete mode 100644 platform/src/codatplatform/models/shared/customdatatyperecord.py delete mode 100644 platform/src/codatplatform/models/shared/customdatatyperecords.py delete mode 100644 platform/src/codatplatform/models/shared/dataconnectionerror.py delete mode 100644 platform/src/codatplatform/models/shared/dataconnectionstatus.py delete mode 100644 platform/src/codatplatform/models/shared/datasetdatachangedwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py delete mode 100644 platform/src/codatplatform/models/shared/datastatus.py delete mode 100644 platform/src/codatplatform/models/shared/datastatuses.py delete mode 100644 platform/src/codatplatform/models/shared/datasynccompletedwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/datasynccompletedwebhookdata.py delete mode 100644 platform/src/codatplatform/models/shared/datatype.py delete mode 100644 platform/src/codatplatform/models/shared/datatypefeature.py delete mode 100644 platform/src/codatplatform/models/shared/errorvalidation.py delete mode 100644 platform/src/codatplatform/models/shared/errorvalidationitem.py delete mode 100644 platform/src/codatplatform/models/shared/featurestate.py delete mode 100644 platform/src/codatplatform/models/shared/featuretype.py delete mode 100644 platform/src/codatplatform/models/shared/group.py delete mode 100644 platform/src/codatplatform/models/shared/groupprototype.py delete mode 100644 platform/src/codatplatform/models/shared/groupref.py delete mode 100644 platform/src/codatplatform/models/shared/groups.py delete mode 100644 platform/src/codatplatform/models/shared/halref.py delete mode 100644 platform/src/codatplatform/models/shared/imagereference.py delete mode 100644 platform/src/codatplatform/models/shared/integration.py delete mode 100644 platform/src/codatplatform/models/shared/integrations.py delete mode 100644 platform/src/codatplatform/models/shared/links.py delete mode 100644 platform/src/codatplatform/models/shared/newcompanysynchronizedwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/newcompanysynchronizedwebhookdata.py delete mode 100644 platform/src/codatplatform/models/shared/profile.py delete mode 100644 platform/src/codatplatform/models/shared/pulloperation.py delete mode 100644 platform/src/codatplatform/models/shared/pulloperations.py delete mode 100644 platform/src/codatplatform/models/shared/pushchangetype.py delete mode 100644 platform/src/codatplatform/models/shared/pushfieldvalidation.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperation.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperationchange.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperationref.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperations.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperationstatus.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperationtimedoutwebhook.py delete mode 100644 platform/src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py delete mode 100644 platform/src/codatplatform/models/shared/pushoption.py delete mode 100644 platform/src/codatplatform/models/shared/pushoptionchoice.py delete mode 100644 platform/src/codatplatform/models/shared/pushoptionproperty.py delete mode 100644 platform/src/codatplatform/models/shared/pushoptiontype.py delete mode 100644 platform/src/codatplatform/models/shared/pushvalidationinfo.py delete mode 100644 platform/src/codatplatform/models/shared/schema_datatype.py delete mode 100644 platform/src/codatplatform/models/shared/security.py delete mode 100644 platform/src/codatplatform/models/shared/sourcetype.py delete mode 100644 platform/src/codatplatform/models/shared/status.py delete mode 100644 platform/src/codatplatform/models/shared/supplementaldataconfiguration.py delete mode 100644 platform/src/codatplatform/models/shared/supportedfeature.py delete mode 100644 platform/src/codatplatform/models/shared/syncsetting.py delete mode 100644 platform/src/codatplatform/models/shared/syncsettings.py delete mode 100644 platform/src/codatplatform/models/shared/updateconnectionstatus.py delete mode 100644 platform/src/codatplatform/models/shared/validation.py delete mode 100644 platform/src/codatplatform/models/shared/validationitem.py delete mode 100644 platform/src/codatplatform/models/shared/webhook.py delete mode 100644 platform/src/codatplatform/models/shared/webhookconsumer.py delete mode 100644 platform/src/codatplatform/models/shared/webhookconsumerprototype.py delete mode 100644 platform/src/codatplatform/models/shared/webhookconsumers.py delete mode 100644 platform/src/codatplatform/models/shared/webhooknotifier.py delete mode 100644 platform/src/codatplatform/models/shared/webhooks.py delete mode 100644 platform/src/codatplatform/models/webhooks/__init__.py delete mode 100644 platform/src/codatplatform/models/webhooks/client_rate_limit_reached.py delete mode 100644 platform/src/codatplatform/models/webhooks/client_rate_limit_reset.py delete mode 100644 platform/src/codatplatform/models/webhooks/company_data_connection_status_changed.py delete mode 100644 platform/src/codatplatform/models/webhooks/data_sync_completed.py delete mode 100644 platform/src/codatplatform/models/webhooks/dataset_data_changed.py delete mode 100644 platform/src/codatplatform/models/webhooks/dataset_status_has_changed_to_an_error_state.py delete mode 100644 platform/src/codatplatform/models/webhooks/new_company_synchronized.py delete mode 100644 platform/src/codatplatform/models/webhooks/push_operation_has_timed_out.py delete mode 100644 platform/src/codatplatform/models/webhooks/push_operation_status_has_changed.py delete mode 100644 platform/src/codatplatform/push_data.py delete mode 100644 platform/src/codatplatform/refresh_data.py delete mode 100644 platform/src/codatplatform/sdkconfiguration.py delete mode 100644 platform/src/codatplatform/settings.py delete mode 100644 platform/src/codatplatform/supplemental_data.py delete mode 100644 platform/src/codatplatform/utils/__init__.py delete mode 100644 platform/src/codatplatform/utils/retries.py delete mode 100644 platform/src/codatplatform/utils/utils.py delete mode 100644 platform/src/codatplatform/webhooks.py delete mode 100644 platform/tests/helpers.py diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 36c4f2f27..07776b27e 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.440.1 +speakeasyVersion: 1.446.1 sources: accounting-source: sourceNamespace: accounting-source @@ -56,6 +56,14 @@ sources: tags: - latest - speakeasy-sdk-regen-1731929356 + platform-source: + sourceNamespace: platform-source + sourceRevisionDigest: sha256:43fa77abcae884c23afeea140d8e7fcbc14211c707ef801439ad9508b35b21d4 + sourceBlobDigest: sha256:d80a27e44fffb9c61f16a99e7d25c294f39be1a5a761d51a87c76477f8589f54 + tags: + - latest + - speakeasy-sdk-regen-1732624899 + - 3.0.0 sync-for-commerce-source: sourceNamespace: sync-for-commerce-source sourceRevisionDigest: sha256:6a62a3d9d65254b83a8e6afa5ea2e9d287076520c057bf8a1b60e42ebbdc815e @@ -120,6 +128,13 @@ targets: sourceBlobDigest: sha256:0bb930c7190c9e61384e5af6224f76ea004ad9bc0788b264aaa35b9ebad5699f codeSamplesNamespace: lending-source-code-samples codeSamplesRevisionDigest: sha256:2a3bee0a978a51571d6cbec79cdcf1073f22d5d7afe86b41d7bfff4cf53e6be8 + platform-library: + source: platform-source + sourceNamespace: platform-source + sourceRevisionDigest: sha256:43fa77abcae884c23afeea140d8e7fcbc14211c707ef801439ad9508b35b21d4 + sourceBlobDigest: sha256:d80a27e44fffb9c61f16a99e7d25c294f39be1a5a761d51a87c76477f8589f54 + codeSamplesNamespace: platform-source-code-samples + codeSamplesRevisionDigest: sha256:598d4e7d1cb1d3316e6d179038d87797bb54958b2e25315ce6235a50f4afb859 sync-for-commerce-library: source: sync-for-commerce-source sourceNamespace: sync-for-commerce-source diff --git a/platform/.gitignore b/platform/.gitignore index 3cdf33802..49491792f 100755 --- a/platform/.gitignore +++ b/platform/.gitignore @@ -1,3 +1,6 @@ +.venv/ +pyrightconfig.json +README-PYPI.md venv/ src/*.egg-info/ __pycache__/ diff --git a/platform/.speakeasy/gen.lock b/platform/.speakeasy/gen.lock index 1f082077e..e7a6e1fdf 100755 --- a/platform/.speakeasy/gen.lock +++ b/platform/.speakeasy/gen.lock @@ -1,410 +1,1286 @@ lockVersion: 2.0.0 id: ede4f28e-23c0-442d-89ba-baa76ae2da6e management: - docChecksum: 91b86a7707fc536ccbdc7b7345d775a0 + docChecksum: 8dd29c2f971fac587d6257d3c3eca25b docVersion: 3.0.0 - speakeasyVersion: 1.274.1 - generationVersion: 2.314.0 - releaseVersion: 3.5.0 - configChecksum: 80bf5d1b7da8b1a6ec5440792d84c83d + speakeasyVersion: 1.446.1 + generationVersion: 2.462.1 + releaseVersion: 4.0.0 + configChecksum: 8aab7a9c74fb5a44bb773628d9ba74f9 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.3 - core: 4.6.5 - deprecations: 2.81.1 - examples: 2.81.3 - globalSecurity: 2.83.5 - globalServerURLs: 2.82.2 - groups: 2.81.2 - ignores: 2.81.1 - inputOutputModels: 2.83.1 - nameOverrides: 2.81.2 - responseFormat: 0.1.0 - retries: 2.82.2 - webhooks: 1.0.0 + additionalDependencies: 1.0.0 + constsAndDefaults: 1.0.5 + core: 5.6.8 + defaultEnabledRetries: 0.2.0 + deprecations: 3.0.0 + enumUnions: 0.1.0 + envVarSecurityUsage: 0.3.2 + examples: 3.0.0 + globalSecurity: 3.0.2 + globalSecurityCallbacks: 1.0.0 + globalServerURLs: 3.0.0 + groups: 3.0.0 + ignores: 3.0.0 + inputOutputModels: 3.0.0 + methodArguments: 1.0.2 + nameOverrides: 3.0.0 + nullables: 1.0.0 + responseFormat: 1.0.1 + retries: 3.0.2 + sdkHooks: 1.0.0 + serverEventsSentinels: 0.1.0 + webhooks: 2.0.0 generatedFiles: - - src/codatplatform/sdkconfiguration.py - - src/codatplatform/settings.py - - src/codatplatform/companies.py - - src/codatplatform/cors_settings.py - - src/codatplatform/connection_management.py - - src/codatplatform/connections.py - - src/codatplatform/custom_data_type.py - - src/codatplatform/push_data.py - - src/codatplatform/refresh_data.py - - src/codatplatform/groups.py - - src/codatplatform/integrations.py - - src/codatplatform/supplemental_data.py - - src/codatplatform/webhooks.py - - src/codatplatform/sdk.py - - py.typed - - pylintrc - - setup.py - - src/codatplatform/__init__.py - - src/codatplatform/utils/__init__.py - - src/codatplatform/utils/retries.py - - src/codatplatform/utils/utils.py - - src/codatplatform/models/errors/sdkerror.py - - tests/helpers.py - - src/codatplatform/models/operations/create_api_key.py - - src/codatplatform/models/operations/delete_api_key.py - - src/codatplatform/models/operations/get_profile.py - - src/codatplatform/models/operations/get_profile_syncsettings.py - - src/codatplatform/models/operations/list_api_keys.py - - src/codatplatform/models/operations/update_profile.py - - src/codatplatform/models/operations/update_profile_syncsettings.py - - src/codatplatform/models/operations/create_company.py - - src/codatplatform/models/operations/delete_company.py - - src/codatplatform/models/operations/get_company.py - - src/codatplatform/models/operations/list_companies.py - - src/codatplatform/models/operations/update_company.py - - src/codatplatform/models/operations/get_connection_management_access_token.py - - src/codatplatform/models/operations/get_connection_management_cors_settings.py - - src/codatplatform/models/operations/set_connection_management_cors_settings.py - - src/codatplatform/models/operations/create_connection.py - - src/codatplatform/models/operations/delete_connection.py - - src/codatplatform/models/operations/get_connection.py - - src/codatplatform/models/operations/list_connections.py - - src/codatplatform/models/operations/unlink_connection.py - - src/codatplatform/models/operations/update_connection_authorization.py - - src/codatplatform/models/operations/configure_custom_data_type.py - - src/codatplatform/models/operations/get_custom_data_type_configuration.py - - src/codatplatform/models/operations/list_custom_data_type_records.py - - src/codatplatform/models/operations/refresh_custom_data_type.py - - src/codatplatform/models/operations/get_create_update_model_options_by_data_type.py - - src/codatplatform/models/operations/get_push_operation.py - - src/codatplatform/models/operations/get_company_push_history.py - - src/codatplatform/models/operations/refresh_company_data.py - - src/codatplatform/models/operations/refresh_data_type.py - - src/codatplatform/models/operations/get_company_data_status.py - - src/codatplatform/models/operations/get_pull_operation.py - - src/codatplatform/models/operations/list_pull_operations.py - - src/codatplatform/models/operations/add_company_to_group.py - - src/codatplatform/models/operations/create_group.py - - src/codatplatform/models/operations/list_groups.py - - src/codatplatform/models/operations/remove_company_from_group.py - - src/codatplatform/models/operations/get_integration.py - - src/codatplatform/models/operations/get_integrations_branding.py - - src/codatplatform/models/operations/list_integrations.py - - 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 - - src/codatplatform/models/shared/createapikey.py - - src/codatplatform/models/shared/profile.py - - src/codatplatform/models/shared/syncsettings.py - - src/codatplatform/models/shared/syncsetting.py - - src/codatplatform/models/shared/datatype.py - - src/codatplatform/models/shared/apikeys.py - - src/codatplatform/models/shared/company.py - - src/codatplatform/models/shared/groupref.py - - src/codatplatform/models/shared/connection.py - - src/codatplatform/models/shared/dataconnectionstatus.py - - src/codatplatform/models/shared/sourcetype.py - - src/codatplatform/models/shared/dataconnectionerror.py - - src/codatplatform/models/shared/companyrequestbody.py - - src/codatplatform/models/shared/companies.py - - src/codatplatform/models/shared/links.py - - src/codatplatform/models/shared/halref.py - - src/codatplatform/models/shared/connectionmanagementaccesstoken.py - - src/codatplatform/models/shared/connectionmanagementallowedorigins.py - - src/codatplatform/models/shared/connections.py - - src/codatplatform/models/shared/updateconnectionstatus.py - - src/codatplatform/models/shared/customdatatypeconfiguration.py - - src/codatplatform/models/shared/customdatatyperecords.py - - src/codatplatform/models/shared/customdatatyperecord.py - - src/codatplatform/models/shared/pulloperation.py - - src/codatplatform/models/shared/pushoption.py - - src/codatplatform/models/shared/pushvalidationinfo.py - - src/codatplatform/models/shared/pushfieldvalidation.py - - src/codatplatform/models/shared/pushoptiontype.py - - src/codatplatform/models/shared/pushoptionproperty.py - - src/codatplatform/models/shared/pushoptionchoice.py - - src/codatplatform/models/shared/schema_datatype.py - - src/codatplatform/models/shared/pushoperation.py - - src/codatplatform/models/shared/validation.py - - src/codatplatform/models/shared/validationitem.py - - src/codatplatform/models/shared/pushoperationstatus.py - - src/codatplatform/models/shared/pushoperationchange.py - - src/codatplatform/models/shared/pushchangetype.py - - src/codatplatform/models/shared/pushoperationref.py - - src/codatplatform/models/shared/pushoperations.py - - src/codatplatform/models/shared/datastatuses.py - - src/codatplatform/models/shared/datastatus.py - - src/codatplatform/models/shared/status.py - - src/codatplatform/models/shared/pulloperations.py - - src/codatplatform/models/shared/companygroupassignment.py - - src/codatplatform/models/shared/group.py - - src/codatplatform/models/shared/groupprototype.py - - src/codatplatform/models/shared/groups.py - - src/codatplatform/models/shared/integration.py - - src/codatplatform/models/shared/datatypefeature.py - - src/codatplatform/models/shared/supportedfeature.py - - src/codatplatform/models/shared/featuretype.py - - src/codatplatform/models/shared/featurestate.py - - src/codatplatform/models/shared/branding.py - - src/codatplatform/models/shared/brandinglogo.py - - src/codatplatform/models/shared/brandingimage.py - - src/codatplatform/models/shared/imagereference.py - - src/codatplatform/models/shared/brandingbutton.py - - src/codatplatform/models/shared/integrations.py - - src/codatplatform/models/shared/supplementaldataconfiguration.py - - 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 - - src/codatplatform/models/shared/clientratelimitresetwebhook.py - - src/codatplatform/models/shared/clientratelimitresetwebhookdata.py - - src/codatplatform/models/shared/connectionstatuschangedwebhook.py - - src/codatplatform/models/shared/connectionstatuschangedwebhookdata.py - - src/codatplatform/models/shared/datasynccompletedwebhook.py - - src/codatplatform/models/shared/datasynccompletedwebhookdata.py - - src/codatplatform/models/shared/datasetdatachangedwebhook.py - - src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py - - src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py - - src/codatplatform/models/shared/newcompanysynchronizedwebhook.py - - src/codatplatform/models/shared/newcompanysynchronizedwebhookdata.py - - src/codatplatform/models/shared/pushoperationtimedoutwebhook.py - - src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py - - src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py - - src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py - - src/codatplatform/models/errors/errormessage.py - - src/codatplatform/models/webhooks/client_rate_limit_reached.py - - src/codatplatform/models/webhooks/client_rate_limit_reset.py - - src/codatplatform/models/webhooks/company_data_connection_status_changed.py - - src/codatplatform/models/webhooks/data_sync_completed.py - - src/codatplatform/models/webhooks/dataset_data_changed.py - - src/codatplatform/models/webhooks/dataset_status_has_changed_to_an_error_state.py - - src/codatplatform/models/webhooks/new_company_synchronized.py - - src/codatplatform/models/webhooks/push_operation_has_timed_out.py - - src/codatplatform/models/webhooks/push_operation_status_has_changed.py - - src/codatplatform/models/__init__.py - - src/codatplatform/models/errors/__init__.py - - src/codatplatform/models/operations/__init__.py - - src/codatplatform/models/shared/__init__.py - - src/codatplatform/models/webhooks/__init__.py - - docs/models/operations/createapikeyresponse.md + - .gitattributes + - .python-version + - .vscode/settings.json + - CONTRIBUTING.md + - USAGE.md + - docs/models/errors/errormessage.md + - docs/models/operations/addproductrequest.md + - docs/models/operations/configurecustomdatatyperequest.md + - docs/models/operations/configuresupplementaldatarequest.md + - docs/models/operations/createconnectionrequest.md + - docs/models/operations/createconnectionrequestbody.md + - docs/models/operations/datatype.md - docs/models/operations/deleteapikeyrequest.md - - docs/models/operations/deleteapikeyresponse.md - - docs/models/operations/getprofileresponse.md - - docs/models/operations/getprofilesyncsettingsresponse.md - - docs/models/operations/listapikeysresponse.md - - docs/models/operations/updateprofileresponse.md - - docs/models/operations/updateprofilesyncsettingsrequestbody.md - - docs/models/operations/updateprofilesyncsettingsresponse.md - - docs/models/operations/createcompanyresponse.md - docs/models/operations/deletecompanyrequest.md - - docs/models/operations/deletecompanyresponse.md + - docs/models/operations/deleteconnectionrequest.md + - docs/models/operations/deletewebhookconsumerrequest.md + - docs/models/operations/getcompanyaccesstokenrequest.md + - docs/models/operations/getcompanydatastatusrequest.md + - docs/models/operations/getcompanypushhistoryrequest.md - docs/models/operations/getcompanyrequest.md - - docs/models/operations/getcompanyresponse.md - - docs/models/operations/listcompaniesrequest.md - - docs/models/operations/listcompaniesresponse.md - - docs/models/operations/updatecompanyrequest.md - - docs/models/operations/updatecompanyresponse.md - docs/models/operations/getconnectionmanagementaccesstokenrequest.md - - docs/models/operations/getconnectionmanagementaccesstokenresponse.md - - docs/models/operations/getconnectionmanagementcorssettingsresponse.md - - docs/models/operations/setconnectionmanagementcorssettingsresponse.md - - docs/models/operations/createconnectionrequestbody.md - - docs/models/operations/createconnectionrequest.md - - docs/models/operations/createconnectionresponse.md - - docs/models/operations/deleteconnectionrequest.md - - docs/models/operations/deleteconnectionresponse.md - docs/models/operations/getconnectionrequest.md - - docs/models/operations/getconnectionresponse.md - - docs/models/operations/listconnectionsrequest.md - - docs/models/operations/listconnectionsresponse.md - - docs/models/operations/unlinkconnectionrequest.md - - docs/models/operations/unlinkconnectionresponse.md - - docs/models/operations/updateconnectionauthorizationrequest.md - - docs/models/operations/updateconnectionauthorizationresponse.md - - docs/models/operations/configurecustomdatatyperequest.md - - docs/models/operations/configurecustomdatatyperesponse.md - - docs/models/operations/getcustomdatatypeconfigurationrequest.md - - docs/models/operations/getcustomdatatypeconfigurationresponse.md - - docs/models/operations/listcustomdatatyperecordsrequest.md - - docs/models/operations/listcustomdatatyperecordsresponse.md - - docs/models/operations/refreshcustomdatatyperequest.md - - docs/models/operations/refreshcustomdatatyperesponse.md - docs/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md - - docs/models/operations/getcreateupdatemodeloptionsbydatatyperesponse.md - - docs/models/operations/getpushoperationrequest.md - - docs/models/operations/getpushoperationresponse.md - - docs/models/operations/getcompanypushhistoryrequest.md - - docs/models/operations/getcompanypushhistoryresponse.md - - docs/models/operations/refreshcompanydatarequest.md - - docs/models/operations/refreshcompanydataresponse.md - - docs/models/operations/refreshdatatyperequest.md - - docs/models/operations/refreshdatatyperesponse.md - - docs/models/operations/getcompanydatastatusrequest.md - - docs/models/operations/getcompanydatastatusresponse.md - - docs/models/operations/getpulloperationrequest.md - - docs/models/operations/getpulloperationresponse.md - - docs/models/operations/listpulloperationsrequest.md - - docs/models/operations/listpulloperationsresponse.md - - docs/models/operations/addcompanytogrouprequest.md - - docs/models/operations/addcompanytogroupresponse.md - - docs/models/operations/creategroupresponse.md - - docs/models/operations/listgroupsresponse.md - - docs/models/operations/removecompanyfromgrouprequest.md - - docs/models/operations/removecompanyfromgroupresponse.md + - docs/models/operations/getcustomdatatypeconfigurationrequest.md - docs/models/operations/getintegrationrequest.md - - docs/models/operations/getintegrationresponse.md - docs/models/operations/getintegrationsbrandingrequest.md - - docs/models/operations/getintegrationsbrandingresponse.md - - docs/models/operations/listintegrationsrequest.md - - docs/models/operations/listintegrationsresponse.md - - docs/models/operations/datatype.md - - docs/models/operations/configuresupplementaldatarequest.md - - docs/models/operations/configuresupplementaldataresponse.md - - docs/models/operations/pathparamdatatype.md + - docs/models/operations/getpulloperationrequest.md + - docs/models/operations/getpushoperationrequest.md - 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/listcompaniesrequest.md + - docs/models/operations/listconnectionsrequest.md + - docs/models/operations/listcustomdatatyperecordsrequest.md + - docs/models/operations/listintegrationsrequest.md + - docs/models/operations/listpulloperationsrequest.md - docs/models/operations/listrulesrequest.md - - docs/models/operations/listrulesresponse.md - - docs/models/operations/listwebhookconsumersresponse.md + - docs/models/operations/pathparamdatatype.md + - docs/models/operations/refreshcompanydatarequest.md + - docs/models/operations/refreshcustomdatatyperequest.md + - docs/models/operations/refreshdatatyperequest.md + - docs/models/operations/removeproductrequest.md + - docs/models/operations/unlinkconnectionrequest.md + - docs/models/operations/updatecompanyrequest.md + - docs/models/operations/updateconnectionauthorizationrequest.md + - docs/models/operations/updateprofilesyncsettingsrequestbody.md - docs/models/shared/apikeydetails.md - - docs/models/shared/errorvalidation.md - - docs/models/shared/errorvalidationitem.md - - docs/models/shared/createapikey.md - - docs/models/shared/profile.md - - docs/models/shared/syncsettings.md - - docs/models/shared/syncsetting.md - - docs/models/shared/datatype.md - docs/models/shared/apikeys.md + - docs/models/shared/branding.md + - docs/models/shared/brandingbutton.md + - docs/models/shared/brandingimage.md + - docs/models/shared/brandinglogo.md + - docs/models/shared/clientratelimitreachedwebhook.md + - docs/models/shared/clientratelimitreachedwebhookdata.md + - docs/models/shared/clientratelimitresetwebhook.md + - docs/models/shared/clientratelimitresetwebhookdata.md + - docs/models/shared/clientratelimitwebhook.md + - docs/models/shared/clientratelimitwebhookpayload.md + - docs/models/shared/companies.md - docs/models/shared/company.md - - docs/models/shared/groupref.md - - docs/models/shared/connection.md - - docs/models/shared/dataconnectionstatus.md - - docs/models/shared/sourcetype.md - - docs/models/shared/dataconnectionerror.md + - docs/models/shared/companyaccesstoken.md + - docs/models/shared/companydetails.md + - docs/models/shared/companyreference.md + - docs/models/shared/companyreferencelinks.md - docs/models/shared/companyrequestbody.md - - docs/models/shared/companies.md - - docs/models/shared/links.md - - docs/models/shared/halref.md + - docs/models/shared/companywebhook.md + - docs/models/shared/connection.md - docs/models/shared/connectionmanagementaccesstoken.md - docs/models/shared/connectionmanagementallowedorigins.md - docs/models/shared/connections.md - - docs/models/shared/updateconnectionstatus.md - - docs/models/shared/customdatatypeconfiguration.md - - docs/models/shared/customdatatyperecords.md + - docs/models/shared/connectionstatuschangedwebhook.md + - docs/models/shared/connectionstatuschangedwebhookdata.md + - docs/models/shared/connectionwebhook.md + - docs/models/shared/connectionwebhookpayload.md - docs/models/shared/content.md - - docs/models/shared/modifieddate.md + - docs/models/shared/createapikey.md + - docs/models/shared/createrule.md + - docs/models/shared/customdatatypeconfiguration.md - docs/models/shared/customdatatyperecord.md + - docs/models/shared/customdatatyperecords.md + - docs/models/shared/dataconnectionerror.md + - docs/models/shared/dataconnectionstatus.md + - docs/models/shared/datasetdatachangedwebhook.md + - docs/models/shared/datasetdatachangedwebhookdata.md - docs/models/shared/datasetstatus.md + - docs/models/shared/datasetstatuschangederrorwebhook.md + - docs/models/shared/datasetstatuschangederrorwebhookdata.md + - docs/models/shared/datastatus.md + - docs/models/shared/datastatusdatatypes.md + - docs/models/shared/datastatuses.md + - docs/models/shared/datasynccompletedwebhook.md + - docs/models/shared/datasynccompletedwebhookdata.md + - docs/models/shared/datatype.md + - docs/models/shared/datatypefeature.md + - docs/models/shared/datatypes.md + - docs/models/shared/datatypewritewebhook.md + - docs/models/shared/datatypewritewebhookpayload.md + - docs/models/shared/datatypewritewebhookrecord.md + - docs/models/shared/errormessage.md + - docs/models/shared/errorstatus.md + - docs/models/shared/errorvalidation.md + - docs/models/shared/errorvalidationitem.md + - docs/models/shared/featurestate.md + - docs/models/shared/featuretype.md + - docs/models/shared/halref.md + - docs/models/shared/imagereference.md + - docs/models/shared/integration.md + - docs/models/shared/integrations.md + - docs/models/shared/links.md + - docs/models/shared/modifieddate.md + - docs/models/shared/newcompanysynchronizedwebhook.md + - docs/models/shared/profile.md - docs/models/shared/pulloperation.md - - docs/models/shared/pushoption.md - - docs/models/shared/pushvalidationinfo.md + - docs/models/shared/pulloperations.md + - docs/models/shared/pushchangetype.md - docs/models/shared/pushfieldvalidation.md - - docs/models/shared/pushoptiontype.md - - docs/models/shared/pushoptionproperty.md - - docs/models/shared/pushoptionchoice.md - - docs/models/shared/schemadatatype.md - docs/models/shared/pushoperation.md - - docs/models/shared/validation.md - - docs/models/shared/validationitem.md - - docs/models/shared/pushoperationstatus.md - docs/models/shared/pushoperationchange.md - - docs/models/shared/pushchangetype.md - docs/models/shared/pushoperationref.md - docs/models/shared/pushoperations.md - - docs/models/shared/datastatuses.md - - docs/models/shared/datatypes.md - - docs/models/shared/datastatus.md + - docs/models/shared/pushoperationstatus.md + - docs/models/shared/pushoperationstatuschangedwebhook.md + - docs/models/shared/pushoperationstatuschangedwebhookdata.md + - docs/models/shared/pushoperationtimedoutwebhook.md + - docs/models/shared/pushoperationtimedoutwebhookdata.md + - docs/models/shared/pushoption.md + - docs/models/shared/pushoptionchoice.md + - docs/models/shared/pushoptionproperty.md + - docs/models/shared/pushoptiontype.md + - docs/models/shared/pushvalidationinfo.md + - docs/models/shared/readcompletedwebhook.md + - docs/models/shared/readcompletedwebhookpayload.md + - docs/models/shared/schemadatatype.md + - docs/models/shared/security.md + - docs/models/shared/sourcetype.md - docs/models/shared/status.md - - docs/models/shared/pulloperations.md - - docs/models/shared/companygroupassignment.md - - docs/models/shared/group.md - - docs/models/shared/groupprototype.md - - docs/models/shared/groups.md - - docs/models/shared/integration.md - - docs/models/shared/datatypefeature.md - - docs/models/shared/supportedfeature.md - - docs/models/shared/featuretype.md - - docs/models/shared/featurestate.md - - docs/models/shared/branding.md - - docs/models/shared/brandinglogo.md - - docs/models/shared/brandingimage.md - - docs/models/shared/imagereference.md - - docs/models/shared/brandingbutton.md - - docs/models/shared/integrations.md - - docs/models/shared/supplementaldatasourceconfiguration.md - docs/models/shared/supplementaldataconfiguration.md + - docs/models/shared/supplementaldatasourceconfiguration.md + - docs/models/shared/supportedfeature.md + - docs/models/shared/syncsetting.md + - docs/models/shared/syncsettings.md + - docs/models/shared/updateconnectionstatus.md + - docs/models/shared/validation.md + - docs/models/shared/validationitem.md - 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 - - docs/models/shared/clientratelimitresetwebhook.md - - docs/models/shared/clientratelimitresetwebhookdata.md - - docs/models/shared/connectionstatuschangedwebhook.md - - docs/models/shared/connectionstatuschangedwebhookdata.md - - docs/models/shared/datasynccompletedwebhook.md - - docs/models/shared/datasynccompletedwebhookdata.md - - docs/models/shared/datasetdatachangedwebhookdata.md - - docs/models/shared/datasetdatachangedwebhook.md - - docs/models/shared/datasetstatuschangederrorwebhook.md - - docs/models/shared/datasetstatuschangederrorwebhookdata.md - - docs/models/shared/newcompanysynchronizedwebhook.md - - docs/models/shared/newcompanysynchronizedwebhookdata.md - - docs/models/shared/pushoperationtimedoutwebhook.md - - docs/models/shared/pushoperationtimedoutwebhookdata.md - - docs/models/shared/pushoperationstatuschangedwebhook.md - - docs/models/shared/pushoperationstatuschangedwebhookdata.md - - docs/models/errors/errormessage.md - - docs/models/webhooks/clientratelimitreachedresponse.md - - docs/models/webhooks/clientratelimitresetresponse.md - - docs/models/webhooks/companydataconnectionstatuschangedresponse.md - - docs/models/webhooks/datasynccompletedresponse.md - - docs/models/webhooks/datasetdatachangedresponse.md - - docs/models/webhooks/datasetstatushaschangedtoanerrorstateresponse.md - - docs/models/webhooks/newcompanysynchronizedresponse.md - - docs/models/webhooks/pushoperationhastimedoutresponse.md - - docs/models/webhooks/pushoperationstatushaschangedresponse.md - - docs/sdks/codatplatform/README.md + - docs/models/shared/webhooknotifier.md + - docs/models/shared/webhooks.md + - docs/models/shared/writestatus.md + - docs/models/shared/writetype.md - docs/models/utils/retryconfig.md - - docs/sdks/settings/README.md + - docs/sdks/codatplatform/README.md - docs/sdks/companies/README.md - docs/sdks/connectionmanagement/README.md - - docs/sdks/corssettings/README.md - docs/sdks/connections/README.md + - docs/sdks/corssettings/README.md - docs/sdks/customdatatype/README.md + - docs/sdks/integrations/README.md - docs/sdks/pushdata/README.md - docs/sdks/refreshdata/README.md - - docs/sdks/groups/README.md - - docs/sdks/integrations/README.md + - docs/sdks/settings/README.md - docs/sdks/supplementaldata/README.md - docs/sdks/webhooks/README.md - - USAGE.md - - .gitattributes - - src/codatplatform/_hooks/sdkhooks.py - - src/codatplatform/_hooks/types.py - - src/codatplatform/_hooks/__init__.py + - poetry.toml + - py.typed + - pylintrc + - pyproject.toml + - scripts/prepare-readme.py + - scripts/publish.sh + - src/codat_platform/__init__.py + - src/codat_platform/_hooks/__init__.py + - src/codat_platform/_hooks/sdkhooks.py + - src/codat_platform/_hooks/types.py + - src/codat_platform/_version.py + - src/codat_platform/basesdk.py + - src/codat_platform/companies.py + - src/codat_platform/connection_management.py + - src/codat_platform/connections.py + - src/codat_platform/cors_settings.py + - src/codat_platform/custom_data_type.py + - src/codat_platform/httpclient.py + - src/codat_platform/integrations.py + - src/codat_platform/models/errors/__init__.py + - src/codat_platform/models/errors/errormessage.py + - src/codat_platform/models/errors/sdkerror.py + - src/codat_platform/models/operations/__init__.py + - src/codat_platform/models/operations/add_product.py + - src/codat_platform/models/operations/configure_custom_data_type.py + - src/codat_platform/models/operations/configure_supplemental_data.py + - src/codat_platform/models/operations/create_connection.py + - src/codat_platform/models/operations/delete_api_key.py + - src/codat_platform/models/operations/delete_company.py + - src/codat_platform/models/operations/delete_connection.py + - src/codat_platform/models/operations/delete_webhook_consumer.py + - src/codat_platform/models/operations/get_company.py + - src/codat_platform/models/operations/get_company_access_token.py + - src/codat_platform/models/operations/get_company_data_status.py + - src/codat_platform/models/operations/get_company_push_history.py + - src/codat_platform/models/operations/get_connection.py + - src/codat_platform/models/operations/get_connection_management_access_token.py + - src/codat_platform/models/operations/get_create_update_model_options_by_data_type.py + - src/codat_platform/models/operations/get_custom_data_type_configuration.py + - src/codat_platform/models/operations/get_integration.py + - src/codat_platform/models/operations/get_integrations_branding.py + - src/codat_platform/models/operations/get_pull_operation.py + - src/codat_platform/models/operations/get_push_operation.py + - src/codat_platform/models/operations/get_supplemental_data_configuration.py + - src/codat_platform/models/operations/get_webhook.py + - src/codat_platform/models/operations/list_companies.py + - src/codat_platform/models/operations/list_connections.py + - src/codat_platform/models/operations/list_custom_data_type_records.py + - src/codat_platform/models/operations/list_integrations.py + - src/codat_platform/models/operations/list_pull_operations.py + - src/codat_platform/models/operations/list_rules.py + - src/codat_platform/models/operations/refresh_company_data.py + - src/codat_platform/models/operations/refresh_custom_data_type.py + - src/codat_platform/models/operations/refresh_data_type.py + - src/codat_platform/models/operations/remove_product.py + - src/codat_platform/models/operations/unlink_connection.py + - src/codat_platform/models/operations/update_company.py + - src/codat_platform/models/operations/update_connection_authorization.py + - src/codat_platform/models/operations/update_profile_syncsettings.py + - src/codat_platform/models/shared/__init__.py + - src/codat_platform/models/shared/apikeydetails.py + - src/codat_platform/models/shared/apikeys.py + - src/codat_platform/models/shared/branding.py + - src/codat_platform/models/shared/brandingbutton.py + - src/codat_platform/models/shared/brandingimage.py + - src/codat_platform/models/shared/brandinglogo.py + - src/codat_platform/models/shared/clientratelimitreachedwebhook.py + - src/codat_platform/models/shared/clientratelimitreachedwebhookdata.py + - src/codat_platform/models/shared/clientratelimitresetwebhook.py + - src/codat_platform/models/shared/clientratelimitresetwebhookdata.py + - src/codat_platform/models/shared/clientratelimitwebhook.py + - src/codat_platform/models/shared/clientratelimitwebhookpayload.py + - src/codat_platform/models/shared/companies.py + - src/codat_platform/models/shared/company.py + - src/codat_platform/models/shared/companyaccesstoken.py + - src/codat_platform/models/shared/companydetails.py + - src/codat_platform/models/shared/companyreference.py + - src/codat_platform/models/shared/companyrequestbody.py + - src/codat_platform/models/shared/companywebhook.py + - src/codat_platform/models/shared/connection.py + - src/codat_platform/models/shared/connectionmanagementaccesstoken.py + - src/codat_platform/models/shared/connectionmanagementallowedorigins.py + - src/codat_platform/models/shared/connections.py + - src/codat_platform/models/shared/connectionstatuschangedwebhook.py + - src/codat_platform/models/shared/connectionstatuschangedwebhookdata.py + - src/codat_platform/models/shared/connectionwebhook.py + - src/codat_platform/models/shared/connectionwebhookpayload.py + - src/codat_platform/models/shared/createapikey.py + - src/codat_platform/models/shared/createrule.py + - src/codat_platform/models/shared/customdatatypeconfiguration.py + - src/codat_platform/models/shared/customdatatyperecord.py + - src/codat_platform/models/shared/customdatatyperecords.py + - src/codat_platform/models/shared/dataconnectionerror.py + - src/codat_platform/models/shared/dataconnectionstatus.py + - src/codat_platform/models/shared/datasetdatachangedwebhook.py + - src/codat_platform/models/shared/datasetstatuschangederrorwebhook.py + - src/codat_platform/models/shared/datasetstatuschangederrorwebhookdata.py + - src/codat_platform/models/shared/datastatus.py + - src/codat_platform/models/shared/datastatuses.py + - src/codat_platform/models/shared/datasynccompletedwebhook.py + - src/codat_platform/models/shared/datasynccompletedwebhookdata.py + - src/codat_platform/models/shared/datatype.py + - src/codat_platform/models/shared/datatypefeature.py + - src/codat_platform/models/shared/datatypewritewebhook.py + - src/codat_platform/models/shared/datatypewritewebhookpayload.py + - src/codat_platform/models/shared/datatypewritewebhookrecord.py + - src/codat_platform/models/shared/errormessage.py + - src/codat_platform/models/shared/errorvalidation.py + - src/codat_platform/models/shared/errorvalidationitem.py + - src/codat_platform/models/shared/featurestate.py + - src/codat_platform/models/shared/featuretype.py + - src/codat_platform/models/shared/halref.py + - src/codat_platform/models/shared/imagereference.py + - src/codat_platform/models/shared/integration.py + - src/codat_platform/models/shared/integrations.py + - src/codat_platform/models/shared/links.py + - src/codat_platform/models/shared/newcompanysynchronizedwebhook.py + - src/codat_platform/models/shared/profile.py + - src/codat_platform/models/shared/pulloperation.py + - src/codat_platform/models/shared/pulloperations.py + - src/codat_platform/models/shared/pushchangetype.py + - src/codat_platform/models/shared/pushfieldvalidation.py + - src/codat_platform/models/shared/pushoperation.py + - src/codat_platform/models/shared/pushoperationchange.py + - src/codat_platform/models/shared/pushoperationref.py + - src/codat_platform/models/shared/pushoperations.py + - src/codat_platform/models/shared/pushoperationstatus.py + - src/codat_platform/models/shared/pushoperationstatuschangedwebhook.py + - src/codat_platform/models/shared/pushoperationstatuschangedwebhookdata.py + - src/codat_platform/models/shared/pushoperationtimedoutwebhook.py + - src/codat_platform/models/shared/pushoperationtimedoutwebhookdata.py + - src/codat_platform/models/shared/pushoption.py + - src/codat_platform/models/shared/pushoptionchoice.py + - src/codat_platform/models/shared/pushoptionproperty.py + - src/codat_platform/models/shared/pushoptiontype.py + - src/codat_platform/models/shared/pushvalidationinfo.py + - src/codat_platform/models/shared/readcompletedwebhook.py + - src/codat_platform/models/shared/readcompletedwebhookpayload.py + - src/codat_platform/models/shared/schema_datatype.py + - src/codat_platform/models/shared/security.py + - src/codat_platform/models/shared/sourcetype.py + - src/codat_platform/models/shared/status.py + - src/codat_platform/models/shared/supplementaldataconfiguration.py + - src/codat_platform/models/shared/supportedfeature.py + - src/codat_platform/models/shared/syncsetting.py + - src/codat_platform/models/shared/syncsettings.py + - src/codat_platform/models/shared/updateconnectionstatus.py + - src/codat_platform/models/shared/validation.py + - src/codat_platform/models/shared/validationitem.py + - src/codat_platform/models/shared/webhook.py + - src/codat_platform/models/shared/webhookconsumer.py + - src/codat_platform/models/shared/webhookconsumerprototype.py + - src/codat_platform/models/shared/webhookconsumers.py + - src/codat_platform/models/shared/webhooknotifier.py + - src/codat_platform/models/shared/webhooks.py + - src/codat_platform/models/shared/writestatus.py + - src/codat_platform/models/shared/writetype.py + - src/codat_platform/push_data.py + - src/codat_platform/py.typed + - src/codat_platform/refresh_data.py + - src/codat_platform/sdk.py + - src/codat_platform/sdkconfiguration.py + - src/codat_platform/settings.py + - src/codat_platform/supplemental_data.py + - src/codat_platform/types/__init__.py + - src/codat_platform/types/basemodel.py + - src/codat_platform/utils/__init__.py + - src/codat_platform/utils/annotations.py + - src/codat_platform/utils/enums.py + - src/codat_platform/utils/eventstreaming.py + - src/codat_platform/utils/forms.py + - src/codat_platform/utils/headers.py + - src/codat_platform/utils/logger.py + - src/codat_platform/utils/metadata.py + - src/codat_platform/utils/queryparams.py + - src/codat_platform/utils/requestbodies.py + - src/codat_platform/utils/retries.py + - src/codat_platform/utils/security.py + - src/codat_platform/utils/serializers.py + - src/codat_platform/utils/url.py + - src/codat_platform/utils/values.py + - src/codat_platform/webhooks.py +examples: + create-api-key: + Create API key with name: + requestBody: + application/json: {"name": "azure-invoice-finance-processor"} + responses: + "201": + application/json: {"apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-10-23T00:00:00Z", "id": "e288a972-b402-4b21-93f9-b5335ae5679c", "name": "azure-invoice-finance-processor"} + "400": {} + API key details: + requestBody: + application/json: {"name": "azure-invoice-finance-processor"} + responses: + "201": + application/json: {"apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2"} + API key details with name: + requestBody: + application/json: {"name": "azure-invoice-finance-processor"} + responses: + "201": + application/json: {"apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "azure-invoice-finance-processor"} + Max length for name reached: + requestBody: + application/json: {"name": "azure-invoice-finance-processor"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Max string length (50) for `name` reached.", "service": "PublicApi", "statusCode": 400} + delete-api-key: + Conflict: + parameters: + path: + apiKeyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "204": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "You have made too many requests in a given amount of time; please retry later.", "service": "PublicApi", "statusCode": 429} + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "You have made too many requests in a given amount of time; please retry later.", "service": "PublicApi", "statusCode": 429} + get-profile: + Unauthorized: + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-profile-syncSettings: + Example: + responses: + "200": + application/json: {"clientId": "367f7975-267b-439b-90c6-a6040ee680f3", "overridesDefaults": true, "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "isLocked": true, "monthsToSync": 24, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "syncOrder": 0, "syncSchedule": 24}]} + Unauthorized: + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-api-keys: + Example: + responses: + "200": + application/json: {"results": [{"apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-11T13:49:37Z", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2"}, {"apiKey": "ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd", "createdDate": "2022-04-23T09:43:48Z", "id": "c438836a-61fe-443f-8a19-24cc18be21e4", "name": "azure-invoice-finance-processor"}]} + Unauthorized: + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + update-profile: + Unauthorized: + requestBody: + application/json: {"confirmCompanyName": true, "iconUrl": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", "logoUrl": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", "name": "Bob's Burgers", "redirectUrl": "https://bobs-burgers.{countrySuffix}/{companyId}", "whiteListUrls": ["https://bobs-burgers.com", "https://bobs-burgers.co.uk"]} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + update-profile-syncSettings: + Unauthorized: + requestBody: + application/json: {"clientId": "c4907f05-7024-4fc0-bf55-4785be5c9671", "settings": [{"dataType": "invoices", "fetchOnFirstLink": true, "isLocked": true, "monthsToSync": 24, "syncFromUtc": "2020-01-01T12:00:00.000Z", "syncFromWindow": 24, "syncOrder": 0, "syncSchedule": 24}]} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + add-product: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + productIdentifier: "lending" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-company: + With no description: + requestBody: + application/json: {"name": "Technicalium"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} + With a description: + requestBody: + application/json: {"description": "Technology services, including web and app design and development", "name": "Technicalium"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "Technology services, including web and app design and development", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} + With a tag: + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [], "tags": {"region": "us"}} + Malformed query: + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + delete-company: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company: + Simple company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} + Parent multi-entity company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]} + Subsidiary multi-entity company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "description": "", "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company-access-token: + Simple company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accessToken": "string", "expiresIn": 86400, "tokenType": "Bearer"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-companies: + "": + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + One company: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "My Test Company make testing software", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "name": "My Test Company", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "referenceSubsidiaryCompanies": []}], "totalResults": 1} + List of Companies: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "Technology services, including web and app design and development", "id": "d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}], "totalResults": 3} + Malformed query: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + remove-product: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + productIdentifier: "expenses" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + update-company: + Update name: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "New Name"} + responses: + "200": + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} + "401": {} + Update description: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"description": "Additional documents required", "name": "Same name"} + responses: + "200": + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} + "401": {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-connection-management-access-token: + Access token: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-connection-management-cors-settings: + Allowed origins: + responses: + "200": + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + Unauthorized: + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + set-connection-management-cors-settings: + Allowed origins: + requestBody: + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + responses: + "200": + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + Unauthorized: + requestBody: + application/json: {"allowedOrigins": ["https://www.bank-of-dave.com"]} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + delete-connection: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-connections: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Connections: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}, "self": {"href": "string"}}, "pageNumber": 0, "pageSize": 0, "results": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 0} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + unlink-connection: + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"status": "Unlinked"} + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"} + "401": {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + update-connection-authorization: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + configure-custom-data-type: + Dynamics 365 Business Central: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" + requestBody: + application/json: {"dataSource": "api/purchaseOrders", "keyBy": ["$[*].id"], "requiredData": {"currency": "$[*].currencyCode", "number": "$[*].number", "date": "$[*].orderDate", "totalexvat": "$[*].totalAmountExcludingTax", "totaltax": "$[*].totalTaxAmount", "vendor": "$[*].number"}, "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} + responses: + "200": + application/json: {"dataSource": "api/purchaseOrders", "keyBy": ["$[*].id"], "requiredData": {"currency": "$[*].currencyCode", "number": "$[*].number", "date": "$[*].orderDate", "totalexvat": "$[*].totalAmountExcludingTax", "totaltax": "$[*].totalTaxAmount", "vendor": "$[*].number"}, "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} + Xero Simple Record: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" + requestBody: + application/json: {"dataSource": "/api.xro/2.0/Accounts", "keyBy": ["$.AccountID"], "requiredData": {"code": "$.Code", "accountId": "$.AccountID", "type": "$.Type", "SysAcc": "$.SystemAccount"}} + responses: + "200": + application/json: {"dataSource": "/api.xro/2.0/Accounts", "keyBy": ["$.AccountID"], "requiredData": {"code": "$.Code", "accountId": "$.AccountID", "type": "$.Type", "SysAcc": "$.SystemAccount"}} + Xero Mapping Arrays: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" + requestBody: + application/json: {"dataSource": "/api.xro/2.0/Invoices", "keyBy": ["$.InvoiceID"], "requiredData": {"invNumber": "$.InvoiceNumber", "type": "$.Type", "InvoiceID": "$.InvoiceID", "lines": "$.LineItems[*]"}, "sourceModifiedDate": ["$.UpdatedDateUTC"]} + responses: + "200": + application/json: {"dataSource": "/api.xro/2.0/Invoices", "keyBy": ["$.InvoiceID"], "requiredData": {"invNumber": "$.InvoiceNumber", "type": "$.Type", "InvoiceID": "$.InvoiceID", "lines": "$.LineItems[*]"}, "sourceModifiedDate": ["$.UpdatedDateUTC"]} + QuickBooks Online: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" + requestBody: + application/json: {"dataSource": "/query?query=select * from Account", "keyBy": ["$.Id"], "requiredData": {"id": "$.Id", "Currentbal": "$.CurrentBalance", "SubAcc": "$.SubAccount"}, "sourceModifiedDate": ["$.time"]} + responses: + "200": + application/json: {"dataSource": "/query?query=select * from Account", "keyBy": ["$.Id"], "requiredData": {"id": "$.Id", "Currentbal": "$.CurrentBalance", "SubAcc": "$.SubAccount"}, "sourceModifiedDate": ["$.time"]} + Unauthorized: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" + requestBody: + application/json: {"dataSource": "api/purchaseOrders?$filter=currencyCode eq 'NOK'", "keyBy": ["$[*].id"], "requiredData": {"currencyCode": "$[*].currencyCode", "id": "$[*].id", "number": "$[*].number", "orderDate": "$[*].orderDate", "totalAmountExcludingTax": "$[*].totalAmountExcludingTax", "totalTaxAmount": "$[*].totalTaxAmount", "vendorName": "$[*].number"}, "sourceModifiedDate": ["$[*].lastModifiedDateTime"]} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-custom-data-type-configuration: + Unauthorized: + parameters: + path: + platformKey: "gbol" + customDataIdentifier: "DynamicsPurchaseOrders" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-custom-data-type-records: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customDataIdentifier: "DynamicsPurchaseOrders" + query: + page: 1 + pageSize: 100 + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + refresh-custom-data-type: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + customDataIdentifier: "DynamicsPurchaseOrders" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-create-update-model-options-by-data-type: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + dataType: "invoices" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-push-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + pushOperationKey: "5ad92d18-1314-44b7-bd71-2a11cd0470da" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company-push-history: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + refresh-company-data: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + refresh-data-type: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "invoices" + query: {} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company-data-status: + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accountTransactions": {"currentStatus": "Complete", "dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "balanceSheet": {"currentStatus": "Complete", "dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bankAccounts": {"currentStatus": "Complete", "dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bankTransactions": {"currentStatus": "Complete", "dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-accountBalances": {"currentStatus": "Complete", "dataType": "banking-accountBalances", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-accounts": {"currentStatus": "Complete", "dataType": "banking-accounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-transactionCategories": {"currentStatus": "Complete", "dataType": "banking-transactionCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-transactions": {"currentStatus": "Complete", "dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "billCreditNotes": {"currentStatus": "Complete", "dataType": "billCreditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "billPayments": {"currentStatus": "Complete", "dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bills": {"currentStatus": "Complete", "dataType": "bills", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "cashFlowStatement": {"currentStatus": "Complete", "dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "chartOfAccounts": {"currentStatus": "Complete", "dataType": "chartOfAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-companyInfo": {"currentStatus": "Complete", "dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-customers": {"currentStatus": "Complete", "dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-disputes": {"currentStatus": "Complete", "dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-locations": {"currentStatus": "Complete", "dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-orders": {"currentStatus": "Complete", "dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-paymentMethods": {"currentStatus": "Complete", "dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-payments": {"currentStatus": "Complete", "dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-productCategories": {"currentStatus": "Complete", "dataType": "commerce-productCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-products": {"currentStatus": "Complete", "dataType": "commerce-products", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-taxComponents": {"currentStatus": "Complete", "dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-transactions": {"currentStatus": "Complete", "dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "company": {"currentStatus": "Complete", "dataType": "company", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "creditNotes": {"currentStatus": "Complete", "dataType": "creditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "customers": {"currentStatus": "Complete", "dataType": "customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "directCosts": {"currentStatus": "Complete", "dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "directIncomes": {"currentStatus": "Complete", "dataType": "directIncomes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "invoices": {"currentStatus": "Complete", "dataType": "invoices", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "itemReceipts": {"currentStatus": "Complete", "dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "items": {"currentStatus": "Complete", "dataType": "items", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "journalEntries": {"currentStatus": "Complete", "dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "journals": {"currentStatus": "Complete", "dataType": "journals", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "paymentMethods": {"currentStatus": "Complete", "dataType": "paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "payments": {"currentStatus": "Complete", "dataType": "payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "profitAndLoss": {"currentStatus": "Complete", "dataType": "profitAndLoss", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "purchaseOrders": {"currentStatus": "Complete", "dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "salesOrders": {"currentStatus": "Complete", "dataType": "salesOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "suppliers": {"currentStatus": "Complete", "dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "taxRates": {"currentStatus": "Complete", "dataType": "taxRates", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "trackingCategories": {"currentStatus": "Complete", "dataType": "trackingCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "transfers": {"currentStatus": "Complete", "dataType": "transfers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-pull-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + datasetId: "71a4c0fb-8e15-45bd-958d-330b4e6e9f07" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-pull-operations: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=2&pageSize=2"}, "self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history"}}, "pageNumber": 0, "pageSize": 0, "results": [{"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial"}], "totalResults": 0} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-integration: + Unauthorized: + parameters: + path: + platformKey: "gbol" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-integrations-branding: + Unauthorized: + parameters: + path: + platformKey: "gbol" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-integrations: + "": + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Malformed query: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + configure-supplemental-data: + Xero - Accounts: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + Xero - Invoices: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + Xero - Items: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + Xero - Contacts: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + Xero - Tax rates: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + QBO - Customers: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + QBO - Invoices: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + Unauthorized: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + requestBody: + application/json: {"supplementalDataConfig": {"orders-supplemental-data": {"dataSource": "/orders", "pullData": {"orderNumber": "order_num"}, "pushData": {"orderNumber": "order_num"}}}} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-supplemental-data-configuration: + Unauthorized: + parameters: + path: + platformKey: "gbol" + dataType: "invoices" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-rule: + Company data connection status changed: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + New company synchronized: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "New company synchronised"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + Data sync completed: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "Data sync completed"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + Dataset data changed: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "Dataset data changed"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + Dataset status has changed to an error state: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "Data Sync Status Changed To Error"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + Push operation status has changed: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "Push Operation Status Changed"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + Push operation has timed out: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "Push Operation Timed Out"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "id": "ff89c50e-a719-4ef5-a182-9917e53927b6", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + Account categories updated: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "Account Categories Updated"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + Sync Connection Deleted: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "Sync Connection Deleted"} + responses: + "200": + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + "401": {} + Unauthorized: + requestBody: + application/json: {"companyId": "39b73b17-cc2e-429e-915d-71654e9dcd1e", "notifiers": {"emails": ["info@client.com"], "webhook": "https://webhook.client.com"}, "type": "DataConnectionStatusChanged"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-webhook-consumer: + Subscribe consumer to one or more event types: + requestBody: + application/json: {"eventTypes": ["DataSyncCompleted", "Dataset data changed"], "url": "https://example.com/webhoook-consumer"} + responses: + "201": + application/json: {"disabled": false, "eventTypes": ["DataSyncCompleted", "DatasetDataChanged"], "id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumer"} + Subscribe consumer with disabled endpoint: + requestBody: + application/json: {"disabled": true, "eventTypes": ["DataSyncCompleted"], "url": "https://example.com/webhoook-consumer"} + responses: + "201": + application/json: {"disabled": true, "eventTypes": ["DataSyncCompleted"], "id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumer"} + Malformed query: + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + delete-webhook-consumer: + Unauthorized: + parameters: + path: + webhookId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-webhook: + Unauthorized: + parameters: + path: + ruleId: "7318949f-c008-4936-a8ff-10d7ab563fa6" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-rules: + "": + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "totalResults": 1} + "400": {} + Example: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/rules?page=1&pageSize=100"}, "self": {"href": "/rules"}}, "pageNumber": 1, "pageSize": 100, "results": [{"id": "fcfbfe0b-fe73-47ed-a7fe-0018567f5da2", "notifiers": {"emails": [], "webhook": "https://webhook.site/6d385ea9-bcf9-48e4-9103-1958ccb54997"}, "type": "DataConnectionStatusChanged"}], "totalResults": 1} + Malformed query: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-webhook-consumers: + Webhook consumers: + responses: + "200": + application/json: {"results": [{"disabled": false, "eventTypes": ["DataSyncCompleted"], "id": "12571faf-0898-47e7-afdd-0fe9eb0a9bf5", "url": "https://example.com/webhoook-consumers/sync-complete"}, {"disabled": true, "eventTypes": ["DatasetDataChanged"], "id": "ca3cac86-7925-4759-abc2-96405780fdfa", "url": "https://example.com/webhoook-consumers/dataset-changed"}]} + Malformed query: + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} +generatedTests: {} diff --git a/platform/.speakeasy/gen.yaml b/platform/.speakeasy/gen.yaml index 93c7d3d0c..a7d3b2bd0 100644 --- a/platform/.speakeasy/gen.yaml +++ b/platform/.speakeasy/gen.yaml @@ -9,17 +9,25 @@ generation: requestResponseComponentNamesFeb2024: false auth: oAuth2ClientCredentialsEnabled: false + oAuth2PasswordEnabled: false telemetryEnabled: true python: - version: 3.5.0 + version: 4.0.0 additionalDependencies: dev: {} main: {} author: Codat + authors: + - Speakeasy clientServerStatusCodesAsErrors: true - description: Manage the building blocks of Codat, including companies, connections, - and more. + defaultErrorName: SDKError + description: Manage the building blocks of Codat, including companies, connections, and more. + enumFormat: enum + fixFlags: + responseRequiredSep2024: false flattenGlobalSecurity: false + flattenRequests: false + flatteningOrder: parameters-first imports: option: openapi paths: @@ -30,13 +38,9 @@ python: webhooks: models/webhooks inputModelSuffix: input maxMethodParams: 0 + methodArguments: infer-optional-args outputModelSuffix: output packageName: codat-platform projectUrls: {} responseFormat: flat - authors: - - Speakeasy - enumFormat: enum - flattenRequests: false - methodArguments: infer-optional-args templateVersion: v2 diff --git a/platform/.vscode/settings.json b/platform/.vscode/settings.json new file mode 100644 index 000000000..8d79f0abb --- /dev/null +++ b/platform/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "python.testing.pytestArgs": ["tests", "-vv"], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "pylint.args": ["--rcfile=pylintrc"] +} diff --git a/platform/CONTRIBUTING.md b/platform/CONTRIBUTING.md new file mode 100644 index 000000000..d585717fc --- /dev/null +++ b/platform/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/platform/README.md b/platform/README.md index dc03fc044..a46ac8bcc 100644 --- a/platform/README.md +++ b/platform/README.md @@ -4,69 +4,158 @@ Manage the building blocks of Codat, including companies, connections, and more. + +## Summary + +Platform API: Platform API + +An API for the common components of all of Codat's products. + +These end points cover creating and managing your companies, data connections, and integrations. + +[Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) + +--- + +## Endpoints + +| Endpoints | Description | +| :- |:- | +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Connection management | Configure connection management UI and retrieve access tokens for authentication. | +| Webhooks | Create and manage webhooks that listen to Codat's events. | +| Integrations | Get a list of integrations supported by Codat and their logos. | +| Refresh data | Initiate data refreshes, view pull status and history. | +| Settings | Manage company profile configuration, sync settings, and API keys. | +| Push data | Initiate and monitor Create, Update, and Delete operations. | +| Supplemental data | Configure and pull additional data you can include in Codat's standard data types. | +| Custom data type | Configure and pull additional data types that are not included in Codat's standardized data model. | + + + + +## Table of Contents + +* [SDK Installation](#sdk-installation) +* [IDE Support](#ide-support) +* [SDK Example Usage](#sdk-example-usage) +* [Available Resources and Operations](#available-resources-and-operations) +* [Retries](#retries) +* [Error Handling](#error-handling) +* [Server Selection](#server-selection) +* [Custom HTTP Client](#custom-http-client) +* [Authentication](#authentication) +* [Debugging](#debugging) + + ## SDK Installation +The SDK can be installed with either *pip* or *poetry* package managers. + +### PIP + +*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line. + ```bash pip install codat-platform ``` + +### Poetry + +*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies. + +```bash +poetry add codat-platform +``` ## Example Usage + +## IDE Support + +### PyCharm + +Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin. + +- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/) + + ## SDK Example Usage ### Example ```python -import codatplatform -from codatplatform.models import shared +# Synchronous Example +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) - -res = s.settings.create_api_key(req) +) as s: + res = s.settings.create_api_key(request={ + "name": "azure-invoice-finance-processor", + }) + + if res is not None: + # handle response + pass +``` -if res.api_key_details is not None: - # handle response - pass +
+The same SDK client can also be used to make asychronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +from codat_platform import CodatPlatform +from codat_platform.models import shared + +async def main(): + async with CodatPlatform( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), + ) as s: + res = await s.settings.create_api_key_async(request={ + "name": "azure-invoice-finance-processor", + }) + + if res is not None: + # handle response + pass + +asyncio.run(main()) ``` ## Available Resources and Operations -### [settings](docs/sdks/settings/README.md) +
+Available methods -* [create_api_key](docs/sdks/settings/README.md#create_api_key) - Create API key -* [delete_api_key](docs/sdks/settings/README.md#delete_api_key) - Delete API key -* [get_profile](docs/sdks/settings/README.md#get_profile) - Get profile -* [get_sync_settings](docs/sdks/settings/README.md#get_sync_settings) - Get sync settings -* [list_api_keys](docs/sdks/settings/README.md#list_api_keys) - List API keys -* [update_profile](docs/sdks/settings/README.md#update_profile) - Update profile -* [update_sync_settings](docs/sdks/settings/README.md#update_sync_settings) - Update all sync settings ### [companies](docs/sdks/companies/README.md) +* [add_product](docs/sdks/companies/README.md#add_product) - Add product * [create](docs/sdks/companies/README.md#create) - Create company * [delete](docs/sdks/companies/README.md#delete) - Delete a company * [get](docs/sdks/companies/README.md#get) - Get company +* [get_access_token](docs/sdks/companies/README.md#get_access_token) - Get company access token * [list](docs/sdks/companies/README.md#list) - List companies +* [remove_product](docs/sdks/companies/README.md#remove_product) - Remove product * [update](docs/sdks/companies/README.md#update) - Update company ### [connection_management](docs/sdks/connectionmanagement/README.md) * [get_access_token](docs/sdks/connectionmanagement/README.md#get_access_token) - Get access token -### [connection_management.cors_settings](docs/sdks/corssettings/README.md) +#### [connection_management.cors_settings](docs/sdks/corssettings/README.md) * [get](docs/sdks/corssettings/README.md#get) - Get CORS settings * [set](docs/sdks/corssettings/README.md#set) - Set CORS settings @@ -87,6 +176,12 @@ if res.api_key_details is not None: * [list](docs/sdks/customdatatype/README.md#list) - List custom data type records * [refresh](docs/sdks/customdatatype/README.md#refresh) - Refresh custom data type +### [integrations](docs/sdks/integrations/README.md) + +* [get](docs/sdks/integrations/README.md#get) - Get integration +* [get_branding](docs/sdks/integrations/README.md#get_branding) - Get branding +* [list](docs/sdks/integrations/README.md#list) - List integrations + ### [push_data](docs/sdks/pushdata/README.md) * [get_model_options](docs/sdks/pushdata/README.md#get_model_options) - Get push options @@ -101,18 +196,15 @@ if res.api_key_details is not None: * [get_pull_operation](docs/sdks/refreshdata/README.md#get_pull_operation) - Get pull operation * [list_pull_operations](docs/sdks/refreshdata/README.md#list_pull_operations) - List pull operations -### [groups](docs/sdks/groups/README.md) - -* [add_company](docs/sdks/groups/README.md#add_company) - Add company -* [create](docs/sdks/groups/README.md#create) - Create group -* [list](docs/sdks/groups/README.md#list) - List groups -* [remove_company](docs/sdks/groups/README.md#remove_company) - Remove company - -### [integrations](docs/sdks/integrations/README.md) +### [settings](docs/sdks/settings/README.md) -* [get](docs/sdks/integrations/README.md#get) - Get integration -* [get_branding](docs/sdks/integrations/README.md#get_branding) - Get branding -* [list](docs/sdks/integrations/README.md#list) - List integrations +* [create_api_key](docs/sdks/settings/README.md#create_api_key) - Create API key +* [delete_api_key](docs/sdks/settings/README.md#delete_api_key) - Delete API key +* [get_profile](docs/sdks/settings/README.md#get_profile) - Get profile +* [get_sync_settings](docs/sdks/settings/README.md#get_sync_settings) - Get sync settings +* [list_api_keys](docs/sdks/settings/README.md#list_api_keys) - List API keys +* [update_profile](docs/sdks/settings/README.md#update_profile) - Update profile +* [update_sync_settings](docs/sdks/settings/README.md#update_sync_settings) - Update all sync settings ### [supplemental_data](docs/sdks/supplementaldata/README.md) @@ -121,12 +213,14 @@ if res.api_key_details is not None: ### [webhooks](docs/sdks/webhooks/README.md) -* [~~create~~](docs/sdks/webhooks/README.md#create) - Create webhook :warning: **Deprecated** +* [~~create~~](docs/sdks/webhooks/README.md#create) - Create webhook (legacy) :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** +* [~~get~~](docs/sdks/webhooks/README.md#get) - Get webhook (legacy) :warning: **Deprecated** +* [~~list~~](docs/sdks/webhooks/README.md#list) - List webhooks (legacy) :warning: **Deprecated** * [list_consumers](docs/sdks/webhooks/README.md#list_consumers) - List webhook consumers + +
@@ -138,51 +232,45 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared from codatplatform.utils import BackoffStrategy, RetryConfig -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.settings.create_api_key(request={ + "name": "azure-invoice-finance-processor", + }, + RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) - -res = s.settings.create_api_key(req, - RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False)) - -if res.api_key_details is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared from codatplatform.utils import BackoffStrategy, RetryConfig -s = codatplatform.CodatPlatform( - retry_config=RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False), +with CodatPlatform( + retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) +) as s: + res = s.settings.create_api_key(request={ + "name": "azure-invoice-finance-processor", + }) -res = s.settings.create_api_key(req) - -if res.api_key_details is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -190,106 +278,77 @@ if res.api_key_details is not None: ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception. + +By default, an API error will raise a errors.SDKError exception, which has the following properties: -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,409,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Property | Type | Description | +|-----------------|------------------|-----------------------| +| `.status_code` | *int* | The HTTP status code | +| `.message` | *str* | The error message | +| `.raw_response` | *httpx.Response* | The raw HTTP response | +| `.body` | *str* | The response content | + +When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create_api_key_async` method may raise the following exceptions: + +| Error Type | Status Code | Content Type | +| ------------------- | -------------------------------------- | ---------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ### Example ```python -import codatplatform -from codatplatform.models import errors, shared +from codat_platform import CodatPlatform +from codat_platform.models import errors, shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) - -res = None -try: - res = s.settings.create_api_key(req) -except errors.ErrorMessage as e: - # handle exception - raise(e) -except errors.SDKError as e: - # handle exception - raise(e) - -if res.api_key_details is not None: - # handle response - pass - +) as s: + res = None + try: + res = s.settings.create_api_key(request={ + "name": "azure-invoice-finance-processor", + }) + + if res is not None: + # handle response + pass + + except errors.ErrorMessage as e: + # handle e.data: errors.ErrorMessageData + raise(e) + except errors.SDKError as e: + # handle exception + raise(e) ``` ## Server Selection -### Select Server by Index - -You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: - -| # | Server | Variables | -| - | ------ | --------- | -| 0 | `https://api.codat.io` | None | - -#### Example - -```python -import codatplatform -from codatplatform.models import shared - -s = codatplatform.CodatPlatform( - server_idx=0, - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), -) - -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) - -res = s.settings.create_api_key(req) - -if res.api_key_details is not None: - # handle response - pass - -``` - - ### Override Server URL Per-Client The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( server_url="https://api.codat.io", security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) +) as s: + res = s.settings.create_api_key(request={ + "name": "azure-invoice-finance-processor", + }) -res = s.settings.create_api_key(req) - -if res.api_key_details is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -297,16 +356,81 @@ if res.api_key_details is not None: ## Custom HTTP Client -The Python SDK makes API calls using the [requests](https://pypi.org/project/requests/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object. +The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. +Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. +This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. For example, you could specify a header for every request that this sdk makes as follows: ```python -import codatplatform -import requests +from codat_platform import CodatPlatform +import httpx -http_client = requests.Session() -http_client.headers.update({'x-custom-header': 'someValue'}) -s = codatplatform.CodatPlatform(client=http_client) +http_client = httpx.Client(headers={"x-custom-header": "someValue"}) +s = CodatPlatform(client=http_client) +``` + +or you could wrap the client with your own custom logic: +```python +from codat_platform import CodatPlatform +from codat_platform.httpclient import AsyncHttpClient +import httpx + +class CustomClient(AsyncHttpClient): + client: AsyncHttpClient + + def __init__(self, client: AsyncHttpClient): + self.client = client + + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + request.headers["Client-Level-Header"] = "added by client" + + return await self.client.send( + request, stream=stream, auth=auth, follow_redirects=follow_redirects + ) + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + return self.client.build_request( + method, + url, + content=content, + data=data, + files=files, + json=json, + params=params, + headers=headers, + cookies=cookies, + timeout=timeout, + extensions=extensions, + ) + +s = CodatPlatform(async_client=CustomClient(httpx.AsyncClient())) ``` @@ -317,33 +441,45 @@ s = codatplatform.CodatPlatform(client=http_client) This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ------------- | ------------- | ------------- | -| `auth_header` | apiKey | API key | +| Name | Type | Scheme | +| ------------- | ------ | ------- | +| `auth_header` | apiKey | API key | You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example: ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.settings.create_api_key(request={ + "name": "azure-invoice-finance-processor", + }) + + if res is not None: + # handle response + pass -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) +``` + -res = s.settings.create_api_key(req) + +## Debugging -if res.api_key_details is not None: - # handle response - pass +You can setup your SDK to emit debug logs for SDK requests and responses. +You can pass your own logger class directly into your SDK. +```python +from codat_platform import CodatPlatform +import logging + +logging.basicConfig(level=logging.DEBUG) +s = CodatPlatform(debug_logger=logging.getLogger("codat_platform")) ``` - + diff --git a/platform/RELEASES.md b/platform/RELEASES.md index c1084ffc6..23f0c5737 100644 --- a/platform/RELEASES.md +++ b/platform/RELEASES.md @@ -98,4 +98,14 @@ Based on: ### Generated - [python v3.5.0] platform ### Releases -- [PyPI v3.5.0] https://pypi.org/project/codat-platform/3.5.0 - platform \ No newline at end of file +- [PyPI v3.5.0] https://pypi.org/project/codat-platform/3.5.0 - platform + +## 2024-11-26 15:14:48 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.446.1 (2.462.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v4.0.0] platform +### Releases +- [PyPI v4.0.0] https://pypi.org/project/codat-platform/4.0.0 - platform \ No newline at end of file diff --git a/platform/USAGE.md b/platform/USAGE.md index 7f3254461..30e5aaf2b 100644 --- a/platform/USAGE.md +++ b/platform/USAGE.md @@ -1,23 +1,46 @@ ```python -import codatplatform -from codatplatform.models import shared +# Synchronous Example +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.settings.create_api_key(request={ + "name": "azure-invoice-finance-processor", + }) -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) + if res is not None: + # handle response + pass +``` + +
+ +The same SDK client can also be used to make asychronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +from codat_platform import CodatPlatform +from codat_platform.models import shared -res = s.settings.create_api_key(req) +async def main(): + async with CodatPlatform( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), + ) as s: + res = await s.settings.create_api_key_async(request={ + "name": "azure-invoice-finance-processor", + }) -if res.api_key_details is not None: - # handle response - pass + if res is not None: + # handle response + pass +asyncio.run(main()) ``` \ No newline at end of file diff --git a/platform/docs/models/errors/errormessage.md b/platform/docs/models/errors/errormessage.md index 10b0ad779..c795816c6 100644 --- a/platform/docs/models/errors/errormessage.md +++ b/platform/docs/models/errors/errormessage.md @@ -1,6 +1,6 @@ # ErrorMessage -Bad Request +Your API request was not properly authorized. ## Fields @@ -13,4 +13,4 @@ Bad Request | `error` | *Optional[str]* | :heavy_minus_sign: | A brief description of the error. | | `service` | *Optional[str]* | :heavy_minus_sign: | Codat's service the returned the error. | | `status_code` | *Optional[int]* | :heavy_minus_sign: | The HTTP status code returned by the error. | -| `validation` | [Optional[shared.ErrorValidation]](../../models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | \ No newline at end of file +| `validation` | [OptionalNullable[shared.ErrorValidation]](../../models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | \ No newline at end of file diff --git a/platform/docs/models/operations/addcompanytogrouprequest.md b/platform/docs/models/operations/addcompanytogrouprequest.md deleted file mode 100644 index 427289838..000000000 --- a/platform/docs/models/operations/addcompanytogrouprequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# AddCompanyToGroupRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `company_group_assignment` | [Optional[shared.CompanyGroupAssignment]](../../models/shared/companygroupassignment.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/operations/addproductrequest.md b/platform/docs/models/operations/addproductrequest.md new file mode 100644 index 000000000..46ed54459 --- /dev/null +++ b/platform/docs/models/operations/addproductrequest.md @@ -0,0 +1,9 @@ +# AddProductRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `product_identifier` | *str* | :heavy_check_mark: | Human-readable product identifier for a product. | bank-feeds | \ No newline at end of file diff --git a/platform/docs/models/operations/configurecustomdatatyperesponse.md b/platform/docs/models/operations/configurecustomdatatyperesponse.md deleted file mode 100644 index 718751364..000000000 --- a/platform/docs/models/operations/configurecustomdatatyperesponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ConfigureCustomDataTypeResponse - - -## 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 diff --git a/platform/docs/models/operations/configuresupplementaldataresponse.md b/platform/docs/models/operations/configuresupplementaldataresponse.md deleted file mode 100644 index 67effaffa..000000000 --- a/platform/docs/models/operations/configuresupplementaldataresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ConfigureSupplementalDataResponse - - -## 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/createapikeyresponse.md b/platform/docs/models/operations/createapikeyresponse.md deleted file mode 100644 index 2aaf8231c..000000000 --- a/platform/docs/models/operations/createapikeyresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateAPIKeyResponse - - -## 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 | -| `api_key_details` | [Optional[shared.APIKeyDetails]](../../models/shared/apikeydetails.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/platform/docs/models/operations/createconnectionresponse.md b/platform/docs/models/operations/createconnectionresponse.md deleted file mode 100644 index 5bafc316c..000000000 --- a/platform/docs/models/operations/createconnectionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateConnectionResponse - - -## 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 diff --git a/platform/docs/models/operations/creategroupresponse.md b/platform/docs/models/operations/creategroupresponse.md deleted file mode 100644 index cdccd50c1..000000000 --- a/platform/docs/models/operations/creategroupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateGroupResponse - - -## 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 | -| `group` | [Optional[shared.Group]](../../models/shared/group.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/platform/docs/models/operations/createruleresponse.md b/platform/docs/models/operations/createruleresponse.md deleted file mode 100644 index ee2615b06..000000000 --- a/platform/docs/models/operations/createruleresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateRuleResponse - - -## 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 diff --git a/platform/docs/models/operations/createwebhookconsumerresponse.md b/platform/docs/models/operations/createwebhookconsumerresponse.md deleted file mode 100644 index cc28fc5c5..000000000 --- a/platform/docs/models/operations/createwebhookconsumerresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/deleteapikeyresponse.md b/platform/docs/models/operations/deleteapikeyresponse.md deleted file mode 100644 index 7a65db7b8..000000000 --- a/platform/docs/models/operations/deleteapikeyresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteAPIKeyResponse - - -## 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 | -| `error_message` | *Optional[errors.ErrorMessage]* | :heavy_minus_sign: | Too many requests were made in a given amount of time. Wait a short period and then try again. | \ No newline at end of file diff --git a/platform/docs/models/operations/deletecompanyresponse.md b/platform/docs/models/operations/deletecompanyresponse.md deleted file mode 100644 index 7dfc00111..000000000 --- a/platform/docs/models/operations/deletecompanyresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteCompanyResponse - - -## 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/deleteconnectionresponse.md b/platform/docs/models/operations/deleteconnectionresponse.md deleted file mode 100644 index 373abf82a..000000000 --- a/platform/docs/models/operations/deleteconnectionresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteConnectionResponse - - -## 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/deletewebhookconsumerresponse.md b/platform/docs/models/operations/deletewebhookconsumerresponse.md deleted file mode 100644 index 906dcd752..000000000 --- a/platform/docs/models/operations/deletewebhookconsumerresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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/removecompanyfromgrouprequest.md b/platform/docs/models/operations/getcompanyaccesstokenrequest.md similarity index 72% rename from platform/docs/models/operations/removecompanyfromgrouprequest.md rename to platform/docs/models/operations/getcompanyaccesstokenrequest.md index a660f6562..255289cd1 100644 --- a/platform/docs/models/operations/removecompanyfromgrouprequest.md +++ b/platform/docs/models/operations/getcompanyaccesstokenrequest.md @@ -1,9 +1,8 @@ -# RemoveCompanyFromGroupRequest +# GetCompanyAccessTokenRequest ## Fields | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `group_id` | *str* | :heavy_check_mark: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/models/operations/getcompanydatastatusresponse.md b/platform/docs/models/operations/getcompanydatastatusresponse.md deleted file mode 100644 index 059f2033d..000000000 --- a/platform/docs/models/operations/getcompanydatastatusresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCompanyDataStatusResponse - - -## 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 | -| `data_statuses` | [Optional[shared.DataStatuses]](../../models/shared/datastatuses.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/models/operations/getcompanypushhistoryrequest.md b/platform/docs/models/operations/getcompanypushhistoryrequest.md index 46b30c39e..385d11ce6 100644 --- a/platform/docs/models/operations/getcompanypushhistoryrequest.md +++ b/platform/docs/models/operations/getcompanypushhistoryrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/models/operations/getcompanypushhistoryresponse.md b/platform/docs/models/operations/getcompanypushhistoryresponse.md deleted file mode 100644 index e451a87d9..000000000 --- a/platform/docs/models/operations/getcompanypushhistoryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCompanyPushHistoryResponse - - -## 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 | {
"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/getconnectionmanagementaccesstokenresponse.md b/platform/docs/models/operations/getconnectionmanagementaccesstokenresponse.md deleted file mode 100644 index 0a2e41242..000000000 --- a/platform/docs/models/operations/getconnectionmanagementaccesstokenresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetConnectionManagementAccessTokenResponse - - -## 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 | -| `connection_management_access_token` | [Optional[shared.ConnectionManagementAccessToken]](../../models/shared/connectionmanagementaccesstoken.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/platform/docs/models/operations/getconnectionmanagementcorssettingsresponse.md b/platform/docs/models/operations/getconnectionmanagementcorssettingsresponse.md deleted file mode 100644 index e43c12266..000000000 --- a/platform/docs/models/operations/getconnectionmanagementcorssettingsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetConnectionManagementCorsSettingsResponse - - -## 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_management_allowed_origins` | [Optional[shared.ConnectionManagementAllowedOrigins]](../../models/shared/connectionmanagementallowedorigins.md) | :heavy_minus_sign: | Success | {
"allowedOrigins": [
"https://www.bank-of-dave.com"
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md b/platform/docs/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md index 0aaa534c5..a359134d2 100644 --- a/platform/docs/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md +++ b/platform/docs/models/operations/getcreateupdatemodeloptionsbydatatyperequest.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | | `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `data_type` | [shared.SchemaDataType](../../models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type | invoices | \ No newline at end of file +| `data_type` | [shared.SchemaDataType](../../models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type. | invoices | \ No newline at end of file diff --git a/platform/docs/models/operations/getcreateupdatemodeloptionsbydatatyperesponse.md b/platform/docs/models/operations/getcreateupdatemodeloptionsbydatatyperesponse.md deleted file mode 100644 index 57d39fdca..000000000 --- a/platform/docs/models/operations/getcreateupdatemodeloptionsbydatatyperesponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCreateUpdateModelOptionsByDataTypeResponse - - -## 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 | -| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/models/operations/getcustomdatatypeconfigurationresponse.md b/platform/docs/models/operations/getcustomdatatypeconfigurationresponse.md deleted file mode 100644 index 1a0b475aa..000000000 --- a/platform/docs/models/operations/getcustomdatatypeconfigurationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCustomDataTypeConfigurationResponse - - -## 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 | -| `custom_data_type_records` | [Optional[shared.CustomDataTypeRecords]](../../models/shared/customdatatyperecords.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/models/operations/getintegrationresponse.md b/platform/docs/models/operations/getintegrationresponse.md deleted file mode 100644 index 67485fa77..000000000 --- a/platform/docs/models/operations/getintegrationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetIntegrationResponse - - -## 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 diff --git a/platform/docs/models/operations/getprofileresponse.md b/platform/docs/models/operations/getprofileresponse.md deleted file mode 100644 index 8c5b703de..000000000 --- a/platform/docs/models/operations/getprofileresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetProfileResponse - - -## 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 diff --git a/platform/docs/models/operations/getprofilesyncsettingsresponse.md b/platform/docs/models/operations/getprofilesyncsettingsresponse.md deleted file mode 100644 index ca0becd06..000000000 --- a/platform/docs/models/operations/getprofilesyncsettingsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetProfileSyncSettingsResponse - - -## 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 | -| `sync_settings` | [Optional[shared.SyncSettings]](../../models/shared/syncsettings.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/models/operations/getpulloperationresponse.md b/platform/docs/models/operations/getpulloperationresponse.md deleted file mode 100644 index 2223df457..000000000 --- a/platform/docs/models/operations/getpulloperationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPullOperationResponse - - -## 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 diff --git a/platform/docs/models/operations/getpushoperationresponse.md b/platform/docs/models/operations/getpushoperationresponse.md deleted file mode 100644 index 17e937758..000000000 --- a/platform/docs/models/operations/getpushoperationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPushOperationResponse - - -## 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 | -| `push_operation` | [Optional[shared.PushOperation]](../../models/shared/pushoperation.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/models/operations/getsupplementaldataconfigurationresponse.md b/platform/docs/models/operations/getsupplementaldataconfigurationresponse.md deleted file mode 100644 index b3dee902e..000000000 --- a/platform/docs/models/operations/getsupplementaldataconfigurationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSupplementalDataConfigurationResponse - - -## 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 diff --git a/platform/docs/models/operations/getwebhookresponse.md b/platform/docs/models/operations/getwebhookresponse.md deleted file mode 100644 index 8300b5a83..000000000 --- a/platform/docs/models/operations/getwebhookresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetWebhookResponse - - -## 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 diff --git a/platform/docs/models/operations/listapikeysresponse.md b/platform/docs/models/operations/listapikeysresponse.md deleted file mode 100644 index c1f0c8546..000000000 --- a/platform/docs/models/operations/listapikeysresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListAPIKeysResponse - - -## 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 | -| `api_keys` | [Optional[shared.APIKeys]](../../models/shared/apikeys.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/platform/docs/models/operations/listcompaniesrequest.md b/platform/docs/models/operations/listcompaniesrequest.md index 8dfaf69d5..9fc1a9c7e 100644 --- a/platform/docs/models/operations/listcompaniesrequest.md +++ b/platform/docs/models/operations/listcompaniesrequest.md @@ -8,4 +8,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/models/operations/listcompaniesresponse.md b/platform/docs/models/operations/listcompaniesresponse.md deleted file mode 100644 index 634d146a1..000000000 --- a/platform/docs/models/operations/listcompaniesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListCompaniesResponse - - -## 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 | {
"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/listconnectionsrequest.md b/platform/docs/models/operations/listconnectionsrequest.md index e13ad736b..949d3e3b6 100644 --- a/platform/docs/models/operations/listconnectionsrequest.md +++ b/platform/docs/models/operations/listconnectionsrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/models/operations/listconnectionsresponse.md b/platform/docs/models/operations/listconnectionsresponse.md deleted file mode 100644 index bf806ddc5..000000000 --- a/platform/docs/models/operations/listconnectionsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListConnectionsResponse - - -## 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 | {
"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/listcustomdatatyperecordsresponse.md b/platform/docs/models/operations/listcustomdatatyperecordsresponse.md deleted file mode 100644 index a8a5baed4..000000000 --- a/platform/docs/models/operations/listcustomdatatyperecordsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListCustomDataTypeRecordsResponse - - -## 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 | -| `custom_data_type_records` | [Optional[shared.CustomDataTypeRecords]](../../models/shared/customdatatyperecords.md) | :heavy_minus_sign: | OK | \ No newline at end of file diff --git a/platform/docs/models/operations/listgroupsresponse.md b/platform/docs/models/operations/listgroupsresponse.md deleted file mode 100644 index c4ded7185..000000000 --- a/platform/docs/models/operations/listgroupsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListGroupsResponse - - -## 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 | -| `groups` | [Optional[shared.Groups]](../../models/shared/groups.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/platform/docs/models/operations/listintegrationsrequest.md b/platform/docs/models/operations/listintegrationsrequest.md index da0fc5d4e..fd8070b1e 100644 --- a/platform/docs/models/operations/listintegrationsrequest.md +++ b/platform/docs/models/operations/listintegrationsrequest.md @@ -8,4 +8,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/models/operations/listintegrationsresponse.md b/platform/docs/models/operations/listintegrationsresponse.md deleted file mode 100644 index 0fcdb98bc..000000000 --- a/platform/docs/models/operations/listintegrationsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListIntegrationsResponse - - -## 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 | {
"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/listpulloperationsrequest.md b/platform/docs/models/operations/listpulloperationsrequest.md index bdf3bef92..90a05e642 100644 --- a/platform/docs/models/operations/listpulloperationsrequest.md +++ b/platform/docs/models/operations/listpulloperationsrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/models/operations/listpulloperationsresponse.md b/platform/docs/models/operations/listpulloperationsresponse.md deleted file mode 100644 index 45665c995..000000000 --- a/platform/docs/models/operations/listpulloperationsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListPullOperationsResponse - - -## 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 | {
"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/listrulesrequest.md b/platform/docs/models/operations/listrulesrequest.md index 4e5be3efd..9946c52e8 100644 --- a/platform/docs/models/operations/listrulesrequest.md +++ b/platform/docs/models/operations/listrulesrequest.md @@ -8,4 +8,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/platform/docs/models/operations/listrulesresponse.md b/platform/docs/models/operations/listrulesresponse.md deleted file mode 100644 index 8064027d6..000000000 --- a/platform/docs/models/operations/listrulesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListRulesResponse - - -## 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 | {
"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 deleted file mode 100644 index aa7d3602d..000000000 --- a/platform/docs/models/operations/listwebhookconsumersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/refreshcompanydataresponse.md b/platform/docs/models/operations/refreshcompanydataresponse.md deleted file mode 100644 index 93bd7437d..000000000 --- a/platform/docs/models/operations/refreshcompanydataresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# RefreshCompanyDataResponse - - -## 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/refreshcustomdatatyperesponse.md b/platform/docs/models/operations/refreshcustomdatatyperesponse.md deleted file mode 100644 index 4883252c5..000000000 --- a/platform/docs/models/operations/refreshcustomdatatyperesponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# RefreshCustomDataTypeResponse - - -## 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 diff --git a/platform/docs/models/operations/refreshdatatyperequest.md b/platform/docs/models/operations/refreshdatatyperequest.md index 35df09d55..65ddb5954 100644 --- a/platform/docs/models/operations/refreshdatatyperequest.md +++ b/platform/docs/models/operations/refreshdatatyperequest.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `data_type` | [shared.SchemaDataType](../../models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type | invoices | +| `data_type` | [shared.SchemaDataType](../../models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type. | invoices | | `connection_id` | *Optional[str]* | :heavy_minus_sign: | Optionally, provide a data connection id to only queue pull operations on that connection. | | \ No newline at end of file diff --git a/platform/docs/models/operations/refreshdatatyperesponse.md b/platform/docs/models/operations/refreshdatatyperesponse.md deleted file mode 100644 index 79184cefc..000000000 --- a/platform/docs/models/operations/refreshdatatyperesponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# RefreshDataTypeResponse - - -## 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 diff --git a/platform/docs/models/operations/removecompanyfromgroupresponse.md b/platform/docs/models/operations/removecompanyfromgroupresponse.md deleted file mode 100644 index 13f08849b..000000000 --- a/platform/docs/models/operations/removecompanyfromgroupresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# RemoveCompanyFromGroupResponse - - -## 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/removeproductrequest.md b/platform/docs/models/operations/removeproductrequest.md new file mode 100644 index 000000000..279e8e66f --- /dev/null +++ b/platform/docs/models/operations/removeproductrequest.md @@ -0,0 +1,9 @@ +# RemoveProductRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `product_identifier` | *str* | :heavy_check_mark: | Human-readable product identifier for a product. | bank-feeds | \ No newline at end of file diff --git a/platform/docs/models/operations/setconnectionmanagementcorssettingsresponse.md b/platform/docs/models/operations/setconnectionmanagementcorssettingsresponse.md deleted file mode 100644 index 83f381967..000000000 --- a/platform/docs/models/operations/setconnectionmanagementcorssettingsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# SetConnectionManagementCorsSettingsResponse - - -## 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_management_allowed_origins` | [Optional[shared.ConnectionManagementAllowedOrigins]](../../models/shared/connectionmanagementallowedorigins.md) | :heavy_minus_sign: | Success | {
"allowedOrigins": [
"https://www.bank-of-dave.com"
]
} | \ No newline at end of file diff --git a/platform/docs/models/operations/unlinkconnectionresponse.md b/platform/docs/models/operations/unlinkconnectionresponse.md deleted file mode 100644 index 927c8dae6..000000000 --- a/platform/docs/models/operations/unlinkconnectionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UnlinkConnectionResponse - - -## 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 diff --git a/platform/docs/models/operations/updateconnectionauthorizationresponse.md b/platform/docs/models/operations/updateconnectionauthorizationresponse.md deleted file mode 100644 index d948afc02..000000000 --- a/platform/docs/models/operations/updateconnectionauthorizationresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateConnectionAuthorizationResponse - - -## 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 diff --git a/platform/docs/models/operations/updateprofileresponse.md b/platform/docs/models/operations/updateprofileresponse.md deleted file mode 100644 index e46f148a8..000000000 --- a/platform/docs/models/operations/updateprofileresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateProfileResponse - - -## 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 diff --git a/platform/docs/models/operations/updateprofilesyncsettingsresponse.md b/platform/docs/models/operations/updateprofilesyncsettingsresponse.md deleted file mode 100644 index d0c8d0286..000000000 --- a/platform/docs/models/operations/updateprofilesyncsettingsresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdateProfileSyncSettingsResponse - - -## 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/shared/apikeydetails.md b/platform/docs/models/shared/apikeydetails.md index 98c5052cb..0dde8e717 100644 --- a/platform/docs/models/shared/apikeydetails.md +++ b/platform/docs/models/shared/apikeydetails.md @@ -10,4 +10,4 @@ Details of the API key. | `api_key` | *Optional[str]* | :heavy_minus_sign: | The API key value used to make authenticated http requests. | ztHQGvnC4XN2CgUhaDWEG4ySLUJqWjp7zkbZkGHd | | `created_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | | `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the API key. | e288a972-b402-4b21-93f9-b5335ae5679c | -| `name` | *Optional[str]* | :heavy_minus_sign: | A meaningful name assigned to the API key. | azure-invoice-finance-processor | \ No newline at end of file +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | A meaningful name assigned to the API key. | azure-invoice-finance-processor | \ No newline at end of file diff --git a/platform/docs/models/shared/clientratelimitresetwebhookdata.md b/platform/docs/models/shared/clientratelimitresetwebhookdata.md index efbbe87f9..e585938fa 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 requests remaining for your client. | | +| `quota_remaining` | *OptionalNullable[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/operations/createcompanyresponse.md b/platform/docs/models/shared/clientratelimitwebhook.md similarity index 82% rename from platform/docs/models/operations/createcompanyresponse.md rename to platform/docs/models/shared/clientratelimitwebhook.md index 2687774f3..063e072ec 100644 --- a/platform/docs/models/operations/createcompanyresponse.md +++ b/platform/docs/models/shared/clientratelimitwebhook.md @@ -1,11 +1,11 @@ -# CreateCompanyResponse +# ClientRateLimitWebhook ## 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 | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | client.rateLimit.reset | +| `generated_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | +| `payload` | [Optional[shared.ClientRateLimitWebhookPayload]](../../models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/operations/getintegrationsbrandingresponse.md b/platform/docs/models/shared/clientratelimitwebhookpayload.md similarity index 80% rename from platform/docs/models/operations/getintegrationsbrandingresponse.md rename to platform/docs/models/shared/clientratelimitwebhookpayload.md index 2d18dc548..449b685f6 100644 --- a/platform/docs/models/operations/getintegrationsbrandingresponse.md +++ b/platform/docs/models/shared/clientratelimitwebhookpayload.md @@ -1,11 +1,10 @@ -# GetIntegrationsBrandingResponse +# ClientRateLimitWebhookPayload ## 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 | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `daily_quota` | *Optional[int]* | :heavy_minus_sign: | The number of available requests per day. | | +| `expiry_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `quota_remaining` | *Optional[int]* | :heavy_minus_sign: | Total number of requests remaining for your client. | | \ No newline at end of file diff --git a/platform/docs/models/shared/company.md b/platform/docs/models/shared/company.md index 28b0d3df8..6a4197324 100644 --- a/platform/docs/models/shared/company.md +++ b/platform/docs/models/shared/company.md @@ -15,9 +15,11 @@ When you create a company, you can specify a `name` and we will automatically ge | `name` | *str* | :heavy_check_mark: | The name of the company | Codat Ltd. | | `redirect` | *str* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | | `created` | *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 | -| `created_by_user_name` | *Optional[str]* | :heavy_minus_sign: | Name of user that created the company in Codat. | | +| `created_by_user_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of user that created the company in Codat. | | | `data_connections` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | | `description` | *Optional[str]* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | -| `groups` | List[[shared.GroupRef](../../models/shared/groupref.md)] | :heavy_minus_sign: | An array of groups the company has been assigned to. | | | `last_sync` | *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 | -| ~~`platform`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

`platformKeys` name used when creating the company. | Xero | \ No newline at end of file +| `products` | List[*str*] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | +| `reference_parent_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | +| `reference_subsidiary_companies` | List[[shared.CompanyReference](../../models/shared/companyreference.md)] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | +| `tags` | Dict[str, *str*] | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/platform/docs/models/shared/companyaccesstoken.md b/platform/docs/models/shared/companyaccesstoken.md new file mode 100644 index 000000000..a6304c6d3 --- /dev/null +++ b/platform/docs/models/shared/companyaccesstoken.md @@ -0,0 +1,12 @@ +# CompanyAccessToken + +Details of the access token provisioned for a company. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `access_token` | *str* | :heavy_check_mark: | The access token for the company. | | +| `expires_in` | *int* | :heavy_check_mark: | The number of seconds until the access token expires. | 86400 | +| `token_type` | *str* | :heavy_check_mark: | The type of token. | Bearer | \ No newline at end of file diff --git a/platform/docs/models/shared/companydetails.md b/platform/docs/models/shared/companydetails.md new file mode 100644 index 000000000..63f45debb --- /dev/null +++ b/platform/docs/models/shared/companydetails.md @@ -0,0 +1,18 @@ +# CompanyDetails + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `name` | *str* | :heavy_check_mark: | The name of the company | Codat Ltd. | +| `redirect` | *str* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | +| `created` | *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 | +| `created_by_user_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of user that created the company in Codat. | | +| `description` | *Optional[str]* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +| `last_sync` | *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 | +| `products` | List[*str*] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | +| `reference_parent_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | +| `reference_subsidiary_companies` | List[[shared.CompanyReference](../../models/shared/companyreference.md)] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | +| `tags` | Dict[str, *str*] | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/platform/docs/models/shared/companygroupassignment.md b/platform/docs/models/shared/companygroupassignment.md deleted file mode 100644 index bd1d6efa0..000000000 --- a/platform/docs/models/shared/companygroupassignment.md +++ /dev/null @@ -1,8 +0,0 @@ -# CompanyGroupAssignment - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `group_id` | *Optional[str]* | :heavy_minus_sign: | N/A | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/models/shared/companyreference.md b/platform/docs/models/shared/companyreference.md new file mode 100644 index 000000000..b651f69d5 --- /dev/null +++ b/platform/docs/models/shared/companyreference.md @@ -0,0 +1,12 @@ +# CompanyReference + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `description` | *Optional[str]* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `links` | [Optional[shared.CompanyReferenceLinks]](../../models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the company | Codat Ltd. | +| `tags` | Dict[str, *str*] | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/platform/docs/models/shared/companyreferencelinks.md b/platform/docs/models/shared/companyreferencelinks.md new file mode 100644 index 000000000..ee01fd320 --- /dev/null +++ b/platform/docs/models/shared/companyreferencelinks.md @@ -0,0 +1,10 @@ +# CompanyReferenceLinks + +A collection of links for the company. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `portal` | *Optional[str]* | :heavy_minus_sign: | Link to the company page in the portal. | \ No newline at end of file diff --git a/platform/docs/models/shared/companyrequestbody.md b/platform/docs/models/shared/companyrequestbody.md index a996dc2f2..3b85563a1 100644 --- a/platform/docs/models/shared/companyrequestbody.md +++ b/platform/docs/models/shared/companyrequestbody.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | | `description` | *Optional[str]* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | -| `groups` | List[[shared.GroupRef](../../models/shared/groupref.md)] | :heavy_minus_sign: | Reference to the groups that the company is assigned to. | | \ No newline at end of file +| `tags` | Dict[str, *str*] | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/platform/docs/models/operations/getcompanyresponse.md b/platform/docs/models/shared/companywebhook.md similarity index 82% rename from platform/docs/models/operations/getcompanyresponse.md rename to platform/docs/models/shared/companywebhook.md index a64f3c90c..314baa397 100644 --- a/platform/docs/models/operations/getcompanyresponse.md +++ b/platform/docs/models/shared/companywebhook.md @@ -1,11 +1,11 @@ -# GetCompanyResponse +# CompanyWebhook ## 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 | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | company.created | +| `generated_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event | ba29118f-5406-4e59-b05c-ba307ca38d01 | +| `payload` | [Optional[shared.CompanyDetails]](../../models/shared/companydetails.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/connection.md b/platform/docs/models/shared/connection.md index ea70426b5..bda988c97 100644 --- a/platform/docs/models/shared/connection.md +++ b/platform/docs/models/shared/connection.md @@ -25,7 +25,6 @@ Before you can use a data connection to pull or push data, the company must gran | `source_id` | *str* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | | `source_type` | [shared.SourceType](../../models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | | `status` | [shared.DataConnectionStatus](../../models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `additional_properties` | *Optional[Any]* | :heavy_minus_sign: | N/A | | | `connection_info` | Dict[str, *str*] | :heavy_minus_sign: | N/A | | | `data_connection_errors` | List[[shared.DataConnectionError](../../models/shared/dataconnectionerror.md)] | :heavy_minus_sign: | N/A | | | `last_sync` | *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 | \ No newline at end of file diff --git a/platform/docs/models/shared/connectionmanagementallowedorigins.md b/platform/docs/models/shared/connectionmanagementallowedorigins.md index 4a52b9a47..b12d572bb 100644 --- a/platform/docs/models/shared/connectionmanagementallowedorigins.md +++ b/platform/docs/models/shared/connectionmanagementallowedorigins.md @@ -1,5 +1,7 @@ # ConnectionManagementAllowedOrigins +Success + ## Fields diff --git a/platform/docs/models/operations/updatecompanyresponse.md b/platform/docs/models/shared/connectionwebhook.md similarity index 82% rename from platform/docs/models/operations/updatecompanyresponse.md rename to platform/docs/models/shared/connectionwebhook.md index 13e3f91ea..b41d3af3d 100644 --- a/platform/docs/models/operations/updatecompanyresponse.md +++ b/platform/docs/models/shared/connectionwebhook.md @@ -1,11 +1,11 @@ -# UpdateCompanyResponse +# ConnectionWebhook ## 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 | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | connection.created | +| `generated_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | +| `payload` | [Optional[shared.ConnectionWebhookPayload]](../../models/shared/connectionwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/operations/getconnectionresponse.md b/platform/docs/models/shared/connectionwebhookpayload.md similarity index 63% rename from platform/docs/models/operations/getconnectionresponse.md rename to platform/docs/models/shared/connectionwebhookpayload.md index f1358ac2e..178010807 100644 --- a/platform/docs/models/operations/getconnectionresponse.md +++ b/platform/docs/models/shared/connectionwebhookpayload.md @@ -1,11 +1,9 @@ -# GetConnectionResponse +# ConnectionWebhookPayload ## 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 | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | A connection represents a [company's](https://docs.codat.io/platform-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source.

A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to:

- [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection.
- [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections.
- [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections.
Any combination of accounting, banking, and commerce data connections is allowed.

Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). | {
"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"
} | +| `reference_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/createapikey.md b/platform/docs/models/shared/createapikey.md index eb6da327b..eec158de8 100644 --- a/platform/docs/models/shared/createapikey.md +++ b/platform/docs/models/shared/createapikey.md @@ -7,4 +7,4 @@ Details about the newly created API key. | Field | Type | Required | Description | Example | | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `name` | *Optional[str]* | :heavy_minus_sign: | A meaningful name assigned to the API key. | azure-invoice-finance-processor | \ No newline at end of file +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | A meaningful name assigned to the API key. | azure-invoice-finance-processor | \ No newline at end of file diff --git a/platform/docs/models/shared/dataconnectionerror.md b/platform/docs/models/shared/dataconnectionerror.md index 2c12bb648..413231fec 100644 --- a/platform/docs/models/shared/dataconnectionerror.md +++ b/platform/docs/models/shared/dataconnectionerror.md @@ -5,7 +5,9 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A brief message about the error. | | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about a error returned by Codat. | | | `errored_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 | -| `status_code` | *Optional[str]* | :heavy_minus_sign: | The HTTP status code returned by the error. | | -| `status_text` | *Optional[str]* | :heavy_minus_sign: | A non-numeric status code/text. | | \ No newline at end of file +| `resolved_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 | +| `status` | [OptionalNullable[shared.ErrorStatus]](../../models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | +| `status_code` | *Optional[str]* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | +| `status_text` | *Optional[str]* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | \ No newline at end of file diff --git a/platform/docs/models/shared/datastatus.md b/platform/docs/models/shared/datastatus.md index 07be889e4..dcc3ded88 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` | [shared.Status](../../models/shared/status.md) | :heavy_check_mark: | The current status of the dataset. | | -| `data_type` | [shared.DataTypes](../../models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | +| `data_type` | [shared.DataStatusDataTypes](../../models/shared/datastatusdatatypes.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/datastatusdatatypes.md b/platform/docs/models/shared/datastatusdatatypes.md new file mode 100644 index 000000000..30407d27d --- /dev/null +++ b/platform/docs/models/shared/datastatusdatatypes.md @@ -0,0 +1,52 @@ +# DataStatusDataTypes + +Available data types + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ACCOUNT_TRANSACTIONS` | accountTransactions | +| `BALANCE_SHEET` | balanceSheet | +| `BANK_ACCOUNTS` | bankAccounts | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CASH_FLOW_STATEMENT` | cashFlowStatement | +| `CHART_OF_ACCOUNTS` | chartOfAccounts | +| `COMPANY` | company | +| `CREDIT_NOTES` | creditNotes | +| `CUSTOMERS` | customers | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `ITEM_RECEIPTS` | itemReceipts | +| `ITEMS` | items | +| `JOURNAL_ENTRIES` | journalEntries | +| `JOURNALS` | journals | +| `PAYMENT_METHODS` | paymentMethods | +| `PAYMENTS` | payments | +| `PROFIT_AND_LOSS` | profitAndLoss | +| `PURCHASE_ORDERS` | purchaseOrders | +| `SALES_ORDERS` | salesOrders | +| `SUPPLIERS` | suppliers | +| `TAX_RATES` | taxRates | +| `TRACKING_CATEGORIES` | trackingCategories | +| `TRANSFERS` | transfers | +| `BANKING_ACCOUNT_BALANCES` | banking-accountBalances | +| `BANKING_ACCOUNTS` | banking-accounts | +| `BANKING_TRANSACTION_CATEGORIES` | banking-transactionCategories | +| `BANKING_TRANSACTIONS` | banking-transactions | +| `COMMERCE_COMPANY_INFO` | commerce-companyInfo | +| `COMMERCE_CUSTOMERS` | commerce-customers | +| `COMMERCE_DISPUTES` | commerce-disputes | +| `COMMERCE_LOCATIONS` | commerce-locations | +| `COMMERCE_ORDERS` | commerce-orders | +| `COMMERCE_PAYMENT_METHODS` | commerce-paymentMethods | +| `COMMERCE_PAYMENTS` | commerce-payments | +| `COMMERCE_PRODUCT_CATEGORIES` | commerce-productCategories | +| `COMMERCE_PRODUCTS` | commerce-products | +| `COMMERCE_TAX_COMPONENTS` | commerce-taxComponents | +| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file diff --git a/platform/docs/models/shared/datatypes.md b/platform/docs/models/shared/datatypes.md index a102001d1..d623077c9 100644 --- a/platform/docs/models/shared/datatypes.md +++ b/platform/docs/models/shared/datatypes.md @@ -1,52 +1,11 @@ # DataTypes -Available data types +## Fields -## Values - -| Name | Value | -| -------------------------------- | -------------------------------- | -| `ACCOUNT_TRANSACTIONS` | accountTransactions | -| `BALANCE_SHEET` | balanceSheet | -| `BANK_ACCOUNTS` | bankAccounts | -| `BANK_TRANSACTIONS` | bankTransactions | -| `BILL_CREDIT_NOTES` | billCreditNotes | -| `BILL_PAYMENTS` | billPayments | -| `BILLS` | bills | -| `CASH_FLOW_STATEMENT` | cashFlowStatement | -| `CHART_OF_ACCOUNTS` | chartOfAccounts | -| `COMPANY` | company | -| `CREDIT_NOTES` | creditNotes | -| `CUSTOMERS` | customers | -| `DIRECT_COSTS` | directCosts | -| `DIRECT_INCOMES` | directIncomes | -| `INVOICES` | invoices | -| `ITEM_RECEIPTS` | itemReceipts | -| `ITEMS` | items | -| `JOURNAL_ENTRIES` | journalEntries | -| `JOURNALS` | journals | -| `PAYMENT_METHODS` | paymentMethods | -| `PAYMENTS` | payments | -| `PROFIT_AND_LOSS` | profitAndLoss | -| `PURCHASE_ORDERS` | purchaseOrders | -| `SALES_ORDERS` | salesOrders | -| `SUPPLIERS` | suppliers | -| `TAX_RATES` | taxRates | -| `TRACKING_CATEGORIES` | trackingCategories | -| `TRANSFERS` | transfers | -| `BANKING_ACCOUNT_BALANCES` | banking-accountBalances | -| `BANKING_ACCOUNTS` | banking-accounts | -| `BANKING_TRANSACTION_CATEGORIES` | banking-transactionCategories | -| `BANKING_TRANSACTIONS` | banking-transactions | -| `COMMERCE_COMPANY_INFO` | commerce-companyInfo | -| `COMMERCE_CUSTOMERS` | commerce-customers | -| `COMMERCE_DISPUTES` | commerce-disputes | -| `COMMERCE_LOCATIONS` | commerce-locations | -| `COMMERCE_ORDERS` | commerce-orders | -| `COMMERCE_PAYMENT_METHODS` | commerce-paymentMethods | -| `COMMERCE_PAYMENTS` | commerce-payments | -| `COMMERCE_PRODUCT_CATEGORIES` | commerce-productCategories | -| `COMMERCE_PRODUCTS` | commerce-products | -| `COMMERCE_TAX_COMPONENTS` | commerce-taxComponents | -| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `records_modified` | *Optional[bool]* | :heavy_minus_sign: | `True` if records have been created, updated or deleted in Codat's cache. | false | +| `status` | [Optional[shared.Status]](../../models/shared/status.md) | :heavy_minus_sign: | The current status of the dataset. | | \ No newline at end of file diff --git a/platform/docs/models/operations/addcompanytogroupresponse.md b/platform/docs/models/shared/datatypewritewebhook.md similarity index 82% rename from platform/docs/models/operations/addcompanytogroupresponse.md rename to platform/docs/models/shared/datatypewritewebhook.md index 73d15a0d1..488b488c2 100644 --- a/platform/docs/models/operations/addcompanytogroupresponse.md +++ b/platform/docs/models/shared/datatypewritewebhook.md @@ -1,11 +1,11 @@ -# AddCompanyToGroupResponse +# DataTypeWriteWebhook ## 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 | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | bills.write.successful | +| `generated_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | +| `payload` | [Optional[shared.DataTypeWriteWebhookPayload]](../../models/shared/datatypewritewebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/datatypewritewebhookpayload.md b/platform/docs/models/shared/datatypewritewebhookpayload.md new file mode 100644 index 000000000..39af0c0c2 --- /dev/null +++ b/platform/docs/models/shared/datatypewritewebhookpayload.md @@ -0,0 +1,16 @@ +# DataTypeWriteWebhookPayload + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `attachment_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the uploaded attachment, null if no attachment uploaded. | | +| `completed_on_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the write request. This is also known as the push operation ID. | | +| `record` | [Optional[shared.DataTypeWriteWebhookRecord]](../../models/shared/datatypewritewebhookrecord.md) | :heavy_minus_sign: | N/A | | +| `reference_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | +| `requested_on_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.WriteStatus]](../../models/shared/writestatus.md) | :heavy_minus_sign: | The current status of the write request, which is the same as the push operation status. | | +| `type` | [Optional[shared.WriteType]](../../models/shared/writetype.md) | :heavy_minus_sign: | Type of write request. | | \ No newline at end of file diff --git a/platform/docs/models/shared/datatypewritewebhookrecord.md b/platform/docs/models/shared/datatypewritewebhookrecord.md new file mode 100644 index 000000000..1f6adc677 --- /dev/null +++ b/platform/docs/models/shared/datatypewritewebhookrecord.md @@ -0,0 +1,8 @@ +# DataTypeWriteWebhookRecord + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | The unique identifier of the data type created, updated, deleted, or had an attachment uploaded in the accounting platform. | \ No newline at end of file diff --git a/platform/docs/models/shared/errormessage.md b/platform/docs/models/shared/errormessage.md new file mode 100644 index 000000000..4b5d4654a --- /dev/null +++ b/platform/docs/models/shared/errormessage.md @@ -0,0 +1,16 @@ +# ErrorMessage + +Too many requests were made in a given amount of time. Wait a short period and then try again. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `can_be_retried` | *Optional[str]* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | +| `correlation_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | +| `detailed_error_code` | *Optional[int]* | :heavy_minus_sign: | Machine readable error code used to automate processes based on the code returned. | +| `error` | *Optional[str]* | :heavy_minus_sign: | A brief description of the error. | +| `service` | *Optional[str]* | :heavy_minus_sign: | Codat's service the returned the error. | +| `status_code` | *Optional[int]* | :heavy_minus_sign: | The HTTP status code returned by the error. | +| `validation` | [OptionalNullable[shared.ErrorValidation]](../../models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | \ No newline at end of file diff --git a/platform/docs/models/shared/errorstatus.md b/platform/docs/models/shared/errorstatus.md new file mode 100644 index 000000000..02c0ec3d9 --- /dev/null +++ b/platform/docs/models/shared/errorstatus.md @@ -0,0 +1,11 @@ +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `ACTIVE` | Active | +| `RESOLVED` | Resolved | \ No newline at end of file diff --git a/platform/docs/models/shared/errorvalidationitem.md b/platform/docs/models/shared/errorvalidationitem.md index 346bb51f1..fca2ef14a 100644 --- a/platform/docs/models/shared/errorvalidationitem.md +++ b/platform/docs/models/shared/errorvalidationitem.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `item_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *Optional[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | -| `validator_name` | *Optional[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file +| `item_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | +| `validator_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/platform/docs/models/shared/group.md b/platform/docs/models/shared/group.md deleted file mode 100644 index e7212310b..000000000 --- a/platform/docs/models/shared/group.md +++ /dev/null @@ -1,11 +0,0 @@ -# Group - -A container you can use to organize companies together according to a shared characteristic of your choice. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | -| `name` | *Optional[str]* | :heavy_minus_sign: | Descriptive name of the group. | Invoice finance team | \ No newline at end of file diff --git a/platform/docs/models/shared/groupprototype.md b/platform/docs/models/shared/groupprototype.md deleted file mode 100644 index 9e793b629..000000000 --- a/platform/docs/models/shared/groupprototype.md +++ /dev/null @@ -1,10 +0,0 @@ -# GroupPrototype - -The group template used to create a group. - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `name` | *Optional[str]* | :heavy_minus_sign: | Descriptive name of the group. | Invoice finance team | \ No newline at end of file diff --git a/platform/docs/models/shared/groupref.md b/platform/docs/models/shared/groupref.md deleted file mode 100644 index 4bb8c0497..000000000 --- a/platform/docs/models/shared/groupref.md +++ /dev/null @@ -1,8 +0,0 @@ -# GroupRef - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file diff --git a/platform/docs/models/shared/groups.md b/platform/docs/models/shared/groups.md deleted file mode 100644 index eb39b83fa..000000000 --- a/platform/docs/models/shared/groups.md +++ /dev/null @@ -1,8 +0,0 @@ -# Groups - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -| `results` | List[[shared.Group](../../models/shared/group.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 71906a50e..be36bdffd 100644 --- a/platform/docs/models/shared/newcompanysynchronizedwebhook.md +++ b/platform/docs/models/shared/newcompanysynchronizedwebhook.md @@ -11,7 +11,6 @@ Webhook request body to notify that a new company has successfully synchronized | `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. | | | `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. | | | ~~`rule_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | | diff --git a/platform/docs/models/shared/newcompanysynchronizedwebhookdata.md b/platform/docs/models/shared/newcompanysynchronizedwebhookdata.md deleted file mode 100644 index 874203b26..000000000 --- a/platform/docs/models/shared/newcompanysynchronizedwebhookdata.md +++ /dev/null @@ -1,7 +0,0 @@ -# NewCompanySynchronizedWebhookData - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/platform/docs/models/shared/pulloperation.md b/platform/docs/models/shared/pulloperation.md index 58b2d0a8d..5cfeb2fb3 100644 --- a/platform/docs/models/shared/pulloperation.md +++ b/platform/docs/models/shared/pulloperation.md @@ -18,5 +18,5 @@ Information about a queued, in progress or completed pull operation. | `requested` | *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 | | `status` | [shared.DatasetStatus](../../models/shared/datasetstatus.md) | :heavy_check_mark: | The current status of the dataset. | | | `completed` | *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 | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about a transient or persistent error. | | -| `status_description` | *Optional[str]* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | \ No newline at end of file +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | +| `status_description` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/platform/docs/models/shared/pushfieldvalidation.md b/platform/docs/models/shared/pushfieldvalidation.md index 60ce548f0..d3558cfad 100644 --- a/platform/docs/models/shared/pushfieldvalidation.md +++ b/platform/docs/models/shared/pushfieldvalidation.md @@ -7,4 +7,4 @@ | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | `details` | *str* | :heavy_check_mark: | Details on the validation issue. | | `field` | *Optional[str]* | :heavy_minus_sign: | Field name that resulted in the validation issue. | -| `ref` | *Optional[str]* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file +| `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file diff --git a/platform/docs/models/shared/pushoperation.md b/platform/docs/models/shared/pushoperation.md index bcf668d10..13591843b 100644 --- a/platform/docs/models/shared/pushoperation.md +++ b/platform/docs/models/shared/pushoperation.md @@ -14,7 +14,7 @@ | `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 | -| `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. | | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[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. | | | `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/platform/docs/models/shared/pushoperationchange.md b/platform/docs/models/shared/pushoperationchange.md index 3238ecf64..d5516b5c7 100644 --- a/platform/docs/models/shared/pushoperationchange.md +++ b/platform/docs/models/shared/pushoperationchange.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `attachment_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | +| `attachment_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | | `record_ref` | [Optional[shared.PushOperationRef]](../../models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[shared.PushChangeType]](../../models/shared/pushchangetype.md) | :heavy_minus_sign: | Type of change being applied to record in third party platform. | \ No newline at end of file diff --git a/platform/docs/models/shared/readcompletedwebhook.md b/platform/docs/models/shared/readcompletedwebhook.md new file mode 100644 index 000000000..9ab8b2069 --- /dev/null +++ b/platform/docs/models/shared/readcompletedwebhook.md @@ -0,0 +1,11 @@ +# ReadCompletedWebhook + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | | +| `generated_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | +| `payload` | [Optional[shared.ReadCompletedWebhookPayload]](../../models/shared/readcompletedwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/readcompletedwebhookpayload.md b/platform/docs/models/shared/readcompletedwebhookpayload.md new file mode 100644 index 000000000..96495972b --- /dev/null +++ b/platform/docs/models/shared/readcompletedwebhookpayload.md @@ -0,0 +1,10 @@ +# ReadCompletedWebhookPayload + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data_types` | List[[shared.DataTypes](../../models/shared/datatypes.md)] | :heavy_minus_sign: | N/A | | +| `modified_from_date` | *Optional[str]* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

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



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

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

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC | +| `reference_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/platform/docs/models/shared/validationitem.md b/platform/docs/models/shared/validationitem.md index fe913f43e..1aaf084c9 100644 --- a/platform/docs/models/shared/validationitem.md +++ b/platform/docs/models/shared/validationitem.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `item_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *Optional[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | -| `validator_name` | *Optional[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file +| `item_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | +| `validator_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/platform/docs/models/shared/webhookconsumer.md b/platform/docs/models/shared/webhookconsumer.md index 339aa760d..369c055e9 100644 --- a/platform/docs/models/shared/webhookconsumer.md +++ b/platform/docs/models/shared/webhookconsumer.md @@ -8,10 +8,11 @@ See our documentation for more details on [Codat's webhook service](https://docs ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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 +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ~~`company_id`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `company_tags` | List[*str*] | :heavy_minus_sign: | Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. | | +| `disabled` | *OptionalNullable[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 index ce5b889c2..74f80d7a9 100644 --- a/platform/docs/models/shared/webhookconsumerprototype.md +++ b/platform/docs/models/shared/webhookconsumerprototype.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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 +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ~~`company_id`~~ | *OptionalNullable[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `company_tags` | List[*str*] | :heavy_minus_sign: | Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`. | | +| `disabled` | *OptionalNullable[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/writestatus.md b/platform/docs/models/shared/writestatus.md new file mode 100644 index 000000000..2de3b9f6f --- /dev/null +++ b/platform/docs/models/shared/writestatus.md @@ -0,0 +1,13 @@ +# WriteStatus + +The current status of the write request, which is the same as the push operation status. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `PENDING` | Pending | +| `FAILED` | Failed | +| `SUCCESS` | Success | +| `TIMED_OUT` | TimedOut | \ No newline at end of file diff --git a/platform/docs/models/shared/writetype.md b/platform/docs/models/shared/writetype.md new file mode 100644 index 000000000..d11792442 --- /dev/null +++ b/platform/docs/models/shared/writetype.md @@ -0,0 +1,13 @@ +# WriteType + +Type of write request. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `CREATE` | Create | +| `UPDATE` | Update | +| `DELETE` | Delete | +| `UPLOAD_ATTACHMENT` | UploadAttachment | \ No newline at end of file diff --git a/platform/docs/models/webhooks/clientratelimitreachedresponse.md b/platform/docs/models/webhooks/clientratelimitreachedresponse.md deleted file mode 100644 index 4408f824d..000000000 --- a/platform/docs/models/webhooks/clientratelimitreachedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClientRateLimitReachedResponse - - -## 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/webhooks/clientratelimitresetresponse.md b/platform/docs/models/webhooks/clientratelimitresetresponse.md deleted file mode 100644 index 14a24dc94..000000000 --- a/platform/docs/models/webhooks/clientratelimitresetresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClientRateLimitResetResponse - - -## 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/webhooks/companydataconnectionstatuschangedresponse.md b/platform/docs/models/webhooks/companydataconnectionstatuschangedresponse.md deleted file mode 100644 index 23261d14e..000000000 --- a/platform/docs/models/webhooks/companydataconnectionstatuschangedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# CompanyDataConnectionStatusChangedResponse - - -## 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/webhooks/datasetdatachangedresponse.md b/platform/docs/models/webhooks/datasetdatachangedresponse.md deleted file mode 100644 index b26a81ea7..000000000 --- a/platform/docs/models/webhooks/datasetdatachangedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DatasetDataChangedResponse - - -## 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/webhooks/datasetstatushaschangedtoanerrorstateresponse.md b/platform/docs/models/webhooks/datasetstatushaschangedtoanerrorstateresponse.md deleted file mode 100644 index 9b0b92d4c..000000000 --- a/platform/docs/models/webhooks/datasetstatushaschangedtoanerrorstateresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DatasetStatusHasChangedToAnErrorStateResponse - - -## 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/webhooks/datasynccompletedresponse.md b/platform/docs/models/webhooks/datasynccompletedresponse.md deleted file mode 100644 index b89f50d92..000000000 --- a/platform/docs/models/webhooks/datasynccompletedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DataSyncCompletedResponse - - -## 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/webhooks/newcompanysynchronizedresponse.md b/platform/docs/models/webhooks/newcompanysynchronizedresponse.md deleted file mode 100644 index ab483b114..000000000 --- a/platform/docs/models/webhooks/newcompanysynchronizedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# NewCompanySynchronizedResponse - - -## 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/webhooks/pushoperationhastimedoutresponse.md b/platform/docs/models/webhooks/pushoperationhastimedoutresponse.md deleted file mode 100644 index fc76a4e2a..000000000 --- a/platform/docs/models/webhooks/pushoperationhastimedoutresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PushOperationHasTimedOutResponse - - -## 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/webhooks/pushoperationstatushaschangedresponse.md b/platform/docs/models/webhooks/pushoperationstatushaschangedresponse.md deleted file mode 100644 index 2e7c90e9d..000000000 --- a/platform/docs/models/webhooks/pushoperationstatushaschangedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PushOperationStatusHasChangedResponse - - -## 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/sdks/codatplatform/README.md b/platform/docs/sdks/codatplatform/README.md index 76b134a7b..3c1d88259 100644 --- a/platform/docs/sdks/codatplatform/README.md +++ b/platform/docs/sdks/codatplatform/README.md @@ -1,6 +1,5 @@ # CodatPlatform SDK - ## Overview An API for the common components of all of Codat's products. @@ -18,7 +17,6 @@ These end points cover creating and managing your companies, data connections, a | Companies | Create and manage your SMB users' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | -| Groups | Define and manage sets of companies based on a chosen characteristic. | | Webhooks | Create and manage webhooks that listen to Codat's events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | @@ -29,4 +27,3 @@ These end points cover creating and managing your companies, data connections, a ### Available Operations - diff --git a/platform/docs/sdks/companies/README.md b/platform/docs/sdks/companies/README.md index ac621469b..93273f68a 100644 --- a/platform/docs/sdks/companies/README.md +++ b/platform/docs/sdks/companies/README.md @@ -7,12 +7,55 @@ Create and manage your SMB users' companies. ### Available Operations +* [add_product](#add_product) - Add product * [create](#create) - Create company * [delete](#delete) - Delete a company * [get](#get) - Get company +* [get_access_token](#get_access_token) - Get company access token * [list](#list) - List companies +* [remove_product](#remove_product) - Remove product * [update](#update) - Update company +## add_product + +Use the *Add product* endpoint to enable a product for the company specified by `companyId`. + +> Note: This feature is currently in alpha and available only to participants in the development program. + +### Example Usage + +```python +from codat_platform import CodatPlatform +from codat_platform.models import shared + +with CodatPlatform( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + s.companies.add_product(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "product_identifier": "lending", + }) + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `request` | [operations.AddProductRequest](../../models/operations/addproductrequest.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. | + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## create Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. @@ -25,25 +68,21 @@ If forbidden characters (see `name` pattern) are present in the request, a compa ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + }) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) - -if res.company is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -54,16 +93,16 @@ if res.company is not None: | `request` | [shared.CompanyRequestBody](../../models/shared/companyrequestbody.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.CreateCompanyResponse](../../models/operations/createcompanyresponse.md)** +**[shared.Company](../../models/shared/company.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -76,24 +115,19 @@ Each company can have multiple [connections](https://docs.codat.io/platform-api# ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.DeleteCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.companies.delete(req) +) as s: + s.companies.delete(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -if res is not None: - # handle response - pass + # Use the SDK ... ``` @@ -104,16 +138,12 @@ if res is not None: | `request` | [operations.DeleteCompanyRequest](../../models/operations/deletecompanyrequest.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.DeleteCompanyResponse](../../models/operations/deletecompanyresponse.md)** ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -126,24 +156,21 @@ Each company can have multiple [connections](https://docs.codat.io/platform-api# ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.companies.get(req) +) as s: + res = s.companies.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -if res.company is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -154,20 +181,64 @@ if res.company is not None: | `request` | [operations.GetCompanyRequest](../../models/operations/getcompanyrequest.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 + +**[shared.Company](../../models/shared/company.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_access_token + +Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + + +### Example Usage + +```python +from codat_platform import CodatPlatform +from codat_platform.models import shared + +with CodatPlatform( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.companies.get_access_token(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetCompanyAccessTokenRequest](../../models/operations/getcompanyaccesstokenrequest.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.GetCompanyResponse](../../models/operations/getcompanyresponse.md)** +**[shared.CompanyAccessToken](../../models/shared/companyaccesstoken.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list -The *List companies* endpoint returns a list of [companies] associated to your instances. +The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. 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. @@ -175,26 +246,24 @@ Each company can have multiple [connections](https://docs.codat.io/platform-api# ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListCompaniesRequest( - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.companies.list(req) - -if res.companies is not None: - # handle response - pass +) as s: + res = s.companies.list(request={ + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -205,21 +274,60 @@ if res.companies is not None: | `request` | [operations.ListCompaniesRequest](../../models/operations/listcompaniesrequest.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.ListCompaniesResponse](../../models/operations/listcompaniesresponse.md)** +**[shared.Companies](../../models/shared/companies.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## remove_product + +Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. + +> Note: This feature is currently in alpha and available only to participants in the development program. + +### Example Usage + +```python +from codat_platform import CodatPlatform +from codat_platform.models import shared + +with CodatPlatform( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + s.companies.remove_product(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "product_identifier": "expenses", + }) + + # Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [operations.RemoveProductRequest](../../models/operations/removeproductrequest.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. | + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update Use the *Update company* endpoint to update both the name and description of the company. -If you use [groups](https://docs.codat.io/platform-api#/schemas/Group) to manage a set of companies, use the [Add company](https://docs.codat.io/platform-api#/operations/add-company-to-group) or [Remove company](https://docs.codat.io/platform-api#/operations/remove-company-from-group) endpoints to add or remove a company from a group. 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. @@ -227,24 +335,24 @@ Each company can have multiple [connections](https://docs.codat.io/platform-api# ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UpdateCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.companies.update(req) - -if res.company is not None: - # handle response - pass +) as s: + res = s.companies.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_request_body": { + "name": "New Name", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -255,13 +363,13 @@ if res.company is not None: | `request` | [operations.UpdateCompanyRequest](../../models/operations/updatecompanyrequest.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.UpdateCompanyResponse](../../models/operations/updatecompanyresponse.md)** +**[shared.Company](../../models/shared/company.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/connectionmanagement/README.md b/platform/docs/sdks/connectionmanagement/README.md index 0cca6b5bd..8817626be 100644 --- a/platform/docs/sdks/connectionmanagement/README.md +++ b/platform/docs/sdks/connectionmanagement/README.md @@ -3,7 +3,7 @@ ## Overview -Configure connection management UI and retrieve access tokens for authentication. +Configure UI and retrieve access tokens for authentication used by **Connections SDK**. ### Available Operations @@ -11,31 +11,28 @@ Configure connection management UI and retrieve access tokens for authentication ## get_access_token -Use the *Get access token* endpoint to retrieve a new access token for use by the [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management). +Use the *Get access token* endpoint to retrieve a new access token for use with the [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management). The token is only valid for one hour and applies to a single company. -The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. +The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.connection_management.get_access_token(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -req = operations.GetConnectionManagementAccessTokenRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.connection_management.get_access_token(req) - -if res.connection_management_access_token is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -46,13 +43,13 @@ if res.connection_management_access_token is not None: | `request` | [operations.GetConnectionManagementAccessTokenRequest](../../models/operations/getconnectionmanagementaccesstokenrequest.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.GetConnectionManagementAccessTokenResponse](../../models/operations/getconnectionmanagementaccesstokenresponse.md)** +**[shared.ConnectionManagementAccessToken](../../models/shared/connectionmanagementaccesstoken.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/connections/README.md b/platform/docs/sdks/connections/README.md index 5994bd013..bc201a744 100644 --- a/platform/docs/sdks/connections/README.md +++ b/platform/docs/sdks/connections/README.md @@ -23,24 +23,24 @@ Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list- ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.CreateConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.connections.create(req) - -if res.connection is not None: - # handle response - pass +) as s: + res = s.connections.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "request_body": { + "platform_key": "gbol", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -51,16 +51,16 @@ if res.connection is not None: | `request` | [operations.CreateConnectionRequest](../../models/operations/createconnectionrequest.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.CreateConnectionResponse](../../models/operations/createconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -70,25 +70,20 @@ This operation is not reversible. The end user would need to reauthorize a new d ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.DeleteConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.connections.delete(req) +) as s: + s.connections.delete(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -if res is not None: - # handle response - pass + # Use the SDK ... ``` @@ -99,16 +94,12 @@ if res is not None: | `request` | [operations.DeleteConnectionRequest](../../models/operations/deleteconnectionrequest.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.DeleteConnectionResponse](../../models/operations/deleteconnectionresponse.md)** ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -117,25 +108,22 @@ if res is not None: ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) +) as s: + res = s.connections.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -res = s.connections.get(req) - -if res.connection is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -146,16 +134,16 @@ if res.connection is not None: | `request` | [operations.GetConnectionRequest](../../models/operations/getconnectionrequest.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.GetConnectionResponse](../../models/operations/getconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -164,27 +152,25 @@ if res.connection is not None: ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListConnectionsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.connections.list(req) - -if res.connections is not None: - # handle response - pass +) as s: + res = s.connections.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -195,16 +181,16 @@ if res.connections is not None: | `request` | [operations.ListConnectionsRequest](../../models/operations/listconnectionsrequest.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.ListConnectionsResponse](../../models/operations/listconnectionsresponse.md)** +**[shared.Connections](../../models/shared/connections.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## unlink @@ -213,25 +199,25 @@ if res.connections is not None: ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UnlinkConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.connections.unlink(req) - -if res.connection is not None: - # handle response - pass +) as s: + res = s.connections.unlink(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "update_connection_status": { + "status": shared.DataConnectionStatus.UNLINKED, + }, + }) + + if res is not None: + # handle response + pass ``` @@ -242,16 +228,16 @@ if res.connection is not None: | `request` | [operations.UnlinkConnectionRequest](../../models/operations/unlinkconnectionrequest.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.UnlinkConnectionResponse](../../models/operations/unlinkconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update_authorization @@ -260,25 +246,22 @@ Update data connection's authorization. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UpdateConnectionAuthorizationRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) +) as s: + res = s.connections.update_authorization(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -res = s.connections.update_authorization(req) - -if res.connection is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -289,13 +272,13 @@ if res.connection is not None: | `request` | [operations.UpdateConnectionAuthorizationRequest](../../models/operations/updateconnectionauthorizationrequest.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.UpdateConnectionAuthorizationResponse](../../models/operations/updateconnectionauthorizationresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/corssettings/README.md b/platform/docs/sdks/corssettings/README.md index 438a2f4a1..a376a2f2f 100644 --- a/platform/docs/sdks/corssettings/README.md +++ b/platform/docs/sdks/corssettings/README.md @@ -1,6 +1,8 @@ # CorsSettings (*connection_management.cors_settings*) +## Overview + ### Available Operations * [get](#get) - Get CORS settings @@ -10,28 +12,26 @@ The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. -Enabling CORS with Codat is required by our embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. +Enabling CORS with Codat is required by our embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. -The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. +The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - - -res = s.connection_management.cors_settings.get() +) as s: + res = s.connection_management.cors_settings.get() -if res.connection_management_allowed_origins is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -41,48 +41,45 @@ if res.connection_management_allowed_origins is not None: | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetConnectionManagementCorsSettingsResponse](../../models/operations/getconnectionmanagementcorssettingsresponse.md)** +**[shared.ConnectionManagementAllowedOrigins](../../models/shared/connectionmanagementallowedorigins.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## set The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). -Enabling CORS with Codat is required by our embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. +Enabling CORS with Codat is required by our embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. -The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. +The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.connection_management.cors_settings.set(request={ + "allowed_origins": [ + "https://www.bank-of-dave.com", + ], + }) -req = shared.ConnectionManagementAllowedOrigins( - allowed_origins=[ - 'https://www.bank-of-dave.com', - ], -) - -res = s.connection_management.cors_settings.set(req) - -if res.connection_management_allowed_origins is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -93,13 +90,13 @@ if res.connection_management_allowed_origins is not None: | `request` | [shared.ConnectionManagementAllowedOrigins](../../models/shared/connectionmanagementallowedorigins.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.SetConnectionManagementCorsSettingsResponse](../../models/operations/setconnectionmanagementcorssettingsresponse.md)** +**[shared.ConnectionManagementAllowedOrigins](../../models/shared/connectionmanagementallowedorigins.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/customdatatype/README.md b/platform/docs/sdks/customdatatype/README.md index 64a2fb27c..6d8f4def1 100644 --- a/platform/docs/sdks/customdatatype/README.md +++ b/platform/docs/sdks/customdatatype/README.md @@ -29,43 +29,39 @@ A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an addi ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ConfigureCustomDataTypeRequest( - custom_data_identifier='DynamicsPurchaseOrders', - platform_key='gbol', - custom_data_type_configuration=shared.CustomDataTypeConfiguration( - data_source='api/purchaseOrders?$filter=currencyCode eq \'NOK\'', - key_by=[ - '$[*].id', - ], - required_data={ - 'currencyCode': '$[*].currencyCode', - 'id': '$[*].id', - 'number': '$[*].number', - 'orderDate': '$[*].orderDate', - 'totalAmountExcludingTax': '$[*].totalAmountExcludingTax', - 'totalTaxAmount': '$[*].totalTaxAmount', - 'vendorName': '$[*].number', +) as s: + res = s.custom_data_type.configure(request={ + "custom_data_identifier": "DynamicsPurchaseOrders", + "platform_key": "gbol", + "custom_data_type_configuration": { + "data_source": "api/purchaseOrders", + "key_by": [ + "$[*].id", + ], + "required_data": { + "currency": "$[*].currencyCode", + "number": "$[*].number", + "date": "$[*].orderDate", + "totalexvat": "$[*].totalAmountExcludingTax", + "totaltax": "$[*].totalTaxAmount", + "vendor": "$[*].number", + }, + "source_modified_date": [ + "$[*].lastModifiedDateTime", + ], }, - source_modified_date=[ - '$[*].lastModifiedDateTime', - ], - ), -) - -res = s.custom_data_type.configure(req) + }) -if res.custom_data_type_configuration is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -76,16 +72,16 @@ if res.custom_data_type_configuration is not None: | `request` | [operations.ConfigureCustomDataTypeRequest](../../models/operations/configurecustomdatatyperequest.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.ConfigureCustomDataTypeResponse](../../models/operations/configurecustomdatatyperesponse.md)** +**[shared.CustomDataTypeConfiguration](../../models/shared/customdatatypeconfiguration.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_configuration @@ -96,25 +92,22 @@ A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an addi ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetCustomDataTypeConfigurationRequest( - custom_data_identifier='DynamicsPurchaseOrders', - platform_key='gbol', -) +) as s: + res = s.custom_data_type.get_configuration(request={ + "custom_data_identifier": "DynamicsPurchaseOrders", + "platform_key": "gbol", + }) -res = s.custom_data_type.get_configuration(req) - -if res.custom_data_type_records is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -125,16 +118,16 @@ if res.custom_data_type_records is not None: | `request` | [operations.GetCustomDataTypeConfigurationRequest](../../models/operations/getcustomdatatypeconfigurationrequest.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.GetCustomDataTypeConfigurationResponse](../../models/operations/getcustomdatatypeconfigurationresponse.md)** +**[shared.CustomDataTypeRecords](../../models/shared/customdatatyperecords.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -145,28 +138,25 @@ A [custom data type](https://docs.codat.io/using-the-api/custom-data) is an addi ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListCustomDataTypeRecordsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - custom_data_identifier='DynamicsPurchaseOrders', - page=1, - page_size=100, -) - -res = s.custom_data_type.list(req) - -if res.custom_data_type_records is not None: - # handle response - pass +) as s: + res = s.custom_data_type.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "custom_data_identifier": "DynamicsPurchaseOrders", + "page": 1, + "page_size": 100, + }) + + if res is not None: + # handle response + pass ``` @@ -177,16 +167,16 @@ if res.custom_data_type_records is not None: | `request` | [operations.ListCustomDataTypeRecordsRequest](../../models/operations/listcustomdatatyperecordsrequest.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.ListCustomDataTypeRecordsResponse](../../models/operations/listcustomdatatyperecordsresponse.md)** +**[shared.CustomDataTypeRecords](../../models/shared/customdatatyperecords.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,429,451,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 451, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## refresh @@ -195,26 +185,23 @@ The *Refresh custom data type* endpoint refreshes the specified custom data type ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.custom_data_type.refresh(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "custom_data_identifier": "DynamicsPurchaseOrders", + }) -req = operations.RefreshCustomDataTypeRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - custom_data_identifier='DynamicsPurchaseOrders', -) - -res = s.custom_data_type.refresh(req) - -if res.pull_operation is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -225,13 +212,13 @@ if res.pull_operation is not None: | `request` | [operations.RefreshCustomDataTypeRequest](../../models/operations/refreshcustomdatatyperequest.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.RefreshCustomDataTypeResponse](../../models/operations/refreshcustomdatatyperesponse.md)** +**[shared.PullOperation](../../models/shared/pulloperation.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,451,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 451, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/groups/README.md b/platform/docs/sdks/groups/README.md deleted file mode 100644 index aa0a8faaa..000000000 --- a/platform/docs/sdks/groups/README.md +++ /dev/null @@ -1,207 +0,0 @@ -# Groups -(*groups*) - -## Overview - -Define and manage sets of companies based on a chosen characteristic. - -### Available Operations - -* [add_company](#add_company) - Add company -* [create](#create) - Create group -* [list](#list) - List groups -* [remove_company](#remove_company) - Remove company - -## add_company - -Use the *Add company* endpoint to assign a company to a group. A company can belong to multiple groups, but can only be added to one group at a time. - -[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. - -### 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.AddCompanyToGroupRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.groups.add_company(req) - -if res.company is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `request` | [operations.AddCompanyToGroupRequest](../../models/operations/addcompanytogrouprequest.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.AddCompanyToGroupResponse](../../models/operations/addcompanytogroupresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | - -## create - -Use the *Create group* endpoint to generate a new group that you can assign your companies to. - -[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. - -### Tips and traps - -* The maximum length for the group name is 50 characters. -* It's possible to create up to 20 groups per client. - -### 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.GroupPrototype( - name='Invoice finance team', -) - -res = s.groups.create(req) - -if res.group is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `request` | [shared.GroupPrototype](../../models/shared/groupprototype.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.CreateGroupResponse](../../models/operations/creategroupresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,409,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | - -## list - -Use the *List group* endpoint to return a list of all groups that currently exist for your client. - -[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. - -### 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.groups.list() - -if res.groups 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.ListGroupsResponse](../../models/operations/listgroupsresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | - -## remove_company - -Use the *Remove company* endpoint to remove a company from a group. - -[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. - -### 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.RemoveCompanyFromGroupRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - group_id='60d2fa12-8a04-11ee-b9d1-0242ac120002', -) - -res = s.groups.remove_company(req) - -if res is not None: - # handle response - pass - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `request` | [operations.RemoveCompanyFromGroupRequest](../../models/operations/removecompanyfromgrouprequest.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.RemoveCompanyFromGroupResponse](../../models/operations/removecompanyfromgroupresponse.md)** -### Errors - -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | diff --git a/platform/docs/sdks/integrations/README.md b/platform/docs/sdks/integrations/README.md index 3f82e12ce..fb5f33a7c 100644 --- a/platform/docs/sdks/integrations/README.md +++ b/platform/docs/sdks/integrations/README.md @@ -18,24 +18,21 @@ Get single integration, by platformKey ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.integrations.get(request={ + "platform_key": "gbol", + }) -req = operations.GetIntegrationRequest( - platform_key='gbol', -) - -res = s.integrations.get(req) - -if res.integration is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -46,16 +43,16 @@ if res.integration is not None: | `request` | [operations.GetIntegrationRequest](../../models/operations/getintegrationrequest.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.GetIntegrationResponse](../../models/operations/getintegrationresponse.md)** +**[shared.Integration](../../models/shared/integration.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_branding @@ -64,24 +61,21 @@ Get branding for platform. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.integrations.get_branding(request={ + "platform_key": "gbol", + }) -req = operations.GetIntegrationsBrandingRequest( - platform_key='gbol', -) - -res = s.integrations.get_branding(req) - -if res.branding is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -92,16 +86,16 @@ if res.branding is not None: | `request` | [operations.GetIntegrationsBrandingRequest](../../models/operations/getintegrationsbrandingrequest.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.GetIntegrationsBrandingResponse](../../models/operations/getintegrationsbrandingresponse.md)** +**[shared.Branding](../../models/shared/branding.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -110,26 +104,24 @@ List your available integrations ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListIntegrationsRequest( - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.integrations.list(req) - -if res.integrations is not None: - # handle response - pass +) as s: + res = s.integrations.list(request={ + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -140,13 +132,13 @@ if res.integrations is not None: | `request` | [operations.ListIntegrationsRequest](../../models/operations/listintegrationsrequest.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.ListIntegrationsResponse](../../models/operations/listintegrationsresponse.md)** +**[shared.Integrations](../../models/shared/integrations.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/pushdata/README.md b/platform/docs/sdks/pushdata/README.md index 181bc0cf0..dd9f8f458 100644 --- a/platform/docs/sdks/pushdata/README.md +++ b/platform/docs/sdks/pushdata/README.md @@ -15,7 +15,7 @@ Initiate and monitor Create, Update, and Delete operations. This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. -Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting packages. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. +Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented "options" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. @@ -27,26 +27,23 @@ Codat tries not to limit users to pushing to a very limited number of standard c ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.push_data.get_model_options(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "data_type": shared.SchemaDataType.INVOICES, + }) -req = operations.GetCreateUpdateModelOptionsByDataTypeRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - data_type=shared.SchemaDataType.INVOICES, -) - -res = s.push_data.get_model_options(req) - -if res.push_option is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -57,43 +54,42 @@ if res.push_option is not None: | `request` | [operations.GetCreateUpdateModelOptionsByDataTypeRequest](../../models/operations/getcreateupdatemodeloptionsbydatatyperequest.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.GetCreateUpdateModelOptionsByDataTypeResponse](../../models/operations/getcreateupdatemodeloptionsbydatatyperesponse.md)** +**[shared.PushOption](../../models/shared/pushoption.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_operation -Retrieve push operation. +The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. + +Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetPushOperationRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - push_operation_key='59acd79e-29d3-4138-91d3-91d4641bf7ed', -) +) as s: + res = s.push_data.get_operation(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "push_operation_key": "5ad92d18-1314-44b7-bd71-2a11cd0470da", + }) -res = s.push_data.get_operation(req) - -if res.push_operation is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -104,45 +100,45 @@ if res.push_operation is not None: | `request` | [operations.GetPushOperationRequest](../../models/operations/getpushoperationrequest.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.GetPushOperationResponse](../../models/operations/getpushoperationresponse.md)** +**[shared.PushOperation](../../models/shared/pushoperation.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list_operations -List push operation records. +The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. + +Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetCompanyPushHistoryRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.push_data.list_operations(req) - -if res.push_operations is not None: - # handle response - pass +) as s: + res = s.push_data.list_operations(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -153,13 +149,13 @@ if res.push_operations is not None: | `request` | [operations.GetCompanyPushHistoryRequest](../../models/operations/getcompanypushhistoryrequest.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.GetCompanyPushHistoryResponse](../../models/operations/getcompanypushhistoryresponse.md)** +**[shared.PushOperations](../../models/shared/pushoperations.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/refreshdata/README.md b/platform/docs/sdks/refreshdata/README.md index d3ece31ba..fb0d409d9 100644 --- a/platform/docs/sdks/refreshdata/README.md +++ b/platform/docs/sdks/refreshdata/README.md @@ -24,24 +24,19 @@ This is an asynchronous operation, and will bring updated data into Codat from t ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + s.refresh_data.all(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -req = operations.RefreshCompanyDataRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.refresh_data.all(req) - -if res is not None: - # handle response - pass + # Use the SDK ... ``` @@ -52,16 +47,12 @@ if res is not None: | `request` | [operations.RefreshCompanyDataRequest](../../models/operations/refreshcompanydatarequest.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.RefreshCompanyDataResponse](../../models/operations/refreshcompanydataresponse.md)** ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## by_data_type @@ -72,25 +63,22 @@ This is an asynchronous operation, and will bring updated data into Codat from t ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.RefreshDataTypeRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - data_type=shared.SchemaDataType.INVOICES, -) +) as s: + res = s.refresh_data.by_data_type(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "data_type": shared.SchemaDataType.INVOICES, + }) -res = s.refresh_data.by_data_type(req) - -if res.pull_operation is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -101,16 +89,16 @@ if res.pull_operation is not None: | `request` | [operations.RefreshDataTypeRequest](../../models/operations/refreshdatatyperequest.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.RefreshDataTypeResponse](../../models/operations/refreshdatatyperesponse.md)** +**[shared.PullOperation](../../models/shared/pulloperation.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -119,24 +107,21 @@ Get the state of each data type for a company ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetCompanyDataStatusRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.refresh_data.get(req) +) as s: + res = s.refresh_data.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -if res.data_statuses is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -147,16 +132,16 @@ if res.data_statuses is not None: | `request` | [operations.GetCompanyDataStatusRequest](../../models/operations/getcompanydatastatusrequest.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.GetCompanyDataStatusResponse](../../models/operations/getcompanydatastatusresponse.md)** +**[shared.DataStatuses](../../models/shared/datastatuses.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_pull_operation @@ -165,25 +150,22 @@ Retrieve information about a single dataset or pull operation. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetPullOperationRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - dataset_id='7911a54a-c808-4f4b-b87e-b195f52b4da5', -) +) as s: + res = s.refresh_data.get_pull_operation(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "dataset_id": "71a4c0fb-8e15-45bd-958d-330b4e6e9f07", + }) -res = s.refresh_data.get_pull_operation(req) - -if res.pull_operation is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -194,16 +176,16 @@ if res.pull_operation is not None: | `request` | [operations.GetPullOperationRequest](../../models/operations/getpulloperationrequest.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.GetPullOperationResponse](../../models/operations/getpulloperationresponse.md)** +**[shared.PullOperation](../../models/shared/pulloperation.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list_pull_operations @@ -212,27 +194,25 @@ Gets the pull operation history (datasets) for a given company. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListPullOperationsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.refresh_data.list_pull_operations(req) - -if res.pull_operations is not None: - # handle response - pass +) as s: + res = s.refresh_data.list_pull_operations(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -243,13 +223,13 @@ if res.pull_operations is not None: | `request` | [operations.ListPullOperationsRequest](../../models/operations/listpulloperationsrequest.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.ListPullOperationsResponse](../../models/operations/listpulloperationsresponse.md)** +**[shared.PullOperations](../../models/shared/pulloperations.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/settings/README.md b/platform/docs/sdks/settings/README.md index c97ec83ea..bcd7bf70f 100644 --- a/platform/docs/sdks/settings/README.md +++ b/platform/docs/sdks/settings/README.md @@ -32,24 +32,21 @@ You can [read more](https://docs.codat.io/using-the-api/authentication) about au ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.settings.create_api_key(request={ + "name": "azure-invoice-finance-processor", + }) -req = shared.CreateAPIKey( - name='azure-invoice-finance-processor', -) - -res = s.settings.create_api_key(req) - -if res.api_key_details is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -60,16 +57,16 @@ if res.api_key_details is not None: | `request` | [shared.CreateAPIKey](../../models/shared/createapikey.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.CreateAPIKeyResponse](../../models/operations/createapikeyresponse.md)** +**[shared.APIKeyDetails](../../models/shared/apikeydetails.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,409,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete_api_key @@ -87,24 +84,21 @@ You can [read more](https://docs.codat.io/using-the-api/authentication) about au ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.settings.delete_api_key(request={ + "api_key_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -req = operations.DeleteAPIKeyRequest( - api_key_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.settings.delete_api_key(req) - -if res.error_message is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -115,16 +109,16 @@ if res.error_message is not None: | `request` | [operations.DeleteAPIKeyRequest](../../models/operations/deleteapikeyrequest.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.DeleteAPIKeyResponse](../../models/operations/deleteapikeyresponse.md)** +**[shared.ErrorMessage](../../models/shared/errormessage.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_profile @@ -133,21 +127,19 @@ Fetch your Codat profile. ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - - -res = s.settings.get_profile() +) as s: + res = s.settings.get_profile() -if res.profile is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -157,16 +149,16 @@ if res.profile is not None: | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetProfileResponse](../../models/operations/getprofileresponse.md)** +**[shared.Profile](../../models/shared/profile.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_sync_settings @@ -175,21 +167,19 @@ Retrieve the [sync settings](https://docs.codat.io/knowledge-base/advanced-sync- ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - +) as s: + res = s.settings.get_sync_settings() -res = s.settings.get_sync_settings() - -if res.sync_settings is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -199,16 +189,16 @@ if res.sync_settings is not None: | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.GetProfileSyncSettingsResponse](../../models/operations/getprofilesyncsettingsresponse.md)** +**[shared.SyncSettings](../../models/shared/syncsettings.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list_api_keys @@ -221,21 +211,19 @@ You can [read more](https://docs.codat.io/using-the-api/authentication) about au ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.settings.list_api_keys() - -res = s.settings.list_api_keys() - -if res.api_keys is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -245,16 +233,16 @@ if res.api_keys is not None: | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | - ### Response -**[operations.ListAPIKeysResponse](../../models/operations/listapikeysresponse.md)** +**[shared.APIKeys](../../models/shared/apikeys.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update_profile @@ -263,34 +251,29 @@ Update your Codat profile ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.Profile( - name='Bob\'s Burgers', - redirect_url='https://bobs-burgers.{countrySuffix}/{companyId}', - alert_auth_header='Bearer tXEiHiRK7XCtI8TNHbpGs1LI1pumdb4Cl1QIo7B2', - api_key='sartANTjHAkLdbyDfaynoTQb7pkmj6hXHmnQKMrB', - confirm_company_name=True, - icon_url='https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico', - logo_url='https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png', - white_list_urls=[ - 'https://bobs-burgers.com', - 'https://bobs-burgers.co.uk', - ], -) - -res = s.settings.update_profile(req) - -if res.profile is not None: - # handle response - pass +) as s: + res = s.settings.update_profile(request={ + "name": "Bob's Burgers", + "redirect_url": "https://bobs-burgers.{countrySuffix}/{companyId}", + "confirm_company_name": True, + "icon_url": "https://client-images.codat.io/icon/042399f5-d104-4f38-9ce8-cac3524f4e88_3f5623af-d992-4c22-bc08-e58c520a8526.ico", + "logo_url": "https://client-images.codat.io/logo/042399f5-d104-4f38-9ce8-cac3524f4e88_5806cb1f-7342-4c0e-a0a8-99bfbc47b0ff.png", + "white_list_urls": [ + "https://bobs-burgers.com", + "https://bobs-burgers.co.uk", + ], + }) + + if res is not None: + # handle response + pass ``` @@ -301,16 +284,16 @@ if res.profile is not None: | `request` | [shared.Profile](../../models/shared/profile.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.UpdateProfileResponse](../../models/operations/updateprofileresponse.md)** +**[shared.Profile](../../models/shared/profile.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update_sync_settings @@ -319,36 +302,31 @@ Update sync settings for all data types. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.UpdateProfileSyncSettingsRequestBody( - client_id='ce429104-79f0-4085-a720-e2d40fcc800f', - settings=[ - shared.SyncSetting( - data_type=shared.DataType.INVOICES, - fetch_on_first_link=True, - sync_order=0, - sync_schedule=24, - is_locked=True, - months_to_sync=24, - sync_from_utc='2020-01-01T12:00:00.000Z', - sync_from_window=24, - ), - ], -) - -res = s.settings.update_sync_settings(req) - -if res is not None: - # handle response - pass +) as s: + s.settings.update_sync_settings(request={ + "client_id": "c4907f05-7024-4fc0-bf55-4785be5c9671", + "settings": [ + { + "data_type": shared.DataType.INVOICES, + "fetch_on_first_link": True, + "sync_order": 0, + "sync_schedule": 24, + "is_locked": True, + "months_to_sync": 24, + "sync_from_utc": "2020-01-01T12:00:00.000Z", + "sync_from_window": 24, + }, + ], + }) + + # Use the SDK ... ``` @@ -359,13 +337,9 @@ if res is not None: | `request` | [operations.UpdateProfileSyncSettingsRequestBody](../../models/operations/updateprofilesyncsettingsrequestbody.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.UpdateProfileSyncSettingsResponse](../../models/operations/updateprofilesyncsettingsresponse.md)** ### Errors -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/supplementaldata/README.md b/platform/docs/sdks/supplementaldata/README.md index fe767b1f1..0ca17c191 100644 --- a/platform/docs/sdks/supplementaldata/README.md +++ b/platform/docs/sdks/supplementaldata/README.md @@ -14,7 +14,7 @@ Configure and pull additional data you can include in Codat's standard data type The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. -[Supplemental data](https://docs.codat.io/using-the-api/additional-data) is additional data you can include in Codat's standard data types. +[Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. **Integration-specific behaviour** See the *examples* for integration-specific frequently requested properties. @@ -22,38 +22,21 @@ See the *examples* for integration-specific frequently requested properties. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import operations, shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ConfigureSupplementalDataRequest( - data_type=operations.DataType.INVOICES, - platform_key='gbol', - supplemental_data_configuration=shared.SupplementalDataConfiguration( - supplemental_data_config={ - 'orders-supplemental-data': shared.SupplementalDataSourceConfiguration( - data_source='/orders', - pull_data={ - 'orderNumber': 'order_num', - }, - push_data={ - 'orderNumber': 'order_num', - }, - ), - }, - ), -) - -res = s.supplemental_data.configure(req) +) as s: + s.supplemental_data.configure(request={ + "data_type": operations.DataType.INVOICES, + "platform_key": "gbol", + "supplemental_data_configuration": {}, + }) -if res is not None: - # handle response - pass + # Use the SDK ... ``` @@ -64,45 +47,38 @@ if res is not None: | `request` | [operations.ConfigureSupplementalDataRequest](../../models/operations/configuresupplementaldatarequest.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.ConfigureSupplementalDataResponse](../../models/operations/configuresupplementaldataresponse.md)** ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_configuration The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. -[Supplemental data](https://docs.codat.io/using-the-api/additional-data) is additional data you can include in Codat's standard data types. +[Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import operations, shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.supplemental_data.get_configuration(request={ + "data_type": operations.PathParamDataType.INVOICES, + "platform_key": "gbol", + }) -req = operations.GetSupplementalDataConfigurationRequest( - data_type=operations.PathParamDataType.INVOICES, - platform_key='gbol', -) - -res = s.supplemental_data.get_configuration(req) - -if res.supplemental_data_configuration is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -113,13 +89,13 @@ if res.supplemental_data_configuration is not None: | `request` | [operations.GetSupplementalDataConfigurationRequest](../../models/operations/getsupplementaldataconfigurationrequest.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.GetSupplementalDataConfigurationResponse](../../models/operations/getsupplementaldataconfigurationresponse.md)** +**[shared.SupplementalDataConfiguration](../../models/shared/supplementaldataconfiguration.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/docs/sdks/webhooks/README.md b/platform/docs/sdks/webhooks/README.md index afe34fd2e..609bd190c 100644 --- a/platform/docs/sdks/webhooks/README.md +++ b/platform/docs/sdks/webhooks/README.md @@ -7,47 +7,46 @@ Create and manage webhooks that listen to Codat's events. ### Available Operations -* [~~create~~](#create) - Create webhook :warning: **Deprecated** +* [~~create~~](#create) - Create webhook (legacy) :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** +* [~~get~~](#get) - Get webhook (legacy) :warning: **Deprecated** +* [~~list~~](#list) - List webhooks (legacy) :warning: **Deprecated** * [list_consumers](#list_consumers) - List webhook consumers ## ~~create~~ -Create a new webhook configuration +Use the *Create webhooks (legacy)* endpoint to create a rule-based webhook for your client. + +**Note:** This endpoint has been deprecated. Please use the [*Create webhook consumer*](https://docs.codat.io/platform-api#/operations/create-webhook-consumer) endpoint to create a webhook moving forward. > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.CreateRule( - notifiers=shared.WebhookNotifier( - emails=[ - 'info@client.com', - ], - webhook='https://webhook.client.com', - ), - type='DataConnectionStatusChanged', - company_id='39b73b17-cc2e-429e-915d-71654e9dcd1e', -) - -res = s.webhooks.create(req) - -if res.webhook is not None: - # handle response - pass +) as s: + res = s.webhooks.create(request={ + "notifiers": { + "emails": [ + "info@client.com", + ], + "webhook": "https://webhook.client.com", + }, + "type": "DataConnectionStatusChanged", + "company_id": "39b73b17-cc2e-429e-915d-71654e9dcd1e", + }) + + if res is not None: + # handle response + pass ``` @@ -58,16 +57,16 @@ if res.webhook is not None: | `request` | [shared.CreateRule](../../models/shared/createrule.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.CreateRuleResponse](../../models/operations/createruleresponse.md)** +**[shared.Webhook](../../models/shared/webhook.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## create_consumer @@ -75,27 +74,31 @@ if res.webhook is not None: [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). +### Tips and traps +- The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. + ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = shared.WebhookConsumerPrototype( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.webhooks.create_consumer(req) +) as s: + res = s.webhooks.create_consumer(request={ + "event_types": [ + "DataSyncCompleted", + "Dataset data changed", + ], + "url": "https://example.com/webhoook-consumer", + }) -if res.webhook_consumer is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -106,16 +109,16 @@ if res.webhook_consumer is not None: | `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)** +**[shared.WebhookConsumer](../../models/shared/webhookconsumer.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete_consumer @@ -126,24 +129,19 @@ if res.webhook_consumer is not None: ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.DeleteWebhookConsumerRequest( - webhook_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) +) as s: + s.webhooks.delete_consumer(request={ + "webhook_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -res = s.webhooks.delete_consumer(req) - -if res is not None: - # handle response - pass + # Use the SDK ... ``` @@ -154,44 +152,39 @@ if res is not None: | `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 | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~get~~ -Get a single webhook +Use the *Get webhook (legacy)* endpoint to retrieve a specific webhook for your client. + +**Note:** This endpoint has been deprecated. Please use the [*List webhook consumers*](https://docs.codat.io/platform-api#/operations/list-webhook-consumers) endpoint for listing webhooks moving forward. > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.GetWebhookRequest( - rule_id='7318949f-c008-4936-a8ff-10d7ab563fa6', -) - -res = s.webhooks.get(req) +) as s: + res = s.webhooks.get(request={ + "rule_id": "7318949f-c008-4936-a8ff-10d7ab563fa6", + }) -if res.webhook is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -202,46 +195,46 @@ if res.webhook is not None: | `request` | [operations.GetWebhookRequest](../../models/operations/getwebhookrequest.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.GetWebhookResponse](../../models/operations/getwebhookresponse.md)** +**[shared.Webhook](../../models/shared/webhook.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~list~~ -List webhooks that you are subscribed to. +Use the *List webhooks (legacy)* endpoint to retrieve all existing rule-based webhooks for your client. + +**Note:** This endpoint has been deprecated. Please use the [*List webhook consumers*](https://docs.codat.io/platform-api#/operations/list-webhook-consumers) endpoint for listing webhooks moving forward. > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. ### Example Usage ```python -import codatplatform -from codatplatform.models import operations, shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -req = operations.ListRulesRequest( - order_by='-modifiedDate', - page=1, - page_size=100, -) - -res = s.webhooks.list(req) - -if res.webhooks is not None: - # handle response - pass +) as s: + res = s.webhooks.list(request={ + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -252,16 +245,16 @@ if res.webhooks is not None: | `request` | [operations.ListRulesRequest](../../models/operations/listrulesrequest.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.ListRulesResponse](../../models/operations/listrulesresponse.md)** +**[shared.Webhooks](../../models/shared/webhooks.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list_consumers @@ -272,21 +265,19 @@ if res.webhooks is not None: ### Example Usage ```python -import codatplatform -from codatplatform.models import shared +from codat_platform import CodatPlatform +from codat_platform.models import shared -s = codatplatform.CodatPlatform( +with CodatPlatform( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.webhooks.list_consumers() - -res = s.webhooks.list_consumers() - -if res.webhook_consumers is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -296,13 +287,13 @@ if res.webhook_consumers is not None: | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `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)** +**[shared.WebhookConsumers](../../models/shared/webhookconsumers.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/platform/poetry.lock b/platform/poetry.lock new file mode 100644 index 000000000..c685b1d9f --- /dev/null +++ b/platform/poetry.lock @@ -0,0 +1,557 @@ +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + +[[package]] +name = "anyio" +version = "4.5.2" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.8" +files = [ + {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, + {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} + +[package.extras] +doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +trio = ["trio (>=0.26.1)"] + +[[package]] +name = "astroid" +version = "3.2.4" +description = "An abstract syntax tree for Python with inference support." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, + {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} + +[[package]] +name = "certifi" +version = "2024.8.30" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "dill" +version = "0.3.9" +description = "serialize all of Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, + {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, +] + +[package.extras] +graph = ["objgraph (>=1.7.2)"] +profile = ["gprof2dot (>=2022.7.29)"] + +[[package]] +name = "eval-type-backport" +version = "0.2.0" +description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." +optional = false +python-versions = ">=3.8" +files = [ + {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, + {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, +] + +[package.extras] +tests = ["pytest"] + +[[package]] +name = "exceptiongroup" +version = "1.2.2" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + +[[package]] +name = "httpcore" +version = "1.0.7" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.7-py3-none-any.whl", hash = "sha256:a3fff8f43dc260d5bd363d9f9cf1830fa3a458b332856f34282de498ed420edd"}, + {file = "httpcore-1.0.7.tar.gz", hash = "sha256:8551cb62a169ec7162ac7be8d4817d561f60e08eaa485234898414bb5a8a0b4c"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.13,<0.15" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.27.2" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, + {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" +sniffio = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "idna" +version = "3.10" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + +[[package]] +name = "jsonpath-python" +version = "1.0.6" +description = "A more powerful JSONPath implementation in modern python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, + {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, +] + +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + +[[package]] +name = "mypy" +version = "1.13.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, + {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, + {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, + {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, + {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, + {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, + {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, + {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, + {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, + {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, + {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, + {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, + {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, + {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, + {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, + {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, + {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, + {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, + {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, + {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, + {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, + {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.6.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "platformdirs" +version = "4.3.6" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +optional = false +python-versions = ">=3.8" +files = [ + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] + +[[package]] +name = "pydantic" +version = "2.9.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, + {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, +] + +[package.dependencies] +annotated-types = ">=0.6.0" +pydantic-core = "2.23.4" +typing-extensions = [ + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, +] + +[package.extras] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] + +[[package]] +name = "pydantic-core" +version = "2.23.4" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b"}, + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071"}, + {file = "pydantic_core-2.23.4-cp310-none-win32.whl", hash = "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119"}, + {file = "pydantic_core-2.23.4-cp310-none-win_amd64.whl", hash = "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64"}, + {file = "pydantic_core-2.23.4-cp311-none-win32.whl", hash = "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f"}, + {file = "pydantic_core-2.23.4-cp311-none-win_amd64.whl", hash = "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"}, + {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"}, + {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f"}, + {file = "pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769"}, + {file = "pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb"}, + {file = "pydantic_core-2.23.4-cp38-none-win32.whl", hash = "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6"}, + {file = "pydantic_core-2.23.4-cp38-none-win_amd64.whl", hash = "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605"}, + {file = "pydantic_core-2.23.4-cp39-none-win32.whl", hash = "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6"}, + {file = "pydantic_core-2.23.4-cp39-none-win_amd64.whl", hash = "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e"}, + {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pylint" +version = "3.2.3" +description = "python code static checker" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, + {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, +] + +[package.dependencies] +astroid = ">=3.2.2,<=3.3.0-dev0" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +dill = [ + {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, +] +isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" +mccabe = ">=0.6,<0.8" +platformdirs = ">=2.2.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +tomlkit = ">=0.10.1" +typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} + +[package.extras] +spelling = ["pyenchant (>=3.2,<4.0)"] +testutils = ["gitpython (>3)"] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + +[[package]] +name = "tomli" +version = "2.1.0" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomli-2.1.0-py3-none-any.whl", hash = "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391"}, + {file = "tomli-2.1.0.tar.gz", hash = "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8"}, +] + +[[package]] +name = "tomlkit" +version = "0.13.2" +description = "Style preserving TOML library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, + {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, +] + +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20241003" +description = "Typing stubs for python-dateutil" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-python-dateutil-2.9.0.20241003.tar.gz", hash = "sha256:58cb85449b2a56d6684e41aeefb4c4280631246a0da1a719bdbe6f3fb0317446"}, + {file = "types_python_dateutil-2.9.0.20241003-py3-none-any.whl", hash = "sha256:250e1d8e80e7bbc3a6c99b907762711d1a1cdd00e978ad39cb5940f6f0a87f3d"}, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + +[[package]] +name = "typing-inspect" +version = "0.9.0" +description = "Runtime inspection utilities for typing module." +optional = false +python-versions = "*" +files = [ + {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, + {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, +] + +[package.dependencies] +mypy-extensions = ">=0.3.0" +typing-extensions = ">=3.7.4" + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "634a1e2581f680cde0149401ee60f1a571cfb482ce541acd8d0fa9a558cadf9d" diff --git a/platform/poetry.toml b/platform/poetry.toml new file mode 100644 index 000000000..ab1033bd3 --- /dev/null +++ b/platform/poetry.toml @@ -0,0 +1,2 @@ +[virtualenvs] +in-project = true diff --git a/platform/pylintrc b/platform/pylintrc index 6a1c3fc06..508003862 100644 --- a/platform/pylintrc +++ b/platform/pylintrc @@ -59,10 +59,11 @@ ignore-paths= # Emacs file locks ignore-patterns=^\.# -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis). It -# supports qualified module names, as well as Unix pattern matching. +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. ignored-modules= # Python code to execute, usually for sys.path manipulation such as @@ -93,6 +94,12 @@ py-version=3.8 # Discover python modules and packages in the file system subtree. recursive=no +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots=src + # When enabled, pylint would attempt to guess common misconfiguration and emit # user-friendly hints instead of false-positive error messages. suggestion-mode=yes @@ -225,6 +232,10 @@ no-docstring-rgx=^_ # These decorators are taken in consideration only for invalid-name. property-classes=abc.abstractproperty +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +typealias-rgx=.* + # Regular expression matching correct type variable names. If left empty, type # variable names will be checked with the set naming style. #typevar-rgx= @@ -247,15 +258,12 @@ check-protected-access-in-special-methods=no defining-attr-methods=__init__, __new__, setUp, + asyncSetUp, __post_init__ # List of member names, which should be excluded from the protected access # warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit # List of valid names for the first argument in a class method. valid-classmethod-first-arg=cls @@ -418,6 +426,8 @@ disable=raw-checker-failed, suppressed-message, useless-suppression, deprecated-pragma, + use-implicit-booleaness-not-comparison-to-string, + use-implicit-booleaness-not-comparison-to-zero, use-symbolic-message-instead, trailing-whitespace, line-too-long, @@ -430,7 +440,6 @@ disable=raw-checker-failed, broad-exception-raised, too-few-public-methods, too-many-branches, - chained-comparison, duplicate-code, trailing-newlines, too-many-public-methods, @@ -443,13 +452,15 @@ disable=raw-checker-failed, too-many-boolean-expressions, no-else-raise, bare-except, - broad-exception-caught + broad-exception-caught, + fixme, + relative-beyond-top-level # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member +enable= [METHOD_ARGS] @@ -495,8 +506,9 @@ evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor # used to format the message information. See doc for all details. msg-template= -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio). You can also give a reporter class, e.g. +# Set the output format. Available formats are: text, parseable, colorized, +# json2 (improved json format), json (old json format) and msvs (visual +# studio). You can also give a reporter class, e.g. # mypackage.mymodule.MyReporterClass. #output-format= @@ -530,8 +542,8 @@ min-similarity-lines=4 # Limits count of emitted suggestions for spelling mistakes. max-spelling-suggestions=4 -# Spelling dictionary name. Available dictionaries: none. To make it work, -# install the 'python-enchant' package. +# Spelling dictionary name. No available dictionaries : You need to install +# both the python package and the system dependency for enchant to work. spelling-dict= # List of comma separated words that should be considered directives if they diff --git a/platform/pyproject.toml b/platform/pyproject.toml new file mode 100644 index 000000000..620e458bd --- /dev/null +++ b/platform/pyproject.toml @@ -0,0 +1,55 @@ +[tool.poetry] +name = "codat-platform" +version = "4.0.0" +description = "Manage the building blocks of Codat, including companies, connections, and more." +authors = ["Speakeasy",] +readme = "README-PYPI.md" +repository = "https://github.com/codatio/client-sdk-python.git" +packages = [ + { include = "codat_platform", from = "src" } +] +include = ["py.typed", "src/codat_platform/py.typed"] + +[tool.setuptools.package-data] +"*" = ["py.typed", "src/codat_platform/py.typed"] + +[virtualenvs] +in-project = true + +[tool.poetry.dependencies] +python = "^3.8" +eval-type-backport = "^0.2.0" +httpx = "^0.27.0" +jsonpath-python = "^1.0.6" +pydantic = "~2.9.2" +python-dateutil = "^2.8.2" +typing-inspect = "^0.9.0" + +[tool.poetry.group.dev.dependencies] +mypy = "==1.13.0" +pylint = "==3.2.3" +types-python-dateutil = "^2.9.0.20240316" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +pythonpath = ["src"] + +[tool.mypy] +disable_error_code = "misc" + +[[tool.mypy.overrides]] +module = "typing_inspect" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "jsonpath" +ignore_missing_imports = true + +[tool.pyright] +venvPath = "." +venv = ".venv" + + diff --git a/platform/scripts/prepare-readme.py b/platform/scripts/prepare-readme.py new file mode 100644 index 000000000..7c07cddd7 --- /dev/null +++ b/platform/scripts/prepare-readme.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import re +import shutil + +try: + with open("README.md", "r") as rh: + readme_contents = rh.read() + GITHUB_URL = "https://github.com/codatio/client-sdk-python.git" + GITHUB_URL = ( + GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL + ) + # links on PyPI should have absolute URLs + readme_contents = re.sub( + r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))", + lambda m: m.group(1) + + GITHUB_URL + + "/blob/master/" + + m.group(2) + + m.group(3), + readme_contents, + ) + + with open("README-PYPI.md", "w") as wh: + wh.write(readme_contents) +except Exception as e: + try: + print("Failed to rewrite README.md to README-PYPI.md, copying original instead") + print(e) + shutil.copyfile("README.md", "README-PYPI.md") + except Exception as e: + print("Failed to copy README.md to README-PYPI.md") + print(e) diff --git a/platform/scripts/publish.sh b/platform/scripts/publish.sh new file mode 100755 index 000000000..ab45b1f94 --- /dev/null +++ b/platform/scripts/publish.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} + +poetry run python scripts/prepare-readme.py + +poetry publish --build --skip-existing diff --git a/platform/setup.py b/platform/setup.py deleted file mode 100644 index 652d28330..000000000 --- a/platform/setup.py +++ /dev/null @@ -1,55 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import setuptools -import re - -try: - with open('README.md', 'r') as fh: - long_description = fh.read() - GITHUB_URL = 'https://github.com/codatio/client-sdk-python.git' - GITHUB_URL = GITHUB_URL[: -len('.git')] if GITHUB_URL.endswith('.git') else GITHUB_URL - # links on PyPI should have absolute URLs - long_description = re.sub( - r'(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))', - lambda m: m.group(1) + GITHUB_URL + '/blob/master/' + m.group(2) + m.group(3), - long_description, - ) -except FileNotFoundError: - long_description = '' - -setuptools.setup( - name='codat-platform', - version='3.5.0', - author='Codat', - description='Manage the building blocks of Codat, including companies, connections, and more.', - url='https://github.com/codatio/client-sdk-python.git', - long_description=long_description, - long_description_content_type='text/markdown', - packages=setuptools.find_packages(where='src'), - install_requires=[ - "certifi>=2023.7.22", - "charset-normalizer>=3.2.0", - "dataclasses-json>=0.6.4", - "idna>=3.4", - "jsonpath-python>=1.0.6", - "marshmallow>=3.19.0", - "mypy-extensions>=1.0.0", - "packaging>=23.1", - "python-dateutil>=2.8.2", - "requests>=2.31.0", - "six>=1.16.0", - "typing-inspect>=0.9.0", - "typing_extensions>=4.7.1", - "urllib3>=1.26.18", - ], - extras_require={ - "dev": [ - "pylint==3.1.0", - ], - }, - package_dir={'': 'src'}, - python_requires='>=3.8', - package_data={ - 'codat-platform': ['py.typed'] - }, -) diff --git a/platform/src/codat_platform/__init__.py b/platform/src/codat_platform/__init__.py new file mode 100644 index 000000000..5c3491793 --- /dev/null +++ b/platform/src/codat_platform/__init__.py @@ -0,0 +1,8 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._version import __title__, __version__ +from .sdk import * +from .sdkconfiguration import * + + +VERSION: str = __version__ diff --git a/platform/src/codat_platform/_hooks/__init__.py b/platform/src/codat_platform/_hooks/__init__.py new file mode 100644 index 000000000..2ee66cdd5 --- /dev/null +++ b/platform/src/codat_platform/_hooks/__init__.py @@ -0,0 +1,5 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .sdkhooks import * +from .types import * +from .registration import * diff --git a/platform/src/codat_platform/_hooks/registration.py b/platform/src/codat_platform/_hooks/registration.py new file mode 100644 index 000000000..cab477877 --- /dev/null +++ b/platform/src/codat_platform/_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/codat_platform/_hooks/sdkhooks.py similarity index 65% rename from platform/src/codatplatform/_hooks/sdkhooks.py rename to platform/src/codat_platform/_hooks/sdkhooks.py index 17750b62c..702f12794 100644 --- a/platform/src/codatplatform/_hooks/sdkhooks.py +++ b/platform/src/codat_platform/_hooks/sdkhooks.py @@ -1,13 +1,23 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -import requests -from .types import SDKInitHook, BeforeRequestContext, BeforeRequestHook, AfterSuccessContext, AfterSuccessHook, AfterErrorContext, AfterErrorHook, Hooks +import httpx +from .types import ( + SDKInitHook, + BeforeRequestContext, + BeforeRequestHook, + AfterSuccessContext, + AfterSuccessHook, + AfterErrorContext, + AfterErrorHook, + Hooks, +) from .registration import init_hooks from typing import List, Optional, Tuple +from codat_platform.httpclient import HttpClient class SDKHooks(Hooks): - def __init__(self): + def __init__(self) -> None: self.sdk_init_hooks: List[SDKInitHook] = [] self.before_request_hooks: List[BeforeRequestHook] = [] self.after_success_hooks: List[AfterSuccessHook] = [] @@ -26,12 +36,14 @@ def register_after_success_hook(self, hook: AfterSuccessHook) -> None: 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]: + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: 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) -> requests.PreparedRequest: + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> httpx.Request: for hook in self.before_request_hooks: out = hook.before_request(hook_ctx, request) if isinstance(out, Exception): @@ -40,7 +52,9 @@ def before_request(self, hook_ctx: BeforeRequestContext, request: requests.Prepa return request - def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Response) -> requests.Response: + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> httpx.Response: for hook in self.after_success_hooks: out = hook.after_success(hook_ctx, response) if isinstance(out, Exception): @@ -48,7 +62,12 @@ def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Respon response = out return response - def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests.Response], error: Optional[Exception]) -> Tuple[Optional[requests.Response], Optional[Exception]]: + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: for hook in self.after_error_hooks: result = hook.after_error(hook_ctx, response, error) if isinstance(result, Exception): diff --git a/platform/src/codatplatform/_hooks/types.py b/platform/src/codat_platform/_hooks/types.py similarity index 51% rename from platform/src/codatplatform/_hooks/types.py rename to platform/src/codat_platform/_hooks/types.py index b24c14146..d23d8eb0d 100644 --- a/platform/src/codatplatform/_hooks/types.py +++ b/platform/src/codat_platform/_hooks/types.py @@ -1,7 +1,8 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -import requests as requests_http from abc import ABC, abstractmethod +from codat_platform.httpclient import HttpClient +import httpx from typing import Any, Callable, List, Optional, Tuple, Union @@ -10,7 +11,12 @@ class HookContext: 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]]]): + 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 @@ -18,41 +24,55 @@ def __init__(self, operation_id: str, oauth2_scopes: Optional[List[str]], securi class BeforeRequestContext(HookContext): def __init__(self, hook_ctx: HookContext): - super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source) + super().__init__( + hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + ) class AfterSuccessContext(HookContext): def __init__(self, hook_ctx: HookContext): - super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source) - + super().__init__( + hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + ) class AfterErrorContext(HookContext): def __init__(self, hook_ctx: HookContext): - super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source) + super().__init__( + hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + ) class SDKInitHook(ABC): @abstractmethod - def sdk_init(self, base_url: str, client: requests_http.Session) -> Tuple[str, requests_http.Session]: + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: pass class BeforeRequestHook(ABC): @abstractmethod - def before_request(self, hook_ctx: BeforeRequestContext, request: requests_http.PreparedRequest) -> Union[requests_http.PreparedRequest, Exception]: + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> Union[httpx.Request, Exception]: pass class AfterSuccessHook(ABC): @abstractmethod - def after_success(self, hook_ctx: AfterSuccessContext, response: requests_http.Response) -> Union[requests_http.Response, Exception]: + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> Union[httpx.Response, 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.Response], Optional[Exception]], Exception]: + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: pass diff --git a/platform/src/codat_platform/_version.py b/platform/src/codat_platform/_version.py new file mode 100644 index 000000000..99ff3f58f --- /dev/null +++ b/platform/src/codat_platform/_version.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import importlib.metadata + +__title__: str = "codat-platform" +__version__: str = "4.0.0" + +try: + if __package__ is not None: + __version__ = importlib.metadata.version(__package__) +except importlib.metadata.PackageNotFoundError: + pass diff --git a/platform/src/codat_platform/basesdk.py b/platform/src/codat_platform/basesdk.py new file mode 100644 index 000000000..b80326614 --- /dev/null +++ b/platform/src/codat_platform/basesdk.py @@ -0,0 +1,339 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .sdkconfiguration import SDKConfiguration +from codat_platform import utils +from codat_platform._hooks import ( + AfterErrorContext, + AfterSuccessContext, + BeforeRequestContext, +) +from codat_platform.models import errors +from codat_platform.utils import RetryConfig, SerializedRequestBody, get_body_content +import httpx +from typing import Callable, List, Optional, Tuple + + +class BaseSDK: + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + def get_url(self, base_url, url_variables): + sdk_url, sdk_variables = self.sdk_configuration.get_server_details() + + if base_url is None: + base_url = sdk_url + + if url_variables is None: + url_variables = sdk_variables + + return utils.template_url(base_url, url_variables) + + def build_request_async( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + client = self.sdk_configuration.async_client + return self.build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + ) + + def build_request( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + client = self.sdk_configuration.client + return self.build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + ) + + def build_request_with_client( + self, + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + query_params = {} + + url = url_override + if url is None: + url = utils.generate_url( + self.get_url(base_url, url_variables), + path, + request if request_has_path_params else None, + _globals if request_has_path_params else None, + ) + + query_params = utils.get_query_params( + request if request_has_query_params else None, + _globals if request_has_query_params else None, + ) + + headers = utils.get_headers(request, _globals) + headers["Accept"] = accept_header_value + headers[user_agent_header] = self.sdk_configuration.user_agent + + if security is not None: + if callable(security): + security = security() + + if security is not None: + security_headers, security_query_params = utils.get_security(security) + headers = {**headers, **security_headers} + query_params = {**query_params, **security_query_params} + + serialized_request_body = SerializedRequestBody("application/octet-stream") + if get_serialized_body is not None: + rb = get_serialized_body() + if request_body_required and rb is None: + raise ValueError("request body is required") + + if rb is not None: + serialized_request_body = rb + + if ( + serialized_request_body.media_type is not None + and serialized_request_body.media_type + not in ( + "multipart/form-data", + "multipart/mixed", + ) + ): + headers["content-type"] = serialized_request_body.media_type + + timeout = timeout_ms / 1000 if timeout_ms is not None else None + + return client.build_request( + method, + url, + params=query_params, + content=serialized_request_body.content, + data=serialized_request_body.data, + files=serialized_request_body.files, + headers=headers, + timeout=timeout, + ) + + def do_request( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.client + logger = self.sdk_configuration.debug_logger + + def do(): + http_res = None + try: + req = self.sdk_configuration.get_hooks().before_request( + BeforeRequestContext(hook_ctx), request + ) + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + http_res = client.send(req, stream=stream) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error( + AfterErrorContext(hook_ctx), None, e + ) + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.SDKError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = self.sdk_configuration.get_hooks().after_error( + AfterErrorContext(hook_ctx), http_res, None + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred") + + return http_res + + if retry_config is not None: + http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) + else: + http_res = do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = self.sdk_configuration.get_hooks().after_success( + AfterSuccessContext(hook_ctx), http_res + ) + + return http_res + + async def do_request_async( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.async_client + logger = self.sdk_configuration.debug_logger + + async def do(): + http_res = None + try: + req = self.sdk_configuration.get_hooks().before_request( + BeforeRequestContext(hook_ctx), request + ) + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + http_res = await client.send(req, stream=stream) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error( + AfterErrorContext(hook_ctx), None, e + ) + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.SDKError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = self.sdk_configuration.get_hooks().after_error( + AfterErrorContext(hook_ctx), http_res, None + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred") + + return http_res + + if retry_config is not None: + http_res = await utils.retry_async( + do, utils.Retries(retry_config[0], retry_config[1]) + ) + else: + http_res = await do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = self.sdk_configuration.get_hooks().after_success( + AfterSuccessContext(hook_ctx), http_res + ) + + return http_res diff --git a/platform/src/codat_platform/companies.py b/platform/src/codat_platform/companies.py new file mode 100644 index 000000000..1797cff9f --- /dev/null +++ b/platform/src/codat_platform/companies.py @@ -0,0 +1,1752 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Companies(BaseSDK): + r"""Create and manage your SMB users' companies.""" + + def add_product( + self, + *, + request: Union[ + operations.AddProductRequest, operations.AddProductRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Add product + + Use the *Add product* endpoint to enable a product for the company specified by `companyId`. + + > Note: This feature is currently in alpha and available only to participants in the development program. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.AddProductRequest) + request = cast(operations.AddProductRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/products/{productIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="add-product", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def add_product_async( + self, + *, + request: Union[ + operations.AddProductRequest, operations.AddProductRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Add product + + Use the *Add product* endpoint to enable a product for the company specified by `companyId`. + + > Note: This feature is currently in alpha and available only to participants in the development program. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.AddProductRequest) + request = cast(operations.AddProductRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/products/{productIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="add-product", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def create( + self, + *, + request: Optional[ + Union[shared.CompanyRequestBody, shared.CompanyRequestBodyTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Create company + + Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. + + 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. + + 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`. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.CompanyRequestBody]) + request = cast(Optional[shared.CompanyRequestBody], request) + + req = self.build_request( + method="POST", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.CompanyRequestBody] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="create-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_async( + self, + *, + request: Optional[ + Union[shared.CompanyRequestBody, shared.CompanyRequestBodyTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Create company + + Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. + + 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. + + 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`. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.CompanyRequestBody]) + request = cast(Optional[shared.CompanyRequestBody], request) + + req = self.build_request_async( + method="POST", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.CompanyRequestBody] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="create-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def delete( + self, + *, + request: Union[ + operations.DeleteCompanyRequest, operations.DeleteCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete a company + + The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. + + 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. + + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteCompanyRequest) + request = cast(operations.DeleteCompanyRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="delete-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def delete_async( + self, + *, + request: Union[ + operations.DeleteCompanyRequest, operations.DeleteCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete a company + + The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. + + 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. + + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteCompanyRequest) + request = cast(operations.DeleteCompanyRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="delete-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get( + self, + *, + request: Union[ + operations.GetCompanyRequest, operations.GetCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Get company + + The *Get company* endpoint returns a single company for a given `companyId`. + + 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. + + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyRequest) + request = cast(operations.GetCompanyRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetCompanyRequest, operations.GetCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Get company + + The *Get company* endpoint returns a single company for a given `companyId`. + + 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. + + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyRequest) + request = cast(operations.GetCompanyRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_access_token( + self, + *, + request: Union[ + operations.GetCompanyAccessTokenRequest, + operations.GetCompanyAccessTokenRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyAccessToken]: + r"""Get company access token + + Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyAccessTokenRequest) + request = cast(operations.GetCompanyAccessTokenRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/accessToken", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-company-access-token", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyAccessToken] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_access_token_async( + self, + *, + request: Union[ + operations.GetCompanyAccessTokenRequest, + operations.GetCompanyAccessTokenRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyAccessToken]: + r"""Get company access token + + Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyAccessTokenRequest) + request = cast(operations.GetCompanyAccessTokenRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/accessToken", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-company-access-token", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyAccessToken] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def list( + self, + *, + request: Union[ + operations.ListCompaniesRequest, operations.ListCompaniesRequestTypedDict + ] = operations.ListCompaniesRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Companies]: + r"""List companies + + The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. + + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListCompaniesRequest) + request = cast(operations.ListCompaniesRequest, request) + + req = self.build_request( + method="GET", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="list-companies", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Companies]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListCompaniesRequest, operations.ListCompaniesRequestTypedDict + ] = operations.ListCompaniesRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Companies]: + r"""List companies + + The *List companies* endpoint returns a list of [companies](https://docs.codat.io/platform-api#/schemas/Company) associated to your instances. + + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListCompaniesRequest) + request = cast(operations.ListCompaniesRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="list-companies", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Companies]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def remove_product( + self, + *, + request: Union[ + operations.RemoveProductRequest, operations.RemoveProductRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Remove product + + Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. + + > Note: This feature is currently in alpha and available only to participants in the development program. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RemoveProductRequest) + request = cast(operations.RemoveProductRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}/products/{productIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="remove-product", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def remove_product_async( + self, + *, + request: Union[ + operations.RemoveProductRequest, operations.RemoveProductRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Remove product + + Use the *Remove product* endpoint to disable a product for the company specified by `companyId`. + + > Note: This feature is currently in alpha and available only to participants in the development program. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RemoveProductRequest) + request = cast(operations.RemoveProductRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}/products/{productIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="remove-product", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def update( + self, + *, + request: Union[ + operations.UpdateCompanyRequest, operations.UpdateCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Update company + + Use the *Update company* endpoint to update both the name and description of the company. + + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateCompanyRequest) + request = cast(operations.UpdateCompanyRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.company_request_body, + False, + True, + "json", + Optional[shared.CompanyRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="update-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def update_async( + self, + *, + request: Union[ + operations.UpdateCompanyRequest, operations.UpdateCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Update company + + Use the *Update company* endpoint to update both the name and description of the company. + + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UpdateCompanyRequest) + request = cast(operations.UpdateCompanyRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.company_request_body, + False, + True, + "json", + Optional[shared.CompanyRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="update-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Company]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/connection_management.py b/platform/src/codat_platform/connection_management.py new file mode 100644 index 000000000..ad3d8bd85 --- /dev/null +++ b/platform/src/codat_platform/connection_management.py @@ -0,0 +1,246 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.cors_settings import CorsSettings +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class ConnectionManagement(BaseSDK): + r"""Configure UI and retrieve access tokens for authentication used by **Connections SDK**.""" + + cors_settings: CorsSettings + + def __init__(self, sdk_config: SDKConfiguration) -> None: + BaseSDK.__init__(self, sdk_config) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.cors_settings = CorsSettings(self.sdk_configuration) + + def get_access_token( + self, + *, + request: Union[ + operations.GetConnectionManagementAccessTokenRequest, + operations.GetConnectionManagementAccessTokenRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.ConnectionManagementAccessToken]: + r"""Get access token + + Use the *Get access token* endpoint to retrieve a new access token for use with the [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management). The token is only valid for one hour and applies to a single company. + + The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetConnectionManagementAccessTokenRequest + ) + request = cast(operations.GetConnectionManagementAccessTokenRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connectionManagement/accessToken", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-connection-management-access-token", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.ConnectionManagementAccessToken] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_access_token_async( + self, + *, + request: Union[ + operations.GetConnectionManagementAccessTokenRequest, + operations.GetConnectionManagementAccessTokenRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.ConnectionManagementAccessToken]: + r"""Get access token + + Use the *Get access token* endpoint to retrieve a new access token for use with the [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management). The token is only valid for one hour and applies to a single company. + + The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetConnectionManagementAccessTokenRequest + ) + request = cast(operations.GetConnectionManagementAccessTokenRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connectionManagement/accessToken", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-connection-management-access-token", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.ConnectionManagementAccessToken] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/connections.py b/platform/src/codat_platform/connections.py new file mode 100644 index 000000000..1b0acfd2b --- /dev/null +++ b/platform/src/codat_platform/connections.py @@ -0,0 +1,1316 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Dict, Optional, Union, cast + + +class Connections(BaseSDK): + r"""Create new and manage existing data connections for a company.""" + + def create( + self, + *, + request: Union[ + operations.CreateConnectionRequest, + operations.CreateConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Create connection + + Creates a connection for the company by providing a valid `platformKey`. + + Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateConnectionRequest) + request = cast(operations.CreateConnectionRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.CreateConnectionRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="create-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_async( + self, + *, + request: Union[ + operations.CreateConnectionRequest, + operations.CreateConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Create connection + + Creates a connection for the company by providing a valid `platformKey`. + + Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.CreateConnectionRequest) + request = cast(operations.CreateConnectionRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.CreateConnectionRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="create-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def delete( + self, + *, + request: Union[ + operations.DeleteConnectionRequest, + operations.DeleteConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete connection + + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteConnectionRequest) + request = cast(operations.DeleteConnectionRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="delete-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def delete_async( + self, + *, + request: Union[ + operations.DeleteConnectionRequest, + operations.DeleteConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete connection + + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteConnectionRequest) + request = cast(operations.DeleteConnectionRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="delete-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get( + self, + *, + request: Union[ + operations.GetConnectionRequest, operations.GetConnectionRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetConnectionRequest) + request = cast(operations.GetConnectionRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetConnectionRequest, operations.GetConnectionRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetConnectionRequest) + request = cast(operations.GetConnectionRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def list( + self, + *, + request: Union[ + operations.ListConnectionsRequest, + operations.ListConnectionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connections]: + r"""List connections + + List the connections for a company. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListConnectionsRequest) + request = cast(operations.ListConnectionsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="list-connections", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connections]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListConnectionsRequest, + operations.ListConnectionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connections]: + r"""List connections + + List the connections for a company. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListConnectionsRequest) + request = cast(operations.ListConnectionsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="list-connections", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connections]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def unlink( + self, + *, + request: Union[ + operations.UnlinkConnectionRequest, + operations.UnlinkConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UnlinkConnectionRequest) + request = cast(operations.UnlinkConnectionRequest, request) + + req = self.build_request( + method="PATCH", + path="/companies/{companyId}/connections/{connectionId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_connection_status, + False, + True, + "json", + Optional[shared.UpdateConnectionStatus], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="unlink-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def unlink_async( + self, + *, + request: Union[ + operations.UnlinkConnectionRequest, + operations.UnlinkConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.UnlinkConnectionRequest) + request = cast(operations.UnlinkConnectionRequest, request) + + req = self.build_request_async( + method="PATCH", + path="/companies/{companyId}/connections/{connectionId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_connection_status, + False, + True, + "json", + Optional[shared.UpdateConnectionStatus], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="unlink-connection", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def update_authorization( + self, + *, + request: Union[ + operations.UpdateConnectionAuthorizationRequest, + operations.UpdateConnectionAuthorizationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Update authorization + + Update data connection's authorization. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UpdateConnectionAuthorizationRequest + ) + request = cast(operations.UpdateConnectionAuthorizationRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/authorization", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, False, True, "json", Optional[Dict[str, str]] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="update-connection-authorization", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def update_authorization_async( + self, + *, + request: Union[ + operations.UpdateConnectionAuthorizationRequest, + operations.UpdateConnectionAuthorizationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Update authorization + + Update data connection's authorization. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.UpdateConnectionAuthorizationRequest + ) + request = cast(operations.UpdateConnectionAuthorizationRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/authorization", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, False, True, "json", Optional[Dict[str, str]] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="update-connection-authorization", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Connection]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/cors_settings.py b/platform/src/codat_platform/cors_settings.py new file mode 100644 index 000000000..cbe434f24 --- /dev/null +++ b/platform/src/codat_platform/cors_settings.py @@ -0,0 +1,456 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class CorsSettings(BaseSDK): + def get( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.ConnectionManagementAllowedOrigins]: + r"""Get CORS settings + + The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. + + Enabling CORS with Codat is required by our embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. + + The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request( + method="GET", + path="/connectionManagement/corsSettings", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-connection-management-cors-settings", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.ConnectionManagementAllowedOrigins] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.ConnectionManagementAllowedOrigins]: + r"""Get CORS settings + + The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. + + Enabling CORS with Codat is required by our embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. + + The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request_async( + method="GET", + path="/connectionManagement/corsSettings", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-connection-management-cors-settings", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.ConnectionManagementAllowedOrigins] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def set( + self, + *, + request: Optional[ + Union[ + shared.ConnectionManagementAllowedOrigins, + shared.ConnectionManagementAllowedOriginsTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.ConnectionManagementAllowedOrigins]: + r"""Set CORS settings + + The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + + Enabling CORS with Codat is required by our embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. + + The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[shared.ConnectionManagementAllowedOrigins] + ) + request = cast(Optional[shared.ConnectionManagementAllowedOrigins], request) + + req = self.build_request( + method="POST", + path="/connectionManagement/corsSettings", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[shared.ConnectionManagementAllowedOrigins], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="set-connection-management-cors-settings", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.ConnectionManagementAllowedOrigins] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def set_async( + self, + *, + request: Optional[ + Union[ + shared.ConnectionManagementAllowedOrigins, + shared.ConnectionManagementAllowedOriginsTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.ConnectionManagementAllowedOrigins]: + r"""Set CORS settings + + The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). + + Enabling CORS with Codat is required by our embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. + + The embeddable [Connections SDK](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[shared.ConnectionManagementAllowedOrigins] + ) + request = cast(Optional[shared.ConnectionManagementAllowedOrigins], request) + + req = self.build_request_async( + method="POST", + path="/connectionManagement/corsSettings", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[shared.ConnectionManagementAllowedOrigins], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="set-connection-management-cors-settings", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.ConnectionManagementAllowedOrigins] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/custom_data_type.py b/platform/src/codat_platform/custom_data_type.py new file mode 100644 index 000000000..29d8b051e --- /dev/null +++ b/platform/src/codat_platform/custom_data_type.py @@ -0,0 +1,924 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class CustomDataType(BaseSDK): + r"""Configure and pull additional data types that are not included in Codat's standardized data model.""" + + def configure( + self, + *, + request: Union[ + operations.ConfigureCustomDataTypeRequest, + operations.ConfigureCustomDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CustomDataTypeConfiguration]: + r"""Configure custom data type + + The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. + + 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. + + ### Tips and traps + + - You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. + + - You can only indicate a single data source for each customer data type. + + - Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.ConfigureCustomDataTypeRequest + ) + request = cast(operations.ConfigureCustomDataTypeRequest, request) + + req = self.build_request( + method="PUT", + path="/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.custom_data_type_configuration, + False, + True, + "json", + Optional[shared.CustomDataTypeConfiguration], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="configure-custom-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CustomDataTypeConfiguration] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def configure_async( + self, + *, + request: Union[ + operations.ConfigureCustomDataTypeRequest, + operations.ConfigureCustomDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CustomDataTypeConfiguration]: + r"""Configure custom data type + + The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. + + 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. + + ### Tips and traps + + - You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. + + - You can only indicate a single data source for each customer data type. + + - Make your custom configuration as similar as possible to our standard data types so you can interact with them in exactly the same way. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.ConfigureCustomDataTypeRequest + ) + request = cast(operations.ConfigureCustomDataTypeRequest, request) + + req = self.build_request_async( + method="PUT", + path="/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.custom_data_type_configuration, + False, + True, + "json", + Optional[shared.CustomDataTypeConfiguration], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="configure-custom-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CustomDataTypeConfiguration] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_configuration( + self, + *, + request: Union[ + operations.GetCustomDataTypeConfigurationRequest, + operations.GetCustomDataTypeConfigurationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CustomDataTypeRecords]: + r"""Get custom data configuration + + The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. + + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCustomDataTypeConfigurationRequest + ) + request = cast(operations.GetCustomDataTypeConfigurationRequest, request) + + req = self.build_request( + method="GET", + path="/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-custom-data-type-configuration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CustomDataTypeRecords] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_configuration_async( + self, + *, + request: Union[ + operations.GetCustomDataTypeConfigurationRequest, + operations.GetCustomDataTypeConfigurationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CustomDataTypeRecords]: + r"""Get custom data configuration + + The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. + + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCustomDataTypeConfigurationRequest + ) + request = cast(operations.GetCustomDataTypeConfigurationRequest, request) + + req = self.build_request_async( + method="GET", + path="/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-custom-data-type-configuration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CustomDataTypeRecords] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def list( + self, + *, + request: Union[ + operations.ListCustomDataTypeRecordsRequest, + operations.ListCustomDataTypeRecordsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CustomDataTypeRecords]: + r"""List custom data type records + + The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. + + 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) + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.ListCustomDataTypeRecordsRequest + ) + request = cast(operations.ListCustomDataTypeRecordsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/data/custom/{customDataIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="list-custom-data-type-records", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "451", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CustomDataTypeRecords] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "451", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListCustomDataTypeRecordsRequest, + operations.ListCustomDataTypeRecordsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CustomDataTypeRecords]: + r"""List custom data type records + + The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. + + 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) + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.ListCustomDataTypeRecordsRequest + ) + request = cast(operations.ListCustomDataTypeRecordsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/data/custom/{customDataIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="list-custom-data-type-records", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "451", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CustomDataTypeRecords] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "451", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def refresh( + self, + *, + request: Union[ + operations.RefreshCustomDataTypeRequest, + operations.RefreshCustomDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshCustomDataTypeRequest) + request = cast(operations.RefreshCustomDataTypeRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/data/queue/custom/{customDataIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="refresh-custom-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "451", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "451", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def refresh_async( + self, + *, + request: Union[ + operations.RefreshCustomDataTypeRequest, + operations.RefreshCustomDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshCustomDataTypeRequest) + request = cast(operations.RefreshCustomDataTypeRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/data/queue/custom/{customDataIdentifier}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="refresh-custom-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "451", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "451", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/httpclient.py b/platform/src/codat_platform/httpclient.py new file mode 100644 index 000000000..167cea4ef --- /dev/null +++ b/platform/src/codat_platform/httpclient.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +# pyright: reportReturnType = false +from typing_extensions import Protocol, runtime_checkable +import httpx +from typing import Any, Optional, Union + + +@runtime_checkable +class HttpClient(Protocol): + def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + def close(self) -> None: + pass + + +@runtime_checkable +class AsyncHttpClient(Protocol): + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + async def aclose(self) -> None: + pass diff --git a/platform/src/codat_platform/integrations.py b/platform/src/codat_platform/integrations.py new file mode 100644 index 000000000..3579a0006 --- /dev/null +++ b/platform/src/codat_platform/integrations.py @@ -0,0 +1,644 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Integrations(BaseSDK): + r"""Get a list of integrations supported by Codat and their logos.""" + + def get( + self, + *, + request: Union[ + operations.GetIntegrationRequest, operations.GetIntegrationRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Integration]: + r"""Get integration + + Get single integration, by platformKey + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetIntegrationRequest) + request = cast(operations.GetIntegrationRequest, request) + + req = self.build_request( + method="GET", + path="/integrations/{platformKey}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-integration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Integration]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetIntegrationRequest, operations.GetIntegrationRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Integration]: + r"""Get integration + + Get single integration, by platformKey + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetIntegrationRequest) + request = cast(operations.GetIntegrationRequest, request) + + req = self.build_request_async( + method="GET", + path="/integrations/{platformKey}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-integration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Integration]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_branding( + self, + *, + request: Union[ + operations.GetIntegrationsBrandingRequest, + operations.GetIntegrationsBrandingRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Branding]: + r"""Get branding + + Get branding for platform. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetIntegrationsBrandingRequest + ) + request = cast(operations.GetIntegrationsBrandingRequest, request) + + req = self.build_request( + method="GET", + path="/integrations/{platformKey}/branding", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-integrations-branding", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Branding]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_branding_async( + self, + *, + request: Union[ + operations.GetIntegrationsBrandingRequest, + operations.GetIntegrationsBrandingRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Branding]: + r"""Get branding + + Get branding for platform. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetIntegrationsBrandingRequest + ) + request = cast(operations.GetIntegrationsBrandingRequest, request) + + req = self.build_request_async( + method="GET", + path="/integrations/{platformKey}/branding", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-integrations-branding", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Branding]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def list( + self, + *, + request: Union[ + operations.ListIntegrationsRequest, + operations.ListIntegrationsRequestTypedDict, + ] = operations.ListIntegrationsRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Integrations]: + r"""List integrations + + List your available integrations + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListIntegrationsRequest) + request = cast(operations.ListIntegrationsRequest, request) + + req = self.build_request( + method="GET", + path="/integrations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="list-integrations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Integrations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_async( + self, + *, + request: Union[ + operations.ListIntegrationsRequest, + operations.ListIntegrationsRequestTypedDict, + ] = operations.ListIntegrationsRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Integrations]: + r"""List integrations + + List your available integrations + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListIntegrationsRequest) + request = cast(operations.ListIntegrationsRequest, request) + + req = self.build_request_async( + method="GET", + path="/integrations", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="list-integrations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Integrations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/models/errors/__init__.py b/platform/src/codat_platform/models/errors/__init__.py new file mode 100644 index 000000000..f056b05a6 --- /dev/null +++ b/platform/src/codat_platform/models/errors/__init__.py @@ -0,0 +1,6 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .errormessage import ErrorMessage, ErrorMessageData +from .sdkerror import SDKError + +__all__ = ["ErrorMessage", "ErrorMessageData", "SDKError"] diff --git a/platform/src/codat_platform/models/errors/errormessage.py b/platform/src/codat_platform/models/errors/errormessage.py new file mode 100644 index 000000000..ae3aee6b9 --- /dev/null +++ b/platform/src/codat_platform/models/errors/errormessage.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform import utils +from codat_platform.models.shared import errorvalidation as shared_errorvalidation +from codat_platform.types import BaseModel, OptionalNullable, UNSET +import pydantic +from typing import Optional +from typing_extensions import Annotated + + +class ErrorMessageData(BaseModel): + can_be_retried: Annotated[Optional[str], pydantic.Field(alias="canBeRetried")] = ( + None + ) + r"""`True` if the error occurred transiently and can be retried.""" + + correlation_id: Annotated[Optional[str], pydantic.Field(alias="correlationId")] = ( + None + ) + r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" + + detailed_error_code: Annotated[ + Optional[int], pydantic.Field(alias="detailedErrorCode") + ] = None + r"""Machine readable error code used to automate processes based on the code returned.""" + + error: Optional[str] = None + r"""A brief description of the error.""" + + service: Optional[str] = None + r"""Codat's service the returned the error.""" + + status_code: Annotated[Optional[int], pydantic.Field(alias="statusCode")] = None + r"""The HTTP status code returned by the error.""" + + validation: OptionalNullable[shared_errorvalidation.ErrorValidation] = UNSET + r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" + + +class ErrorMessage(Exception): + r"""Your API request was not properly authorized.""" + + data: ErrorMessageData + + def __init__(self, data: ErrorMessageData): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, ErrorMessageData) diff --git a/platform/src/codat_platform/models/errors/sdkerror.py b/platform/src/codat_platform/models/errors/sdkerror.py new file mode 100644 index 000000000..03216cbf5 --- /dev/null +++ b/platform/src/codat_platform/models/errors/sdkerror.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from dataclasses import dataclass +from typing import Optional +import httpx + + +@dataclass +class SDKError(Exception): + """Represents an error returned by the API.""" + + message: str + status_code: int = -1 + body: str = "" + raw_response: Optional[httpx.Response] = None + + def __str__(self): + body = "" + if len(self.body) > 0: + body = f"\n{self.body}" + + return f"{self.message}: Status {self.status_code}{body}" diff --git a/platform/src/codat_platform/models/operations/__init__.py b/platform/src/codat_platform/models/operations/__init__.py new file mode 100644 index 000000000..37fc60184 --- /dev/null +++ b/platform/src/codat_platform/models/operations/__init__.py @@ -0,0 +1,181 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .add_product import AddProductRequest, AddProductRequestTypedDict +from .configure_custom_data_type import ( + ConfigureCustomDataTypeRequest, + ConfigureCustomDataTypeRequestTypedDict, +) +from .configure_supplemental_data import ( + ConfigureSupplementalDataRequest, + ConfigureSupplementalDataRequestTypedDict, + DataType, +) +from .create_connection import ( + CreateConnectionRequest, + CreateConnectionRequestBody, + CreateConnectionRequestBodyTypedDict, + CreateConnectionRequestTypedDict, +) +from .delete_api_key import DeleteAPIKeyRequest, DeleteAPIKeyRequestTypedDict +from .delete_company import DeleteCompanyRequest, DeleteCompanyRequestTypedDict +from .delete_connection import DeleteConnectionRequest, DeleteConnectionRequestTypedDict +from .delete_webhook_consumer import ( + DeleteWebhookConsumerRequest, + DeleteWebhookConsumerRequestTypedDict, +) +from .get_company import GetCompanyRequest, GetCompanyRequestTypedDict +from .get_company_access_token import ( + GetCompanyAccessTokenRequest, + GetCompanyAccessTokenRequestTypedDict, +) +from .get_company_data_status import ( + GetCompanyDataStatusRequest, + GetCompanyDataStatusRequestTypedDict, +) +from .get_company_push_history import ( + GetCompanyPushHistoryRequest, + GetCompanyPushHistoryRequestTypedDict, +) +from .get_connection import GetConnectionRequest, GetConnectionRequestTypedDict +from .get_connection_management_access_token import ( + GetConnectionManagementAccessTokenRequest, + GetConnectionManagementAccessTokenRequestTypedDict, +) +from .get_create_update_model_options_by_data_type import ( + GetCreateUpdateModelOptionsByDataTypeRequest, + GetCreateUpdateModelOptionsByDataTypeRequestTypedDict, +) +from .get_custom_data_type_configuration import ( + GetCustomDataTypeConfigurationRequest, + GetCustomDataTypeConfigurationRequestTypedDict, +) +from .get_integration import GetIntegrationRequest, GetIntegrationRequestTypedDict +from .get_integrations_branding import ( + GetIntegrationsBrandingRequest, + GetIntegrationsBrandingRequestTypedDict, +) +from .get_pull_operation import ( + GetPullOperationRequest, + GetPullOperationRequestTypedDict, +) +from .get_push_operation import ( + GetPushOperationRequest, + GetPushOperationRequestTypedDict, +) +from .get_supplemental_data_configuration import ( + GetSupplementalDataConfigurationRequest, + GetSupplementalDataConfigurationRequestTypedDict, + PathParamDataType, +) +from .get_webhook import GetWebhookRequest, GetWebhookRequestTypedDict +from .list_companies import ListCompaniesRequest, ListCompaniesRequestTypedDict +from .list_connections import ListConnectionsRequest, ListConnectionsRequestTypedDict +from .list_custom_data_type_records import ( + ListCustomDataTypeRecordsRequest, + ListCustomDataTypeRecordsRequestTypedDict, +) +from .list_integrations import ListIntegrationsRequest, ListIntegrationsRequestTypedDict +from .list_pull_operations import ( + ListPullOperationsRequest, + ListPullOperationsRequestTypedDict, +) +from .list_rules import ListRulesRequest, ListRulesRequestTypedDict +from .refresh_company_data import ( + RefreshCompanyDataRequest, + RefreshCompanyDataRequestTypedDict, +) +from .refresh_custom_data_type import ( + RefreshCustomDataTypeRequest, + RefreshCustomDataTypeRequestTypedDict, +) +from .refresh_data_type import RefreshDataTypeRequest, RefreshDataTypeRequestTypedDict +from .remove_product import RemoveProductRequest, RemoveProductRequestTypedDict +from .unlink_connection import UnlinkConnectionRequest, UnlinkConnectionRequestTypedDict +from .update_company import UpdateCompanyRequest, UpdateCompanyRequestTypedDict +from .update_connection_authorization import ( + UpdateConnectionAuthorizationRequest, + UpdateConnectionAuthorizationRequestTypedDict, +) +from .update_profile_syncsettings import ( + UpdateProfileSyncSettingsRequestBody, + UpdateProfileSyncSettingsRequestBodyTypedDict, +) + +__all__ = [ + "AddProductRequest", + "AddProductRequestTypedDict", + "ConfigureCustomDataTypeRequest", + "ConfigureCustomDataTypeRequestTypedDict", + "ConfigureSupplementalDataRequest", + "ConfigureSupplementalDataRequestTypedDict", + "CreateConnectionRequest", + "CreateConnectionRequestBody", + "CreateConnectionRequestBodyTypedDict", + "CreateConnectionRequestTypedDict", + "DataType", + "DeleteAPIKeyRequest", + "DeleteAPIKeyRequestTypedDict", + "DeleteCompanyRequest", + "DeleteCompanyRequestTypedDict", + "DeleteConnectionRequest", + "DeleteConnectionRequestTypedDict", + "DeleteWebhookConsumerRequest", + "DeleteWebhookConsumerRequestTypedDict", + "GetCompanyAccessTokenRequest", + "GetCompanyAccessTokenRequestTypedDict", + "GetCompanyDataStatusRequest", + "GetCompanyDataStatusRequestTypedDict", + "GetCompanyPushHistoryRequest", + "GetCompanyPushHistoryRequestTypedDict", + "GetCompanyRequest", + "GetCompanyRequestTypedDict", + "GetConnectionManagementAccessTokenRequest", + "GetConnectionManagementAccessTokenRequestTypedDict", + "GetConnectionRequest", + "GetConnectionRequestTypedDict", + "GetCreateUpdateModelOptionsByDataTypeRequest", + "GetCreateUpdateModelOptionsByDataTypeRequestTypedDict", + "GetCustomDataTypeConfigurationRequest", + "GetCustomDataTypeConfigurationRequestTypedDict", + "GetIntegrationRequest", + "GetIntegrationRequestTypedDict", + "GetIntegrationsBrandingRequest", + "GetIntegrationsBrandingRequestTypedDict", + "GetPullOperationRequest", + "GetPullOperationRequestTypedDict", + "GetPushOperationRequest", + "GetPushOperationRequestTypedDict", + "GetSupplementalDataConfigurationRequest", + "GetSupplementalDataConfigurationRequestTypedDict", + "GetWebhookRequest", + "GetWebhookRequestTypedDict", + "ListCompaniesRequest", + "ListCompaniesRequestTypedDict", + "ListConnectionsRequest", + "ListConnectionsRequestTypedDict", + "ListCustomDataTypeRecordsRequest", + "ListCustomDataTypeRecordsRequestTypedDict", + "ListIntegrationsRequest", + "ListIntegrationsRequestTypedDict", + "ListPullOperationsRequest", + "ListPullOperationsRequestTypedDict", + "ListRulesRequest", + "ListRulesRequestTypedDict", + "PathParamDataType", + "RefreshCompanyDataRequest", + "RefreshCompanyDataRequestTypedDict", + "RefreshCustomDataTypeRequest", + "RefreshCustomDataTypeRequestTypedDict", + "RefreshDataTypeRequest", + "RefreshDataTypeRequestTypedDict", + "RemoveProductRequest", + "RemoveProductRequestTypedDict", + "UnlinkConnectionRequest", + "UnlinkConnectionRequestTypedDict", + "UpdateCompanyRequest", + "UpdateCompanyRequestTypedDict", + "UpdateConnectionAuthorizationRequest", + "UpdateConnectionAuthorizationRequestTypedDict", + "UpdateProfileSyncSettingsRequestBody", + "UpdateProfileSyncSettingsRequestBodyTypedDict", +] diff --git a/platform/src/codat_platform/models/operations/add_product.py b/platform/src/codat_platform/models/operations/add_product.py new file mode 100644 index 000000000..4b2c37d7b --- /dev/null +++ b/platform/src/codat_platform/models/operations/add_product.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class AddProductRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + product_identifier: str + r"""Human-readable product identifier for a product.""" + + +class AddProductRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + product_identifier: Annotated[ + str, + pydantic.Field(alias="productIdentifier"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Human-readable product identifier for a product.""" diff --git a/platform/src/codat_platform/models/operations/configure_custom_data_type.py b/platform/src/codat_platform/models/operations/configure_custom_data_type.py new file mode 100644 index 000000000..cba75c6a2 --- /dev/null +++ b/platform/src/codat_platform/models/operations/configure_custom_data_type.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.models.shared import ( + customdatatypeconfiguration as shared_customdatatypeconfiguration, +) +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, RequestMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConfigureCustomDataTypeRequestTypedDict(TypedDict): + custom_data_identifier: str + r"""Unique identifier for a custom data type.""" + platform_key: str + r"""A unique 4-letter key to represent a platform in each integration.""" + custom_data_type_configuration: NotRequired[ + shared_customdatatypeconfiguration.CustomDataTypeConfigurationTypedDict + ] + r"""Custom data type configuration for the specified platform.""" + + +class ConfigureCustomDataTypeRequest(BaseModel): + custom_data_identifier: Annotated[ + str, + pydantic.Field(alias="customDataIdentifier"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a custom data type.""" + + platform_key: Annotated[ + str, + pydantic.Field(alias="platformKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""A unique 4-letter key to represent a platform in each integration.""" + + custom_data_type_configuration: Annotated[ + Optional[shared_customdatatypeconfiguration.CustomDataTypeConfiguration], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + r"""Custom data type configuration for the specified platform.""" diff --git a/platform/src/codat_platform/models/operations/configure_supplemental_data.py b/platform/src/codat_platform/models/operations/configure_supplemental_data.py new file mode 100644 index 000000000..adadead13 --- /dev/null +++ b/platform/src/codat_platform/models/operations/configure_supplemental_data.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.models.shared import ( + supplementaldataconfiguration as shared_supplementaldataconfiguration, +) +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataType(str, Enum): + r"""Data types that support supplemental data""" + + CHART_OF_ACCOUNTS = "chartOfAccounts" + BILLS = "bills" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + INVOICES = "invoices" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" + + +class ConfigureSupplementalDataRequestTypedDict(TypedDict): + data_type: DataType + r"""Supported supplemental data data type.""" + platform_key: str + r"""A unique 4-letter key to represent a platform in each integration.""" + supplemental_data_configuration: NotRequired[ + shared_supplementaldataconfiguration.SupplementalDataConfigurationTypedDict + ] + r"""The configuration for the specified platform and data type.""" + + +class ConfigureSupplementalDataRequest(BaseModel): + data_type: Annotated[ + DataType, + pydantic.Field(alias="dataType"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Supported supplemental data data type.""" + + platform_key: Annotated[ + str, + pydantic.Field(alias="platformKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""A unique 4-letter key to represent a platform in each integration.""" + + supplemental_data_configuration: Annotated[ + Optional[shared_supplementaldataconfiguration.SupplementalDataConfiguration], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + r"""The configuration for the specified platform and data type.""" diff --git a/platform/src/codat_platform/models/operations/create_connection.py b/platform/src/codat_platform/models/operations/create_connection.py new file mode 100644 index 000000000..702acb471 --- /dev/null +++ b/platform/src/codat_platform/models/operations/create_connection.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, RequestMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateConnectionRequestBodyTypedDict(TypedDict): + platform_key: NotRequired[str] + 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.""" + + +class CreateConnectionRequestBody(BaseModel): + platform_key: Annotated[Optional[str], pydantic.Field(alias="platformKey")] = None + 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.""" + + +class CreateConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + request_body: NotRequired[CreateConnectionRequestBodyTypedDict] + + +class CreateConnectionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + request_body: Annotated[ + Optional[CreateConnectionRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/platform/src/codat_platform/models/operations/delete_api_key.py b/platform/src/codat_platform/models/operations/delete_api_key.py new file mode 100644 index 000000000..fc971472b --- /dev/null +++ b/platform/src/codat_platform/models/operations/delete_api_key.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteAPIKeyRequestTypedDict(TypedDict): + api_key_id: str + r"""Unique identifier for api key.""" + + +class DeleteAPIKeyRequest(BaseModel): + api_key_id: Annotated[ + str, + pydantic.Field(alias="apiKeyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for api key.""" diff --git a/platform/src/codat_platform/models/operations/delete_company.py b/platform/src/codat_platform/models/operations/delete_company.py new file mode 100644 index 000000000..f523d45fe --- /dev/null +++ b/platform/src/codat_platform/models/operations/delete_company.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class DeleteCompanyRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/platform/src/codat_platform/models/operations/delete_connection.py b/platform/src/codat_platform/models/operations/delete_connection.py new file mode 100644 index 000000000..d3b4a8e46 --- /dev/null +++ b/platform/src/codat_platform/models/operations/delete_connection.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class DeleteConnectionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" diff --git a/platform/src/codat_platform/models/operations/delete_webhook_consumer.py b/platform/src/codat_platform/models/operations/delete_webhook_consumer.py new file mode 100644 index 000000000..c5d6f3ea0 --- /dev/null +++ b/platform/src/codat_platform/models/operations/delete_webhook_consumer.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteWebhookConsumerRequestTypedDict(TypedDict): + webhook_id: str + r"""Unique identifier for the webhook consumer.""" + + +class DeleteWebhookConsumerRequest(BaseModel): + webhook_id: Annotated[ + str, + pydantic.Field(alias="webhookId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for the webhook consumer.""" diff --git a/platform/src/codat_platform/models/operations/get_company.py b/platform/src/codat_platform/models/operations/get_company.py new file mode 100644 index 000000000..7ec274065 --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_company.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetCompanyRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/platform/src/codat_platform/models/operations/get_company_access_token.py b/platform/src/codat_platform/models/operations/get_company_access_token.py new file mode 100644 index 000000000..87b3fde9a --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_company_access_token.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCompanyAccessTokenRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetCompanyAccessTokenRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/platform/src/codat_platform/models/operations/get_company_data_status.py b/platform/src/codat_platform/models/operations/get_company_data_status.py new file mode 100644 index 000000000..70a004263 --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_company_data_status.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCompanyDataStatusRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetCompanyDataStatusRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/platform/src/codat_platform/models/operations/get_company_push_history.py b/platform/src/codat_platform/models/operations/get_company_push_history.py new file mode 100644 index 000000000..ec875c0e8 --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_company_push_history.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetCompanyPushHistoryRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class GetCompanyPushHistoryRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/platform/src/codat_platform/models/operations/get_connection.py b/platform/src/codat_platform/models/operations/get_connection.py new file mode 100644 index 000000000..314a92086 --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_connection.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetConnectionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" diff --git a/platform/src/codat_platform/models/operations/get_connection_management_access_token.py b/platform/src/codat_platform/models/operations/get_connection_management_access_token.py new file mode 100644 index 000000000..01015b32e --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_connection_management_access_token.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetConnectionManagementAccessTokenRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetConnectionManagementAccessTokenRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/platform/src/codat_platform/models/operations/get_create_update_model_options_by_data_type.py b/platform/src/codat_platform/models/operations/get_create_update_model_options_by_data_type.py new file mode 100644 index 000000000..71e09dfff --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_create_update_model_options_by_data_type.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.models.shared import schema_datatype as shared_schema_datatype +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateUpdateModelOptionsByDataTypeRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + data_type: shared_schema_datatype.SchemaDataType + r"""The key of a Codat data type.""" + + +class GetCreateUpdateModelOptionsByDataTypeRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" + + data_type: Annotated[ + shared_schema_datatype.SchemaDataType, + pydantic.Field(alias="dataType"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The key of a Codat data type.""" diff --git a/platform/src/codat_platform/models/operations/get_custom_data_type_configuration.py b/platform/src/codat_platform/models/operations/get_custom_data_type_configuration.py new file mode 100644 index 000000000..8f6d69055 --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_custom_data_type_configuration.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCustomDataTypeConfigurationRequestTypedDict(TypedDict): + custom_data_identifier: str + r"""Unique identifier for a custom data type.""" + platform_key: str + r"""A unique 4-letter key to represent a platform in each integration.""" + + +class GetCustomDataTypeConfigurationRequest(BaseModel): + custom_data_identifier: Annotated[ + str, + pydantic.Field(alias="customDataIdentifier"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a custom data type.""" + + platform_key: Annotated[ + str, + pydantic.Field(alias="platformKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""A unique 4-letter key to represent a platform in each integration.""" diff --git a/platform/src/codat_platform/models/operations/get_integration.py b/platform/src/codat_platform/models/operations/get_integration.py new file mode 100644 index 000000000..de1124bce --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_integration.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetIntegrationRequestTypedDict(TypedDict): + platform_key: str + r"""A unique 4-letter key to represent a platform in each integration.""" + + +class GetIntegrationRequest(BaseModel): + platform_key: Annotated[ + str, + pydantic.Field(alias="platformKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""A unique 4-letter key to represent a platform in each integration.""" diff --git a/platform/src/codat_platform/models/operations/get_integrations_branding.py b/platform/src/codat_platform/models/operations/get_integrations_branding.py new file mode 100644 index 000000000..b67788815 --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_integrations_branding.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetIntegrationsBrandingRequestTypedDict(TypedDict): + platform_key: str + r"""A unique 4-letter key to represent a platform in each integration.""" + + +class GetIntegrationsBrandingRequest(BaseModel): + platform_key: Annotated[ + str, + pydantic.Field(alias="platformKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""A unique 4-letter key to represent a platform in each integration.""" diff --git a/platform/src/codat_platform/models/operations/get_pull_operation.py b/platform/src/codat_platform/models/operations/get_pull_operation.py new file mode 100644 index 000000000..ccf9e170b --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_pull_operation.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetPullOperationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + dataset_id: str + r"""Unique identifier for the dataset that completed its sync.""" + + +class GetPullOperationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + dataset_id: Annotated[ + str, + pydantic.Field(alias="datasetId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for the dataset that completed its sync.""" diff --git a/platform/src/codat_platform/models/operations/get_push_operation.py b/platform/src/codat_platform/models/operations/get_push_operation.py new file mode 100644 index 000000000..2e9c65775 --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_push_operation.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetPushOperationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + push_operation_key: str + r"""Push operation key.""" + + +class GetPushOperationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + push_operation_key: Annotated[ + str, + pydantic.Field(alias="pushOperationKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Push operation key.""" diff --git a/platform/src/codat_platform/models/operations/get_supplemental_data_configuration.py b/platform/src/codat_platform/models/operations/get_supplemental_data_configuration.py new file mode 100644 index 000000000..7b4aaf8f3 --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_supplemental_data_configuration.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +from enum import Enum +import pydantic +from typing_extensions import Annotated, TypedDict + + +class PathParamDataType(str, Enum): + r"""Data types that support supplemental data""" + + CHART_OF_ACCOUNTS = "chartOfAccounts" + BILLS = "bills" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + INVOICES = "invoices" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" + + +class GetSupplementalDataConfigurationRequestTypedDict(TypedDict): + data_type: PathParamDataType + r"""Supported supplemental data data type.""" + platform_key: str + r"""A unique 4-letter key to represent a platform in each integration.""" + + +class GetSupplementalDataConfigurationRequest(BaseModel): + data_type: Annotated[ + PathParamDataType, + pydantic.Field(alias="dataType"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Supported supplemental data data type.""" + + platform_key: Annotated[ + str, + pydantic.Field(alias="platformKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""A unique 4-letter key to represent a platform in each integration.""" diff --git a/platform/src/codat_platform/models/operations/get_webhook.py b/platform/src/codat_platform/models/operations/get_webhook.py new file mode 100644 index 000000000..39b85465c --- /dev/null +++ b/platform/src/codat_platform/models/operations/get_webhook.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetWebhookRequestTypedDict(TypedDict): + rule_id: str + r"""Unique ID of the webhook or rule.""" + + +class GetWebhookRequest(BaseModel): + rule_id: Annotated[ + str, + pydantic.Field(alias="ruleId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique ID of the webhook or rule.""" diff --git a/platform/src/codat_platform/models/operations/list_companies.py b/platform/src/codat_platform/models/operations/list_companies.py new file mode 100644 index 000000000..b5810d09b --- /dev/null +++ b/platform/src/codat_platform/models/operations/list_companies.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListCompaniesRequestTypedDict(TypedDict): + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListCompaniesRequest(BaseModel): + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/platform/src/codat_platform/models/operations/list_connections.py b/platform/src/codat_platform/models/operations/list_connections.py new file mode 100644 index 000000000..46ff17a6b --- /dev/null +++ b/platform/src/codat_platform/models/operations/list_connections.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListConnectionsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListConnectionsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/platform/src/codat_platform/models/operations/list_custom_data_type_records.py b/platform/src/codat_platform/models/operations/list_custom_data_type_records.py new file mode 100644 index 000000000..a7dc7d968 --- /dev/null +++ b/platform/src/codat_platform/models/operations/list_custom_data_type_records.py @@ -0,0 +1,57 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListCustomDataTypeRecordsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + custom_data_identifier: str + r"""Unique identifier for a custom data type.""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + +class ListCustomDataTypeRecordsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" + + custom_data_identifier: Annotated[ + str, + pydantic.Field(alias="customDataIdentifier"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a custom data type.""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" diff --git a/platform/src/codat_platform/models/operations/list_integrations.py b/platform/src/codat_platform/models/operations/list_integrations.py new file mode 100644 index 000000000..ae7d7eef0 --- /dev/null +++ b/platform/src/codat_platform/models/operations/list_integrations.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListIntegrationsRequestTypedDict(TypedDict): + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListIntegrationsRequest(BaseModel): + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/platform/src/codat_platform/models/operations/list_pull_operations.py b/platform/src/codat_platform/models/operations/list_pull_operations.py new file mode 100644 index 000000000..1275575d9 --- /dev/null +++ b/platform/src/codat_platform/models/operations/list_pull_operations.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListPullOperationsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListPullOperationsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/platform/src/codat_platform/models/operations/list_rules.py b/platform/src/codat_platform/models/operations/list_rules.py new file mode 100644 index 000000000..81ecef428 --- /dev/null +++ b/platform/src/codat_platform/models/operations/list_rules.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListRulesRequestTypedDict(TypedDict): + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListRulesRequest(BaseModel): + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/platform/src/codat_platform/models/operations/refresh_company_data.py b/platform/src/codat_platform/models/operations/refresh_company_data.py new file mode 100644 index 000000000..46f6e0a86 --- /dev/null +++ b/platform/src/codat_platform/models/operations/refresh_company_data.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class RefreshCompanyDataRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class RefreshCompanyDataRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/platform/src/codat_platform/models/operations/refresh_custom_data_type.py b/platform/src/codat_platform/models/operations/refresh_custom_data_type.py new file mode 100644 index 000000000..8802da44d --- /dev/null +++ b/platform/src/codat_platform/models/operations/refresh_custom_data_type.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class RefreshCustomDataTypeRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + custom_data_identifier: str + r"""Unique identifier for a custom data type.""" + + +class RefreshCustomDataTypeRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" + + custom_data_identifier: Annotated[ + str, + pydantic.Field(alias="customDataIdentifier"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a custom data type.""" diff --git a/platform/src/codat_platform/models/operations/refresh_data_type.py b/platform/src/codat_platform/models/operations/refresh_data_type.py new file mode 100644 index 000000000..f995c6bff --- /dev/null +++ b/platform/src/codat_platform/models/operations/refresh_data_type.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.models.shared import schema_datatype as shared_schema_datatype +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class RefreshDataTypeRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + data_type: shared_schema_datatype.SchemaDataType + r"""The key of a Codat data type.""" + connection_id: NotRequired[str] + r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" + + +class RefreshDataTypeRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + data_type: Annotated[ + shared_schema_datatype.SchemaDataType, + pydantic.Field(alias="dataType"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The key of a Codat data type.""" + + connection_id: Annotated[ + Optional[str], + pydantic.Field(alias="connectionId"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" diff --git a/platform/src/codat_platform/models/operations/remove_product.py b/platform/src/codat_platform/models/operations/remove_product.py new file mode 100644 index 000000000..46ac60020 --- /dev/null +++ b/platform/src/codat_platform/models/operations/remove_product.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class RemoveProductRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + product_identifier: str + r"""Human-readable product identifier for a product.""" + + +class RemoveProductRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + product_identifier: Annotated[ + str, + pydantic.Field(alias="productIdentifier"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Human-readable product identifier for a product.""" diff --git a/platform/src/codat_platform/models/operations/unlink_connection.py b/platform/src/codat_platform/models/operations/unlink_connection.py new file mode 100644 index 000000000..bdda1242f --- /dev/null +++ b/platform/src/codat_platform/models/operations/unlink_connection.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.models.shared import ( + updateconnectionstatus as shared_updateconnectionstatus, +) +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, RequestMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UnlinkConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + update_connection_status: NotRequired[ + shared_updateconnectionstatus.UpdateConnectionStatusTypedDict + ] + + +class UnlinkConnectionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" + + update_connection_status: Annotated[ + Optional[shared_updateconnectionstatus.UpdateConnectionStatus], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/platform/src/codat_platform/models/operations/update_company.py b/platform/src/codat_platform/models/operations/update_company.py new file mode 100644 index 000000000..ed1d3b38a --- /dev/null +++ b/platform/src/codat_platform/models/operations/update_company.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.models.shared import companyrequestbody as shared_companyrequestbody +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, RequestMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + company_request_body: NotRequired[ + shared_companyrequestbody.CompanyRequestBodyTypedDict + ] + + +class UpdateCompanyRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + company_request_body: Annotated[ + Optional[shared_companyrequestbody.CompanyRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/platform/src/codat_platform/models/operations/update_connection_authorization.py b/platform/src/codat_platform/models/operations/update_connection_authorization.py new file mode 100644 index 000000000..8e5eea60f --- /dev/null +++ b/platform/src/codat_platform/models/operations/update_connection_authorization.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, PathParamMetadata, RequestMetadata +import pydantic +from typing import Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateConnectionAuthorizationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + request_body: NotRequired[Dict[str, str]] + + +class UpdateConnectionAuthorizationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" + + request_body: Annotated[ + Optional[Dict[str, str]], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/platform/src/codat_platform/models/operations/update_profile_syncsettings.py b/platform/src/codat_platform/models/operations/update_profile_syncsettings.py new file mode 100644 index 000000000..ad15c3c3c --- /dev/null +++ b/platform/src/codat_platform/models/operations/update_profile_syncsettings.py @@ -0,0 +1,36 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.models.shared import syncsetting as shared_syncsetting +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateProfileSyncSettingsRequestBodyTypedDict(TypedDict): + r"""Include a `syncSetting` object for each data type. + `syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. + """ + + client_id: str + r"""Unique identifier for your client in Codat.""" + settings: List[shared_syncsetting.SyncSettingTypedDict] + overrides_defaults: NotRequired[bool] + r"""Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings).""" + + +class UpdateProfileSyncSettingsRequestBody(BaseModel): + r"""Include a `syncSetting` object for each data type. + `syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. + """ + + client_id: Annotated[str, pydantic.Field(alias="clientId")] + r"""Unique identifier for your client in Codat.""" + + settings: List[shared_syncsetting.SyncSetting] + + overrides_defaults: Annotated[ + Optional[bool], pydantic.Field(alias="overridesDefaults") + ] = True + r"""Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings).""" diff --git a/platform/src/codat_platform/models/shared/__init__.py b/platform/src/codat_platform/models/shared/__init__.py new file mode 100644 index 000000000..c47744e46 --- /dev/null +++ b/platform/src/codat_platform/models/shared/__init__.py @@ -0,0 +1,405 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .apikeydetails import APIKeyDetails, APIKeyDetailsTypedDict +from .apikeys import APIKeys, APIKeysTypedDict +from .branding import Branding, BrandingTypedDict +from .brandingbutton import BrandingButton, BrandingButtonTypedDict +from .brandingimage import BrandingImage, BrandingImageTypedDict +from .brandinglogo import BrandingLogo, BrandingLogoTypedDict +from .clientratelimitreachedwebhook import ( + ClientRateLimitReachedWebhook, + ClientRateLimitReachedWebhookTypedDict, +) +from .clientratelimitreachedwebhookdata import ( + ClientRateLimitReachedWebhookData, + ClientRateLimitReachedWebhookDataTypedDict, +) +from .clientratelimitresetwebhook import ( + ClientRateLimitResetWebhook, + ClientRateLimitResetWebhookTypedDict, +) +from .clientratelimitresetwebhookdata import ( + ClientRateLimitResetWebhookData, + ClientRateLimitResetWebhookDataTypedDict, +) +from .clientratelimitwebhook import ( + ClientRateLimitWebhook, + ClientRateLimitWebhookTypedDict, +) +from .clientratelimitwebhookpayload import ( + ClientRateLimitWebhookPayload, + ClientRateLimitWebhookPayloadTypedDict, +) +from .companies import Companies, CompaniesTypedDict +from .company import Company, CompanyTypedDict +from .companyaccesstoken import CompanyAccessToken, CompanyAccessTokenTypedDict +from .companydetails import CompanyDetails, CompanyDetailsTypedDict +from .companyreference import ( + CompanyReference, + CompanyReferenceLinks, + CompanyReferenceLinksTypedDict, + CompanyReferenceTypedDict, +) +from .companyrequestbody import CompanyRequestBody, CompanyRequestBodyTypedDict +from .companywebhook import CompanyWebhook, CompanyWebhookTypedDict +from .connection import Connection, ConnectionTypedDict +from .connectionmanagementaccesstoken import ( + ConnectionManagementAccessToken, + ConnectionManagementAccessTokenTypedDict, +) +from .connectionmanagementallowedorigins import ( + ConnectionManagementAllowedOrigins, + ConnectionManagementAllowedOriginsTypedDict, +) +from .connections import Connections, ConnectionsTypedDict +from .connectionstatuschangedwebhook import ( + ConnectionStatusChangedWebhook, + ConnectionStatusChangedWebhookTypedDict, +) +from .connectionstatuschangedwebhookdata import ( + ConnectionStatusChangedWebhookData, + ConnectionStatusChangedWebhookDataTypedDict, +) +from .connectionwebhook import ConnectionWebhook, ConnectionWebhookTypedDict +from .connectionwebhookpayload import ( + ConnectionWebhookPayload, + ConnectionWebhookPayloadTypedDict, +) +from .createapikey import CreateAPIKey, CreateAPIKeyTypedDict +from .createrule import CreateRule, CreateRuleTypedDict +from .customdatatypeconfiguration import ( + CustomDataTypeConfiguration, + CustomDataTypeConfigurationTypedDict, +) +from .customdatatyperecord import ( + Content, + ContentTypedDict, + CustomDataTypeRecord, + CustomDataTypeRecordTypedDict, + ModifiedDate, + ModifiedDateTypedDict, +) +from .customdatatyperecords import CustomDataTypeRecords, CustomDataTypeRecordsTypedDict +from .dataconnectionerror import ( + DataConnectionError, + DataConnectionErrorTypedDict, + ErrorStatus, +) +from .dataconnectionstatus import DataConnectionStatus +from .datasetdatachangedwebhook import ( + DatasetDataChangedWebhook, + DatasetDataChangedWebhookData, + DatasetDataChangedWebhookDataTypedDict, + DatasetDataChangedWebhookTypedDict, +) +from .datasetstatuschangederrorwebhook import ( + DatasetStatusChangedErrorWebhook, + DatasetStatusChangedErrorWebhookTypedDict, +) +from .datasetstatuschangederrorwebhookdata import ( + DatasetStatusChangedErrorWebhookData, + DatasetStatusChangedErrorWebhookDataTypedDict, +) +from .datastatus import DataStatus, DataStatusDataTypes, DataStatusTypedDict +from .datastatuses import DataStatuses, DataStatusesTypedDict +from .datasynccompletedwebhook import ( + DataSyncCompletedWebhook, + DataSyncCompletedWebhookTypedDict, +) +from .datasynccompletedwebhookdata import ( + DataSyncCompletedWebhookData, + DataSyncCompletedWebhookDataTypedDict, +) +from .datatype import DataType +from .datatypefeature import DataTypeFeature, DataTypeFeatureTypedDict +from .datatypewritewebhook import DataTypeWriteWebhook, DataTypeWriteWebhookTypedDict +from .datatypewritewebhookpayload import ( + DataTypeWriteWebhookPayload, + DataTypeWriteWebhookPayloadTypedDict, +) +from .datatypewritewebhookrecord import ( + DataTypeWriteWebhookRecord, + DataTypeWriteWebhookRecordTypedDict, +) +from .errormessage import ErrorMessage, ErrorMessageTypedDict +from .errorvalidation import ErrorValidation, ErrorValidationTypedDict +from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict +from .featurestate import FeatureState +from .featuretype import FeatureType +from .halref import HalRef, HalRefTypedDict +from .imagereference import ImageReference, ImageReferenceTypedDict +from .integration import Integration, IntegrationTypedDict +from .integrations import Integrations, IntegrationsTypedDict +from .links import Links, LinksTypedDict +from .newcompanysynchronizedwebhook import ( + NewCompanySynchronizedWebhook, + NewCompanySynchronizedWebhookTypedDict, +) +from .profile import Profile, ProfileTypedDict +from .pulloperation import DatasetStatus, PullOperation, PullOperationTypedDict +from .pulloperations import PullOperations, PullOperationsTypedDict +from .pushchangetype import PushChangeType +from .pushfieldvalidation import PushFieldValidation, PushFieldValidationTypedDict +from .pushoperation import PushOperation, PushOperationTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationref import PushOperationRef, PushOperationRefTypedDict +from .pushoperations import PushOperations, PushOperationsTypedDict +from .pushoperationstatus import PushOperationStatus +from .pushoperationstatuschangedwebhook import ( + PushOperationStatusChangedWebhook, + PushOperationStatusChangedWebhookTypedDict, +) +from .pushoperationstatuschangedwebhookdata import ( + PushOperationStatusChangedWebhookData, + PushOperationStatusChangedWebhookDataTypedDict, +) +from .pushoperationtimedoutwebhook import ( + PushOperationTimedOutWebhook, + PushOperationTimedOutWebhookTypedDict, +) +from .pushoperationtimedoutwebhookdata import ( + PushOperationTimedOutWebhookData, + PushOperationTimedOutWebhookDataTypedDict, +) +from .pushoption import PushOption, PushOptionTypedDict +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptionproperty import PushOptionProperty, PushOptionPropertyTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from .readcompletedwebhook import ReadCompletedWebhook, ReadCompletedWebhookTypedDict +from .readcompletedwebhookpayload import ( + DataTypes, + DataTypesTypedDict, + ReadCompletedWebhookPayload, + ReadCompletedWebhookPayloadTypedDict, +) +from .schema_datatype import SchemaDataType +from .security import Security, SecurityTypedDict +from .sourcetype import SourceType +from .status import Status +from .supplementaldataconfiguration import ( + SupplementalDataConfiguration, + SupplementalDataConfigurationTypedDict, + SupplementalDataSourceConfiguration, + SupplementalDataSourceConfigurationTypedDict, +) +from .supportedfeature import SupportedFeature, SupportedFeatureTypedDict +from .syncsetting import SyncSetting, SyncSettingTypedDict +from .syncsettings import SyncSettings, SyncSettingsTypedDict +from .updateconnectionstatus import ( + UpdateConnectionStatus, + UpdateConnectionStatusTypedDict, +) +from .validation import Validation, ValidationTypedDict +from .validationitem import ValidationItem, ValidationItemTypedDict +from .webhook import Webhook, WebhookTypedDict +from .webhookconsumer import WebhookConsumer, WebhookConsumerTypedDict +from .webhookconsumerprototype import ( + WebhookConsumerPrototype, + WebhookConsumerPrototypeTypedDict, +) +from .webhookconsumers import WebhookConsumers, WebhookConsumersTypedDict +from .webhooknotifier import WebhookNotifier, WebhookNotifierTypedDict +from .webhooks import Webhooks, WebhooksTypedDict +from .writestatus import WriteStatus +from .writetype import WriteType + +__all__ = [ + "APIKeyDetails", + "APIKeyDetailsTypedDict", + "APIKeys", + "APIKeysTypedDict", + "Branding", + "BrandingButton", + "BrandingButtonTypedDict", + "BrandingImage", + "BrandingImageTypedDict", + "BrandingLogo", + "BrandingLogoTypedDict", + "BrandingTypedDict", + "ClientRateLimitReachedWebhook", + "ClientRateLimitReachedWebhookData", + "ClientRateLimitReachedWebhookDataTypedDict", + "ClientRateLimitReachedWebhookTypedDict", + "ClientRateLimitResetWebhook", + "ClientRateLimitResetWebhookData", + "ClientRateLimitResetWebhookDataTypedDict", + "ClientRateLimitResetWebhookTypedDict", + "ClientRateLimitWebhook", + "ClientRateLimitWebhookPayload", + "ClientRateLimitWebhookPayloadTypedDict", + "ClientRateLimitWebhookTypedDict", + "Companies", + "CompaniesTypedDict", + "Company", + "CompanyAccessToken", + "CompanyAccessTokenTypedDict", + "CompanyDetails", + "CompanyDetailsTypedDict", + "CompanyReference", + "CompanyReferenceLinks", + "CompanyReferenceLinksTypedDict", + "CompanyReferenceTypedDict", + "CompanyRequestBody", + "CompanyRequestBodyTypedDict", + "CompanyTypedDict", + "CompanyWebhook", + "CompanyWebhookTypedDict", + "Connection", + "ConnectionManagementAccessToken", + "ConnectionManagementAccessTokenTypedDict", + "ConnectionManagementAllowedOrigins", + "ConnectionManagementAllowedOriginsTypedDict", + "ConnectionStatusChangedWebhook", + "ConnectionStatusChangedWebhookData", + "ConnectionStatusChangedWebhookDataTypedDict", + "ConnectionStatusChangedWebhookTypedDict", + "ConnectionTypedDict", + "ConnectionWebhook", + "ConnectionWebhookPayload", + "ConnectionWebhookPayloadTypedDict", + "ConnectionWebhookTypedDict", + "Connections", + "ConnectionsTypedDict", + "Content", + "ContentTypedDict", + "CreateAPIKey", + "CreateAPIKeyTypedDict", + "CreateRule", + "CreateRuleTypedDict", + "CustomDataTypeConfiguration", + "CustomDataTypeConfigurationTypedDict", + "CustomDataTypeRecord", + "CustomDataTypeRecordTypedDict", + "CustomDataTypeRecords", + "CustomDataTypeRecordsTypedDict", + "DataConnectionError", + "DataConnectionErrorTypedDict", + "DataConnectionStatus", + "DataStatus", + "DataStatusDataTypes", + "DataStatusTypedDict", + "DataStatuses", + "DataStatusesTypedDict", + "DataSyncCompletedWebhook", + "DataSyncCompletedWebhookData", + "DataSyncCompletedWebhookDataTypedDict", + "DataSyncCompletedWebhookTypedDict", + "DataType", + "DataTypeFeature", + "DataTypeFeatureTypedDict", + "DataTypeWriteWebhook", + "DataTypeWriteWebhookPayload", + "DataTypeWriteWebhookPayloadTypedDict", + "DataTypeWriteWebhookRecord", + "DataTypeWriteWebhookRecordTypedDict", + "DataTypeWriteWebhookTypedDict", + "DataTypes", + "DataTypesTypedDict", + "DatasetDataChangedWebhook", + "DatasetDataChangedWebhookData", + "DatasetDataChangedWebhookDataTypedDict", + "DatasetDataChangedWebhookTypedDict", + "DatasetStatus", + "DatasetStatusChangedErrorWebhook", + "DatasetStatusChangedErrorWebhookData", + "DatasetStatusChangedErrorWebhookDataTypedDict", + "DatasetStatusChangedErrorWebhookTypedDict", + "ErrorMessage", + "ErrorMessageTypedDict", + "ErrorStatus", + "ErrorValidation", + "ErrorValidationItem", + "ErrorValidationItemTypedDict", + "ErrorValidationTypedDict", + "FeatureState", + "FeatureType", + "HalRef", + "HalRefTypedDict", + "ImageReference", + "ImageReferenceTypedDict", + "Integration", + "IntegrationTypedDict", + "Integrations", + "IntegrationsTypedDict", + "Links", + "LinksTypedDict", + "ModifiedDate", + "ModifiedDateTypedDict", + "NewCompanySynchronizedWebhook", + "NewCompanySynchronizedWebhookTypedDict", + "Profile", + "ProfileTypedDict", + "PullOperation", + "PullOperationTypedDict", + "PullOperations", + "PullOperationsTypedDict", + "PushChangeType", + "PushFieldValidation", + "PushFieldValidationTypedDict", + "PushOperation", + "PushOperationChange", + "PushOperationChangeTypedDict", + "PushOperationRef", + "PushOperationRefTypedDict", + "PushOperationStatus", + "PushOperationStatusChangedWebhook", + "PushOperationStatusChangedWebhookData", + "PushOperationStatusChangedWebhookDataTypedDict", + "PushOperationStatusChangedWebhookTypedDict", + "PushOperationTimedOutWebhook", + "PushOperationTimedOutWebhookData", + "PushOperationTimedOutWebhookDataTypedDict", + "PushOperationTimedOutWebhookTypedDict", + "PushOperationTypedDict", + "PushOperations", + "PushOperationsTypedDict", + "PushOption", + "PushOptionChoice", + "PushOptionChoiceTypedDict", + "PushOptionProperty", + "PushOptionPropertyTypedDict", + "PushOptionType", + "PushOptionTypedDict", + "PushValidationInfo", + "PushValidationInfoTypedDict", + "ReadCompletedWebhook", + "ReadCompletedWebhookPayload", + "ReadCompletedWebhookPayloadTypedDict", + "ReadCompletedWebhookTypedDict", + "SchemaDataType", + "Security", + "SecurityTypedDict", + "SourceType", + "Status", + "SupplementalDataConfiguration", + "SupplementalDataConfigurationTypedDict", + "SupplementalDataSourceConfiguration", + "SupplementalDataSourceConfigurationTypedDict", + "SupportedFeature", + "SupportedFeatureTypedDict", + "SyncSetting", + "SyncSettingTypedDict", + "SyncSettings", + "SyncSettingsTypedDict", + "UpdateConnectionStatus", + "UpdateConnectionStatusTypedDict", + "Validation", + "ValidationItem", + "ValidationItemTypedDict", + "ValidationTypedDict", + "Webhook", + "WebhookConsumer", + "WebhookConsumerPrototype", + "WebhookConsumerPrototypeTypedDict", + "WebhookConsumerTypedDict", + "WebhookConsumers", + "WebhookConsumersTypedDict", + "WebhookNotifier", + "WebhookNotifierTypedDict", + "WebhookTypedDict", + "Webhooks", + "WebhooksTypedDict", + "WriteStatus", + "WriteType", +] diff --git a/platform/src/codat_platform/models/shared/apikeydetails.py b/platform/src/codat_platform/models/shared/apikeydetails.py new file mode 100644 index 000000000..f996cf780 --- /dev/null +++ b/platform/src/codat_platform/models/shared/apikeydetails.py @@ -0,0 +1,111 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class APIKeyDetailsTypedDict(TypedDict): + r"""Details of the API key.""" + + api_key: NotRequired[str] + r"""The API key value used to make authenticated http requests.""" + created_date: NotRequired[str] + 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: + + ``` + 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. + """ + id: NotRequired[str] + r"""Unique identifier for the API key.""" + name: NotRequired[Nullable[str]] + r"""A meaningful name assigned to the API key.""" + + +class APIKeyDetails(BaseModel): + r"""Details of the API key.""" + + api_key: Annotated[Optional[str], pydantic.Field(alias="apiKey")] = None + r"""The API key value used to make authenticated http requests.""" + + created_date: Annotated[Optional[str], pydantic.Field(alias="createdDate")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + id: Optional[str] = None + r"""Unique identifier for the API key.""" + + name: OptionalNullable[str] = UNSET + r"""A meaningful name assigned to the API key.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["apiKey", "createdDate", "id", "name"] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/apikeys.py b/platform/src/codat_platform/models/shared/apikeys.py new file mode 100644 index 000000000..51f916850 --- /dev/null +++ b/platform/src/codat_platform/models/shared/apikeys.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .apikeydetails import APIKeyDetails, APIKeyDetailsTypedDict +from codat_platform.types import BaseModel +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class APIKeysTypedDict(TypedDict): + results: NotRequired[List[APIKeyDetailsTypedDict]] + + +class APIKeys(BaseModel): + results: Optional[List[APIKeyDetails]] = None diff --git a/platform/src/codat_platform/models/shared/branding.py b/platform/src/codat_platform/models/shared/branding.py new file mode 100644 index 000000000..9152b3b96 --- /dev/null +++ b/platform/src/codat_platform/models/shared/branding.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .brandingbutton import BrandingButton, BrandingButtonTypedDict +from .brandinglogo import BrandingLogo, BrandingLogoTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BrandingTypedDict(TypedDict): + button: NotRequired[BrandingButtonTypedDict] + r"""Button branding references.""" + logo: NotRequired[BrandingLogoTypedDict] + r"""Logo branding references.""" + source_id: NotRequired[str] + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + + +class Branding(BaseModel): + button: Optional[BrandingButton] = None + r"""Button branding references.""" + + logo: Optional[BrandingLogo] = None + r"""Logo branding references.""" + + source_id: Annotated[Optional[str], pydantic.Field(alias="sourceId")] = None + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" diff --git a/platform/src/codat_platform/models/shared/brandingbutton.py b/platform/src/codat_platform/models/shared/brandingbutton.py new file mode 100644 index 000000000..23d578056 --- /dev/null +++ b/platform/src/codat_platform/models/shared/brandingbutton.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .brandingimage import BrandingImage, BrandingImageTypedDict +from codat_platform.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class BrandingButtonTypedDict(TypedDict): + r"""Button branding references.""" + + default: NotRequired[BrandingImageTypedDict] + hover: NotRequired[BrandingImageTypedDict] + + +class BrandingButton(BaseModel): + r"""Button branding references.""" + + default: Optional[BrandingImage] = None + + hover: Optional[BrandingImage] = None diff --git a/platform/src/codat_platform/models/shared/brandingimage.py b/platform/src/codat_platform/models/shared/brandingimage.py new file mode 100644 index 000000000..d6f1c313b --- /dev/null +++ b/platform/src/codat_platform/models/shared/brandingimage.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .imagereference import ImageReference, ImageReferenceTypedDict +from codat_platform.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class BrandingImageTypedDict(TypedDict): + image: NotRequired[ImageReferenceTypedDict] + r"""Image reference.""" + + +class BrandingImage(BaseModel): + image: Optional[ImageReference] = None + r"""Image reference.""" diff --git a/platform/src/codat_platform/models/shared/brandinglogo.py b/platform/src/codat_platform/models/shared/brandinglogo.py new file mode 100644 index 000000000..d619a5183 --- /dev/null +++ b/platform/src/codat_platform/models/shared/brandinglogo.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .brandingimage import BrandingImage, BrandingImageTypedDict +from codat_platform.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class BrandingLogoTypedDict(TypedDict): + r"""Logo branding references.""" + + full: NotRequired[BrandingImageTypedDict] + square: NotRequired[BrandingImageTypedDict] + + +class BrandingLogo(BaseModel): + r"""Logo branding references.""" + + full: Optional[BrandingImage] = None + + square: Optional[BrandingImage] = None diff --git a/platform/src/codat_platform/models/shared/clientratelimitreachedwebhook.py b/platform/src/codat_platform/models/shared/clientratelimitreachedwebhook.py new file mode 100644 index 000000000..750661c26 --- /dev/null +++ b/platform/src/codat_platform/models/shared/clientratelimitreachedwebhook.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitreachedwebhookdata import ( + ClientRateLimitReachedWebhookData, + ClientRateLimitReachedWebhookDataTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitReachedWebhookTypedDict(TypedDict): + r"""Webhook request body for a client that has reached their rate limit.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + data: NotRequired[ClientRateLimitReachedWebhookDataTypedDict] + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class ClientRateLimitReachedWebhook(BaseModel): + r"""Webhook request body for a client that has reached their rate limit.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + data: Annotated[ + Optional[ClientRateLimitReachedWebhookData], pydantic.Field(alias="Data") + ] = None + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/clientratelimitreachedwebhookdata.py b/platform/src/codat_platform/models/shared/clientratelimitreachedwebhookdata.py new file mode 100644 index 000000000..71d548f64 --- /dev/null +++ b/platform/src/codat_platform/models/shared/clientratelimitreachedwebhookdata.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitReachedWebhookDataTypedDict(TypedDict): + daily_quota: NotRequired[int] + r"""The number of available requests per day.""" + expires_utc: NotRequired[str] + 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: + + ``` + 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. + """ + + +class ClientRateLimitReachedWebhookData(BaseModel): + daily_quota: Annotated[Optional[int], pydantic.Field(alias="DailyQuota")] = None + r"""The number of available requests per day.""" + + expires_utc: Annotated[Optional[str], pydantic.Field(alias="ExpiresUtc")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ diff --git a/platform/src/codat_platform/models/shared/clientratelimitresetwebhook.py b/platform/src/codat_platform/models/shared/clientratelimitresetwebhook.py new file mode 100644 index 000000000..c2f173eff --- /dev/null +++ b/platform/src/codat_platform/models/shared/clientratelimitresetwebhook.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitresetwebhookdata import ( + ClientRateLimitResetWebhookData, + ClientRateLimitResetWebhookDataTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitResetWebhookTypedDict(TypedDict): + r"""Webhook request body for a client that has had their rate limit reset.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + data: NotRequired[ClientRateLimitResetWebhookDataTypedDict] + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class ClientRateLimitResetWebhook(BaseModel): + r"""Webhook request body for a client that has had their rate limit reset.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + data: Annotated[ + Optional[ClientRateLimitResetWebhookData], pydantic.Field(alias="Data") + ] = None + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/clientratelimitresetwebhookdata.py b/platform/src/codat_platform/models/shared/clientratelimitresetwebhookdata.py new file mode 100644 index 000000000..a485a15ef --- /dev/null +++ b/platform/src/codat_platform/models/shared/clientratelimitresetwebhookdata.py @@ -0,0 +1,109 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitResetWebhookDataTypedDict(TypedDict): + daily_quota: NotRequired[int] + r"""The number of available requests per day.""" + expires_utc: NotRequired[str] + 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: + + ``` + 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. + """ + quota_remaining: NotRequired[Nullable[int]] + r"""Total number of requests remaining for your client.""" + reset_reason: NotRequired[str] + r"""The reason for your rate limit quota being reset.""" + + +class ClientRateLimitResetWebhookData(BaseModel): + daily_quota: Annotated[Optional[int], pydantic.Field(alias="DailyQuota")] = None + r"""The number of available requests per day.""" + + expires_utc: Annotated[Optional[str], pydantic.Field(alias="ExpiresUtc")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + quota_remaining: Annotated[ + OptionalNullable[int], pydantic.Field(alias="QuotaRemaining") + ] = UNSET + r"""Total number of requests remaining for your client.""" + + reset_reason: Annotated[Optional[str], pydantic.Field(alias="ResetReason")] = None + r"""The reason for your rate limit quota being reset.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["DailyQuota", "ExpiresUtc", "QuotaRemaining", "ResetReason"] + nullable_fields = ["QuotaRemaining"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/clientratelimitwebhook.py b/platform/src/codat_platform/models/shared/clientratelimitwebhook.py new file mode 100644 index 000000000..56460f52a --- /dev/null +++ b/platform/src/codat_platform/models/shared/clientratelimitwebhook.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitwebhookpayload import ( + ClientRateLimitWebhookPayload, + ClientRateLimitWebhookPayloadTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitWebhookTypedDict(TypedDict): + event_type: NotRequired[str] + r"""The type of event.""" + generated_date: NotRequired[str] + 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: + + ``` + 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. + """ + id: NotRequired[str] + r"""Unique identifier of the event.""" + payload: NotRequired[ClientRateLimitWebhookPayloadTypedDict] + + +class ClientRateLimitWebhook(BaseModel): + event_type: Annotated[Optional[str], pydantic.Field(alias="eventType")] = None + r"""The type of event.""" + + generated_date: Annotated[Optional[str], pydantic.Field(alias="generatedDate")] = ( + None + ) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + id: Optional[str] = None + r"""Unique identifier of the event.""" + + payload: Optional[ClientRateLimitWebhookPayload] = None diff --git a/platform/src/codat_platform/models/shared/clientratelimitwebhookpayload.py b/platform/src/codat_platform/models/shared/clientratelimitwebhookpayload.py new file mode 100644 index 000000000..e5e3f1953 --- /dev/null +++ b/platform/src/codat_platform/models/shared/clientratelimitwebhookpayload.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitWebhookPayloadTypedDict(TypedDict): + daily_quota: NotRequired[int] + r"""The number of available requests per day.""" + expiry_date: NotRequired[str] + 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: + + ``` + 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. + """ + quota_remaining: NotRequired[int] + r"""Total number of requests remaining for your client.""" + + +class ClientRateLimitWebhookPayload(BaseModel): + daily_quota: Annotated[Optional[int], pydantic.Field(alias="dailyQuota")] = None + r"""The number of available requests per day.""" + + expiry_date: Annotated[Optional[str], pydantic.Field(alias="expiryDate")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + quota_remaining: Annotated[ + Optional[int], pydantic.Field(alias="quotaRemaining") + ] = None + r"""Total number of requests remaining for your client.""" diff --git a/platform/src/codat_platform/models/shared/companies.py b/platform/src/codat_platform/models/shared/companies.py new file mode 100644 index 000000000..627f50a86 --- /dev/null +++ b/platform/src/codat_platform/models/shared/companies.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .company import Company, CompanyTypedDict +from .links import Links, LinksTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompaniesTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[CompanyTypedDict]] + + +class Companies(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Company]] = None diff --git a/platform/src/codat_platform/models/shared/company.py b/platform/src/codat_platform/models/shared/company.py new file mode 100644 index 000000000..abea3cb37 --- /dev/null +++ b/platform/src/codat_platform/models/shared/company.py @@ -0,0 +1,216 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .companyreference import CompanyReference, CompanyReferenceTypedDict +from .connection import Connection, ConnectionTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompanyTypedDict(TypedDict): + r"""In Codat, a 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](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + + Typically each company is one of your customers. + + When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + """ + + id: str + r"""Unique identifier for your SMB in Codat.""" + name: str + r"""The name of the company""" + redirect: str + r"""The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.""" + created: NotRequired[str] + 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: + + ``` + 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. + """ + created_by_user_name: NotRequired[Nullable[str]] + r"""Name of user that created the company in Codat.""" + data_connections: NotRequired[List[ConnectionTypedDict]] + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + last_sync: NotRequired[str] + 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: + + ``` + 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. + """ + products: NotRequired[List[str]] + r"""An array of products that are currently enabled for the company.""" + reference_parent_company: NotRequired[CompanyReferenceTypedDict] + reference_subsidiary_companies: NotRequired[List[CompanyReferenceTypedDict]] + r"""A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.""" + tags: NotRequired[Dict[str, str]] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class Company(BaseModel): + r"""In Codat, a 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](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + + Typically each company is one of your customers. + + When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + """ + + id: str + r"""Unique identifier for your SMB in Codat.""" + + name: str + r"""The name of the company""" + + redirect: str + r"""The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.""" + + created: Optional[str] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + created_by_user_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="createdByUserName") + ] = UNSET + r"""Name of user that created the company in Codat.""" + + data_connections: Annotated[ + Optional[List[Connection]], pydantic.Field(alias="dataConnections") + ] = None + + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + last_sync: Annotated[Optional[str], pydantic.Field(alias="lastSync")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + products: Optional[List[str]] = None + r"""An array of products that are currently enabled for the company.""" + + reference_parent_company: Annotated[ + Optional[CompanyReference], pydantic.Field(alias="referenceParentCompany") + ] = None + + reference_subsidiary_companies: Annotated[ + Optional[List[CompanyReference]], + pydantic.Field(alias="referenceSubsidiaryCompanies"), + ] = None + r"""A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.""" + + tags: Optional[Dict[str, str]] = None + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "created", + "createdByUserName", + "dataConnections", + "description", + "lastSync", + "products", + "referenceParentCompany", + "referenceSubsidiaryCompanies", + "tags", + ] + nullable_fields = ["createdByUserName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/companyaccesstoken.py b/platform/src/codat_platform/models/shared/companyaccesstoken.py new file mode 100644 index 000000000..1fb483a19 --- /dev/null +++ b/platform/src/codat_platform/models/shared/companyaccesstoken.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class CompanyAccessTokenTypedDict(TypedDict): + r"""Details of the access token provisioned for a company.""" + + access_token: str + r"""The access token for the company.""" + expires_in: int + r"""The number of seconds until the access token expires.""" + token_type: str + r"""The type of token.""" + + +class CompanyAccessToken(BaseModel): + r"""Details of the access token provisioned for a company.""" + + access_token: Annotated[str, pydantic.Field(alias="accessToken")] + r"""The access token for the company.""" + + expires_in: Annotated[int, pydantic.Field(alias="expiresIn")] + r"""The number of seconds until the access token expires.""" + + token_type: Annotated[str, pydantic.Field(alias="tokenType")] + r"""The type of token.""" diff --git a/platform/src/codat_platform/models/shared/companydetails.py b/platform/src/codat_platform/models/shared/companydetails.py new file mode 100644 index 000000000..3f1a992ca --- /dev/null +++ b/platform/src/codat_platform/models/shared/companydetails.py @@ -0,0 +1,195 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .companyreference import CompanyReference, CompanyReferenceTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompanyDetailsTypedDict(TypedDict): + id: str + r"""Unique identifier for your SMB in Codat.""" + name: str + r"""The name of the company""" + redirect: str + r"""The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.""" + created: NotRequired[str] + 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: + + ``` + 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. + """ + created_by_user_name: NotRequired[Nullable[str]] + r"""Name of user that created the company in Codat.""" + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + last_sync: NotRequired[str] + 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: + + ``` + 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. + """ + products: NotRequired[List[str]] + r"""An array of products that are currently enabled for the company.""" + reference_parent_company: NotRequired[CompanyReferenceTypedDict] + reference_subsidiary_companies: NotRequired[List[CompanyReferenceTypedDict]] + r"""A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.""" + tags: NotRequired[Dict[str, str]] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class CompanyDetails(BaseModel): + id: str + r"""Unique identifier for your SMB in Codat.""" + + name: str + r"""The name of the company""" + + redirect: str + r"""The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.""" + + created: Optional[str] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + created_by_user_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="createdByUserName") + ] = UNSET + r"""Name of user that created the company in Codat.""" + + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + last_sync: Annotated[Optional[str], pydantic.Field(alias="lastSync")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + products: Optional[List[str]] = None + r"""An array of products that are currently enabled for the company.""" + + reference_parent_company: Annotated[ + Optional[CompanyReference], pydantic.Field(alias="referenceParentCompany") + ] = None + + reference_subsidiary_companies: Annotated[ + Optional[List[CompanyReference]], + pydantic.Field(alias="referenceSubsidiaryCompanies"), + ] = None + r"""A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.""" + + tags: Optional[Dict[str, str]] = None + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "created", + "createdByUserName", + "description", + "lastSync", + "products", + "referenceParentCompany", + "referenceSubsidiaryCompanies", + "tags", + ] + nullable_fields = ["createdByUserName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/companyreference.py b/platform/src/codat_platform/models/shared/companyreference.py new file mode 100644 index 000000000..e4d33c32c --- /dev/null +++ b/platform/src/codat_platform/models/shared/companyreference.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class CompanyReferenceLinksTypedDict(TypedDict): + r"""A collection of links for the company.""" + + portal: NotRequired[str] + r"""Link to the company page in the portal.""" + + +class CompanyReferenceLinks(BaseModel): + r"""A collection of links for the company.""" + + portal: Optional[str] = None + r"""Link to the company page in the portal.""" + + +class CompanyReferenceTypedDict(TypedDict): + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + links: NotRequired[CompanyReferenceLinksTypedDict] + r"""A collection of links for the company.""" + name: NotRequired[str] + r"""The name of the company""" + tags: NotRequired[Dict[str, str]] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class CompanyReference(BaseModel): + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + id: Optional[str] = None + r"""Unique identifier for your SMB in Codat.""" + + links: Optional[CompanyReferenceLinks] = None + r"""A collection of links for the company.""" + + name: Optional[str] = None + r"""The name of the company""" + + tags: Optional[Dict[str, str]] = None + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" diff --git a/platform/src/codat_platform/models/shared/companyrequestbody.py b/platform/src/codat_platform/models/shared/companyrequestbody.py new file mode 100644 index 000000000..0c912609b --- /dev/null +++ b/platform/src/codat_platform/models/shared/companyrequestbody.py @@ -0,0 +1,26 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from typing import Dict, Optional +from typing_extensions import NotRequired, TypedDict + + +class CompanyRequestBodyTypedDict(TypedDict): + name: str + r"""Name of company being connected.""" + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + tags: NotRequired[Dict[str, str]] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class CompanyRequestBody(BaseModel): + name: str + r"""Name of company being connected.""" + + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + tags: Optional[Dict[str, str]] = None + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" diff --git a/platform/src/codat_platform/models/shared/companywebhook.py b/platform/src/codat_platform/models/shared/companywebhook.py new file mode 100644 index 000000000..365d30b7f --- /dev/null +++ b/platform/src/codat_platform/models/shared/companywebhook.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .companydetails import CompanyDetails, CompanyDetailsTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompanyWebhookTypedDict(TypedDict): + event_type: NotRequired[str] + r"""The type of event.""" + generated_date: NotRequired[str] + 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: + + ``` + 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. + """ + id: NotRequired[str] + r"""Unique identifier of the event""" + payload: NotRequired[CompanyDetailsTypedDict] + + +class CompanyWebhook(BaseModel): + event_type: Annotated[Optional[str], pydantic.Field(alias="eventType")] = None + r"""The type of event.""" + + generated_date: Annotated[Optional[str], pydantic.Field(alias="generatedDate")] = ( + None + ) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + id: Optional[str] = None + r"""Unique identifier of the event""" + + payload: Optional[CompanyDetails] = None diff --git a/platform/src/codat_platform/models/shared/connection.py b/platform/src/codat_platform/models/shared/connection.py new file mode 100644 index 000000000..f105c5428 --- /dev/null +++ b/platform/src/codat_platform/models/shared/connection.py @@ -0,0 +1,213 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .dataconnectionerror import DataConnectionError, DataConnectionErrorTypedDict +from .dataconnectionstatus import DataConnectionStatus +from .sourcetype import SourceType +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionTypedDict(TypedDict): + r"""A connection represents a [company's](https://docs.codat.io/platform-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + + A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + + - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + Any combination of accounting, banking, and commerce data connections is allowed. + + Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + """ + + created: str + 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: + + ``` + 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. + """ + id: str + r"""Unique identifier for a company's data connection.""" + integration_id: str + r"""A Codat ID representing the integration.""" + integration_key: str + r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" + link_url: str + r"""The link URL your customers can use to authorize access to their business application.""" + platform_name: str + r"""Name of integration connected to company.""" + source_id: str + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + source_type: SourceType + r"""The type of platform of the connection.""" + status: DataConnectionStatus + r"""The current authorization status of the data connection.""" + connection_info: NotRequired[Nullable[Dict[str, str]]] + data_connection_errors: NotRequired[Nullable[List[DataConnectionErrorTypedDict]]] + last_sync: NotRequired[str] + 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: + + ``` + 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. + """ + + +class Connection(BaseModel): + r"""A connection represents a [company's](https://docs.codat.io/platform-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + + A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + + - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + Any combination of accounting, banking, and commerce data connections is allowed. + + Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + """ + + created: str + 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: + + ``` + 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. + """ + + id: str + r"""Unique identifier for a company's data connection.""" + + integration_id: Annotated[str, pydantic.Field(alias="integrationId")] + r"""A Codat ID representing the integration.""" + + integration_key: Annotated[str, pydantic.Field(alias="integrationKey")] + r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" + + link_url: Annotated[str, pydantic.Field(alias="linkUrl")] + r"""The link URL your customers can use to authorize access to their business application.""" + + platform_name: Annotated[str, pydantic.Field(alias="platformName")] + r"""Name of integration connected to company.""" + + source_id: Annotated[str, pydantic.Field(alias="sourceId")] + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + + source_type: Annotated[SourceType, pydantic.Field(alias="sourceType")] + r"""The type of platform of the connection.""" + + status: DataConnectionStatus + r"""The current authorization status of the data connection.""" + + connection_info: Annotated[ + OptionalNullable[Dict[str, str]], pydantic.Field(alias="connectionInfo") + ] = UNSET + + data_connection_errors: Annotated[ + OptionalNullable[List[DataConnectionError]], + pydantic.Field(alias="dataConnectionErrors"), + ] = UNSET + + last_sync: Annotated[Optional[str], pydantic.Field(alias="lastSync")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["connectionInfo", "dataConnectionErrors", "lastSync"] + nullable_fields = ["connectionInfo", "dataConnectionErrors"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/connectionmanagementaccesstoken.py b/platform/src/codat_platform/models/shared/connectionmanagementaccesstoken.py new file mode 100644 index 000000000..5d3844551 --- /dev/null +++ b/platform/src/codat_platform/models/shared/connectionmanagementaccesstoken.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionManagementAccessTokenTypedDict(TypedDict): + access_token: NotRequired[str] + r"""Access token that allows SMBs to manage connections that have access to their data.""" + + +class ConnectionManagementAccessToken(BaseModel): + access_token: Annotated[Optional[str], pydantic.Field(alias="accessToken")] = None + r"""Access token that allows SMBs to manage connections that have access to their data.""" diff --git a/platform/src/codat_platform/models/shared/connectionmanagementallowedorigins.py b/platform/src/codat_platform/models/shared/connectionmanagementallowedorigins.py new file mode 100644 index 000000000..0467d781e --- /dev/null +++ b/platform/src/codat_platform/models/shared/connectionmanagementallowedorigins.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionManagementAllowedOriginsTypedDict(TypedDict): + r"""Success""" + + allowed_origins: NotRequired[List[str]] + r"""An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).""" + + +class ConnectionManagementAllowedOrigins(BaseModel): + r"""Success""" + + allowed_origins: Annotated[ + Optional[List[str]], pydantic.Field(alias="allowedOrigins") + ] = None + r"""An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).""" diff --git a/platform/src/codat_platform/models/shared/connections.py b/platform/src/codat_platform/models/shared/connections.py new file mode 100644 index 000000000..4b45f76b1 --- /dev/null +++ b/platform/src/codat_platform/models/shared/connections.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .connection import Connection, ConnectionTypedDict +from .links import Links, LinksTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[ConnectionTypedDict]] + + +class Connections(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Connection]] = None diff --git a/platform/src/codat_platform/models/shared/connectionstatuschangedwebhook.py b/platform/src/codat_platform/models/shared/connectionstatuschangedwebhook.py new file mode 100644 index 000000000..d09329f41 --- /dev/null +++ b/platform/src/codat_platform/models/shared/connectionstatuschangedwebhook.py @@ -0,0 +1,73 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .connectionstatuschangedwebhookdata import ( + ConnectionStatusChangedWebhookData, + ConnectionStatusChangedWebhookDataTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionStatusChangedWebhookTypedDict(TypedDict): + r"""Webhook request body for a company's data connection status changed.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data: NotRequired[ConnectionStatusChangedWebhookDataTypedDict] + data_connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class ConnectionStatusChangedWebhook(BaseModel): + r"""Webhook request body for a company's data connection status changed.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data: Annotated[ + Optional[ConnectionStatusChangedWebhookData], pydantic.Field(alias="Data") + ] = None + + data_connection_id: Annotated[ + Optional[str], pydantic.Field(alias="DataConnectionId") + ] = None + r"""Unique identifier for a company's data connection.""" + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/connectionstatuschangedwebhookdata.py b/platform/src/codat_platform/models/shared/connectionstatuschangedwebhookdata.py new file mode 100644 index 000000000..4f2b0836c --- /dev/null +++ b/platform/src/codat_platform/models/shared/connectionstatuschangedwebhookdata.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .dataconnectionstatus import DataConnectionStatus +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionStatusChangedWebhookDataTypedDict(TypedDict): + data_connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + new_status: NotRequired[DataConnectionStatus] + r"""The current authorization status of the data connection.""" + old_status: NotRequired[DataConnectionStatus] + r"""The current authorization status of the data connection.""" + platform_key: NotRequired[str] + 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.""" + + +class ConnectionStatusChangedWebhookData(BaseModel): + data_connection_id: Annotated[ + Optional[str], pydantic.Field(alias="dataConnectionId") + ] = None + r"""Unique identifier for a company's data connection.""" + + new_status: Annotated[ + Optional[DataConnectionStatus], pydantic.Field(alias="newStatus") + ] = None + r"""The current authorization status of the data connection.""" + + old_status: Annotated[ + Optional[DataConnectionStatus], pydantic.Field(alias="oldStatus") + ] = None + r"""The current authorization status of the data connection.""" + + platform_key: Annotated[Optional[str], pydantic.Field(alias="platformKey")] = None + 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.""" diff --git a/platform/src/codat_platform/models/shared/connectionwebhook.py b/platform/src/codat_platform/models/shared/connectionwebhook.py new file mode 100644 index 000000000..5dd9a94d4 --- /dev/null +++ b/platform/src/codat_platform/models/shared/connectionwebhook.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .connectionwebhookpayload import ( + ConnectionWebhookPayload, + ConnectionWebhookPayloadTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionWebhookTypedDict(TypedDict): + event_type: NotRequired[str] + r"""The type of event.""" + generated_date: NotRequired[str] + 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: + + ``` + 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. + """ + id: NotRequired[str] + r"""Unique identifier of the event.""" + payload: NotRequired[ConnectionWebhookPayloadTypedDict] + + +class ConnectionWebhook(BaseModel): + event_type: Annotated[Optional[str], pydantic.Field(alias="eventType")] = None + r"""The type of event.""" + + generated_date: Annotated[Optional[str], pydantic.Field(alias="generatedDate")] = ( + None + ) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + id: Optional[str] = None + r"""Unique identifier of the event.""" + + payload: Optional[ConnectionWebhookPayload] = None diff --git a/platform/src/codat_platform/models/shared/connectionwebhookpayload.py b/platform/src/codat_platform/models/shared/connectionwebhookpayload.py new file mode 100644 index 000000000..e8e78f5d2 --- /dev/null +++ b/platform/src/codat_platform/models/shared/connectionwebhookpayload.py @@ -0,0 +1,44 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .companyreference import CompanyReference, CompanyReferenceTypedDict +from .connection import Connection, ConnectionTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionWebhookPayloadTypedDict(TypedDict): + connection: NotRequired[ConnectionTypedDict] + r"""A connection represents a [company's](https://docs.codat.io/platform-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + + A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + + - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + Any combination of accounting, banking, and commerce data connections is allowed. + + Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + """ + reference_company: NotRequired[CompanyReferenceTypedDict] + + +class ConnectionWebhookPayload(BaseModel): + connection: Optional[Connection] = None + r"""A connection represents a [company's](https://docs.codat.io/platform-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + + A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + + - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + Any combination of accounting, banking, and commerce data connections is allowed. + + Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + """ + + reference_company: Annotated[ + Optional[CompanyReference], pydantic.Field(alias="referenceCompany") + ] = None diff --git a/platform/src/codat_platform/models/shared/createapikey.py b/platform/src/codat_platform/models/shared/createapikey.py new file mode 100644 index 000000000..3000c0b3f --- /dev/null +++ b/platform/src/codat_platform/models/shared/createapikey.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class CreateAPIKeyTypedDict(TypedDict): + r"""Details about the newly created API key.""" + + name: NotRequired[Nullable[str]] + r"""A meaningful name assigned to the API key.""" + + +class CreateAPIKey(BaseModel): + r"""Details about the newly created API key.""" + + name: OptionalNullable[str] = UNSET + r"""A meaningful name assigned to the API key.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name"] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/createrule.py b/platform/src/codat_platform/models/shared/createrule.py new file mode 100644 index 000000000..7542229c5 --- /dev/null +++ b/platform/src/codat_platform/models/shared/createrule.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .webhooknotifier import WebhookNotifier, WebhookNotifierTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateRuleTypedDict(TypedDict): + r"""Create a message that notifies a URL of an event based on its given type or condition.""" + + notifiers: WebhookNotifierTypedDict + type: str + r"""The type of webhook.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + + +class CreateRule(BaseModel): + r"""Create a message that notifies a URL of an event based on its given type or condition.""" + + notifiers: WebhookNotifier + + type: str + r"""The type of webhook.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="companyId")] = None + r"""Unique identifier for your SMB in Codat.""" diff --git a/platform/src/codat_platform/models/shared/customdatatypeconfiguration.py b/platform/src/codat_platform/models/shared/customdatatypeconfiguration.py new file mode 100644 index 000000000..9047135d1 --- /dev/null +++ b/platform/src/codat_platform/models/shared/customdatatypeconfiguration.py @@ -0,0 +1,77 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CustomDataTypeConfigurationTypedDict(TypedDict): + r"""Client's configuration details for a specific custom data type and platform pair.""" + + data_source: NotRequired[str] + r"""Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat.""" + key_by: NotRequired[List[str]] + r"""An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat.""" + required_data: NotRequired[Dict[str, str]] + r"""Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat.""" + source_modified_date: NotRequired[Nullable[List[str]]] + r"""Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat.""" + + +class CustomDataTypeConfiguration(BaseModel): + r"""Client's configuration details for a specific custom data type and platform pair.""" + + data_source: Annotated[Optional[str], pydantic.Field(alias="dataSource")] = None + r"""Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat.""" + + key_by: Annotated[Optional[List[str]], pydantic.Field(alias="keyBy")] = None + r"""An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat.""" + + required_data: Annotated[ + Optional[Dict[str, str]], pydantic.Field(alias="requiredData") + ] = None + r"""Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat.""" + + source_modified_date: Annotated[ + OptionalNullable[List[str]], pydantic.Field(alias="sourceModifiedDate") + ] = UNSET + r"""Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["dataSource", "keyBy", "requiredData", "sourceModifiedDate"] + nullable_fields = ["sourceModifiedDate"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/customdatatyperecord.py b/platform/src/codat_platform/models/shared/customdatatyperecord.py new file mode 100644 index 000000000..5a4d769ea --- /dev/null +++ b/platform/src/codat_platform/models/shared/customdatatyperecord.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing import Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ContentTypedDict(TypedDict): + pass + + +class Content(BaseModel): + pass + + +class ModifiedDateTypedDict(TypedDict): + modified_date: NotRequired[str] + + +class ModifiedDate(BaseModel): + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + +class CustomDataTypeRecordTypedDict(TypedDict): + content: NotRequired[Dict[str, ContentTypedDict]] + r"""Values from the source system for the properties defined in the custom data type configuration.""" + id: NotRequired[str] + r"""Unique identifier of the record.""" + modified_date: NotRequired[ModifiedDateTypedDict] + + +class CustomDataTypeRecord(BaseModel): + content: Optional[Dict[str, Content]] = None + r"""Values from the source system for the properties defined in the custom data type configuration.""" + + id: Optional[str] = None + r"""Unique identifier of the record.""" + + modified_date: Annotated[ + Optional[ModifiedDate], pydantic.Field(alias="modifiedDate") + ] = None diff --git a/platform/src/codat_platform/models/shared/customdatatyperecords.py b/platform/src/codat_platform/models/shared/customdatatyperecords.py new file mode 100644 index 000000000..4d61e344a --- /dev/null +++ b/platform/src/codat_platform/models/shared/customdatatyperecords.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .customdatatyperecord import CustomDataTypeRecord, CustomDataTypeRecordTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CustomDataTypeRecordsTypedDict(TypedDict): + r"""Resulting records pulled from the source platform for a specific custom data type.""" + + page_number: NotRequired[int] + r"""Current page number.""" + page_size: NotRequired[int] + r"""Number of items to return in results array.""" + results: NotRequired[List[CustomDataTypeRecordTypedDict]] + total_results: NotRequired[int] + r"""Total number of items.""" + + +class CustomDataTypeRecords(BaseModel): + r"""Resulting records pulled from the source platform for a specific custom data type.""" + + page_number: Annotated[Optional[int], pydantic.Field(alias="pageNumber")] = None + r"""Current page number.""" + + page_size: Annotated[Optional[int], pydantic.Field(alias="pageSize")] = None + r"""Number of items to return in results array.""" + + results: Optional[List[CustomDataTypeRecord]] = None + + total_results: Annotated[Optional[int], pydantic.Field(alias="totalResults")] = None + r"""Total number of items.""" diff --git a/platform/src/codat_platform/models/shared/dataconnectionerror.py b/platform/src/codat_platform/models/shared/dataconnectionerror.py new file mode 100644 index 000000000..13cef3a8a --- /dev/null +++ b/platform/src/codat_platform/models/shared/dataconnectionerror.py @@ -0,0 +1,174 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ErrorStatus(str, Enum): + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + + ACTIVE = "Active" + RESOLVED = "Resolved" + + +class DataConnectionErrorTypedDict(TypedDict): + error_message: NotRequired[str] + r"""A message about a error returned by Codat.""" + errored_on_utc: NotRequired[str] + 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: + + ``` + 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. + """ + resolved_on_utc: NotRequired[str] + 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: + + ``` + 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. + """ + status: NotRequired[Nullable[ErrorStatus]] + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + status_code: NotRequired[str] + r"""The HTTP status code returned by the source platform when the error occurred.""" + status_text: NotRequired[str] + r"""A non-numeric status code/text returned by the source platform when the error occurred.""" + + +class DataConnectionError(BaseModel): + error_message: Annotated[Optional[str], pydantic.Field(alias="errorMessage")] = None + r"""A message about a error returned by Codat.""" + + errored_on_utc: Annotated[Optional[str], pydantic.Field(alias="erroredOnUtc")] = ( + None + ) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + resolved_on_utc: Annotated[Optional[str], pydantic.Field(alias="resolvedOnUtc")] = ( + None + ) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + status: OptionalNullable[ErrorStatus] = UNSET + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + + status_code: Annotated[Optional[str], pydantic.Field(alias="statusCode")] = None + r"""The HTTP status code returned by the source platform when the error occurred.""" + + status_text: Annotated[Optional[str], pydantic.Field(alias="statusText")] = None + r"""A non-numeric status code/text returned by the source platform when the error occurred.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "errorMessage", + "erroredOnUtc", + "resolvedOnUtc", + "status", + "statusCode", + "statusText", + ] + nullable_fields = ["status"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/dataconnectionstatus.py b/platform/src/codat_platform/models/shared/dataconnectionstatus.py new file mode 100644 index 000000000..a97f7be30 --- /dev/null +++ b/platform/src/codat_platform/models/shared/dataconnectionstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class DataConnectionStatus(str, Enum): + r"""The current authorization status of the data connection.""" + + PENDING_AUTH = "PendingAuth" + LINKED = "Linked" + UNLINKED = "Unlinked" + DEAUTHORIZED = "Deauthorized" diff --git a/platform/src/codat_platform/models/shared/datasetdatachangedwebhook.py b/platform/src/codat_platform/models/shared/datasetdatachangedwebhook.py new file mode 100644 index 000000000..8cea166bf --- /dev/null +++ b/platform/src/codat_platform/models/shared/datasetdatachangedwebhook.py @@ -0,0 +1,85 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DatasetDataChangedWebhookDataTypedDict(TypedDict): + data_type: NotRequired[DataType] + r"""Available data types""" + dataset_id: NotRequired[str] + r"""Unique identifier for the dataset that completed its sync.""" + + +class DatasetDataChangedWebhookData(BaseModel): + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + dataset_id: Annotated[Optional[str], pydantic.Field(alias="datasetId")] = None + r"""Unique identifier for the dataset that completed its sync.""" + + +class DatasetDataChangedWebhookTypedDict(TypedDict): + r"""Webhook request body to notify that a data synchronization has completed.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data: NotRequired[DatasetDataChangedWebhookDataTypedDict] + data_connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class DatasetDataChangedWebhook(BaseModel): + r"""Webhook request body to notify that a data synchronization has completed.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data: Annotated[ + Optional[DatasetDataChangedWebhookData], pydantic.Field(alias="Data") + ] = None + + data_connection_id: Annotated[ + Optional[str], pydantic.Field(alias="DataConnectionId") + ] = None + r"""Unique identifier for a company's data connection.""" + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/datasetstatuschangederrorwebhook.py b/platform/src/codat_platform/models/shared/datasetstatuschangederrorwebhook.py new file mode 100644 index 000000000..ae5790d7c --- /dev/null +++ b/platform/src/codat_platform/models/shared/datasetstatuschangederrorwebhook.py @@ -0,0 +1,73 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datasetstatuschangederrorwebhookdata import ( + DatasetStatusChangedErrorWebhookData, + DatasetStatusChangedErrorWebhookDataTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DatasetStatusChangedErrorWebhookTypedDict(TypedDict): + r"""Webhook request body to notify that a data synchronization has completed.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data: NotRequired[DatasetStatusChangedErrorWebhookDataTypedDict] + data_connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class DatasetStatusChangedErrorWebhook(BaseModel): + r"""Webhook request body to notify that a data synchronization has completed.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data: Annotated[ + Optional[DatasetStatusChangedErrorWebhookData], pydantic.Field(alias="Data") + ] = None + + data_connection_id: Annotated[ + Optional[str], pydantic.Field(alias="DataConnectionId") + ] = None + r"""Unique identifier for a company's data connection.""" + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/datasetstatuschangederrorwebhookdata.py b/platform/src/codat_platform/models/shared/datasetstatuschangederrorwebhookdata.py new file mode 100644 index 000000000..20b98ebc3 --- /dev/null +++ b/platform/src/codat_platform/models/shared/datasetstatuschangederrorwebhookdata.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DatasetStatusChangedErrorWebhookDataTypedDict(TypedDict): + data_type: NotRequired[DataType] + r"""Available data types""" + dataset_id: NotRequired[str] + r"""Unique identifier for the dataset that completed its sync.""" + dataset_status: NotRequired[str] + r"""The current status of the dataset's sync.""" + + +class DatasetStatusChangedErrorWebhookData(BaseModel): + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + dataset_id: Annotated[Optional[str], pydantic.Field(alias="datasetId")] = None + r"""Unique identifier for the dataset that completed its sync.""" + + dataset_status: Annotated[Optional[str], pydantic.Field(alias="datasetStatus")] = ( + None + ) + r"""The current status of the dataset's sync.""" diff --git a/platform/src/codat_platform/models/shared/datastatus.py b/platform/src/codat_platform/models/shared/datastatus.py new file mode 100644 index 000000000..ebc47b15d --- /dev/null +++ b/platform/src/codat_platform/models/shared/datastatus.py @@ -0,0 +1,133 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .status import Status +from codat_platform.types import BaseModel +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataStatusDataTypes(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" + + +class DataStatusTypedDict(TypedDict): + r"""Describes the state of data in the Codat cache for a company and data type""" + + current_status: Status + r"""The current status of the dataset.""" + data_type: DataStatusDataTypes + r"""Available data types""" + last_successful_sync: str + 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: + + ``` + 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. + """ + latest_successful_sync_id: NotRequired[str] + r"""Unique identifier for the most recent successful sync of data type.""" + latest_sync_id: NotRequired[str] + r"""Unique identifier for most recent sync of data type.""" + + +class DataStatus(BaseModel): + r"""Describes the state of data in the Codat cache for a company and data type""" + + current_status: Annotated[Status, pydantic.Field(alias="currentStatus")] + r"""The current status of the dataset.""" + + data_type: Annotated[DataStatusDataTypes, pydantic.Field(alias="dataType")] + r"""Available data types""" + + last_successful_sync: Annotated[str, pydantic.Field(alias="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: + + ``` + 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. + """ + + latest_successful_sync_id: Annotated[ + Optional[str], pydantic.Field(alias="latestSuccessfulSyncId") + ] = None + r"""Unique identifier for the most recent successful sync of data type.""" + + latest_sync_id: Annotated[Optional[str], pydantic.Field(alias="latestSyncId")] = ( + None + ) + r"""Unique identifier for most recent sync of data type.""" diff --git a/platform/src/codat_platform/models/shared/datastatuses.py b/platform/src/codat_platform/models/shared/datastatuses.py new file mode 100644 index 000000000..9e3e81196 --- /dev/null +++ b/platform/src/codat_platform/models/shared/datastatuses.py @@ -0,0 +1,294 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datastatus import DataStatus, DataStatusTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataStatusesTypedDict(TypedDict): + account_transactions: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + balance_sheet: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bank_accounts: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bank_transactions: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_account_balances: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_accounts: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_transaction_categories: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_transactions: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bill_credit_notes: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bill_payments: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bills: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + cash_flow_statement: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + chart_of_accounts: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_company_info: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_customers: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_disputes: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_locations: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_orders: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_payment_methods: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_payments: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_product_categories: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_products: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_tax_components: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_transactions: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + company: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + credit_notes: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + customers: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + direct_costs: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + direct_incomes: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + invoices: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + item_receipts: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + items: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + journal_entries: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + journals: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + payment_methods: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + payments: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + profit_and_loss: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + purchase_orders: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + sales_orders: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + suppliers: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + tax_rates: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + tracking_categories: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + transfers: NotRequired[DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + + +class DataStatuses(BaseModel): + account_transactions: Annotated[ + Optional[DataStatus], pydantic.Field(alias="accountTransactions") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + balance_sheet: Annotated[ + Optional[DataStatus], pydantic.Field(alias="balanceSheet") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bank_accounts: Annotated[ + Optional[DataStatus], pydantic.Field(alias="bankAccounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bank_transactions: Annotated[ + Optional[DataStatus], pydantic.Field(alias="bankTransactions") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_account_balances: Annotated[ + Optional[DataStatus], pydantic.Field(alias="banking-accountBalances") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_accounts: Annotated[ + Optional[DataStatus], pydantic.Field(alias="banking-accounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_transaction_categories: Annotated[ + Optional[DataStatus], pydantic.Field(alias="banking-transactionCategories") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_transactions: Annotated[ + Optional[DataStatus], pydantic.Field(alias="banking-transactions") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bill_credit_notes: Annotated[ + Optional[DataStatus], pydantic.Field(alias="billCreditNotes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bill_payments: Annotated[ + Optional[DataStatus], pydantic.Field(alias="billPayments") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bills: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + cash_flow_statement: Annotated[ + Optional[DataStatus], pydantic.Field(alias="cashFlowStatement") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + chart_of_accounts: Annotated[ + Optional[DataStatus], pydantic.Field(alias="chartOfAccounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_company_info: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-companyInfo") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_customers: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-customers") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_disputes: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-disputes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_locations: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-locations") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_orders: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-orders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_payment_methods: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-paymentMethods") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_payments: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-payments") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_product_categories: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-productCategories") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_products: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-products") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_tax_components: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-taxComponents") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_transactions: Annotated[ + Optional[DataStatus], pydantic.Field(alias="commerce-transactions") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + company: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + credit_notes: Annotated[ + Optional[DataStatus], pydantic.Field(alias="creditNotes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + customers: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + direct_costs: Annotated[ + Optional[DataStatus], pydantic.Field(alias="directCosts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + direct_incomes: Annotated[ + Optional[DataStatus], pydantic.Field(alias="directIncomes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + invoices: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + item_receipts: Annotated[ + Optional[DataStatus], pydantic.Field(alias="itemReceipts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + items: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + journal_entries: Annotated[ + Optional[DataStatus], pydantic.Field(alias="journalEntries") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + journals: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + payment_methods: Annotated[ + Optional[DataStatus], pydantic.Field(alias="paymentMethods") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + payments: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + profit_and_loss: Annotated[ + Optional[DataStatus], pydantic.Field(alias="profitAndLoss") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + purchase_orders: Annotated[ + Optional[DataStatus], pydantic.Field(alias="purchaseOrders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + sales_orders: Annotated[ + Optional[DataStatus], pydantic.Field(alias="salesOrders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + suppliers: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + tax_rates: Annotated[Optional[DataStatus], pydantic.Field(alias="taxRates")] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + tracking_categories: Annotated[ + Optional[DataStatus], pydantic.Field(alias="trackingCategories") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + transfers: Optional[DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" diff --git a/platform/src/codat_platform/models/shared/datasynccompletedwebhook.py b/platform/src/codat_platform/models/shared/datasynccompletedwebhook.py new file mode 100644 index 000000000..43f844212 --- /dev/null +++ b/platform/src/codat_platform/models/shared/datasynccompletedwebhook.py @@ -0,0 +1,73 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datasynccompletedwebhookdata import ( + DataSyncCompletedWebhookData, + DataSyncCompletedWebhookDataTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataSyncCompletedWebhookTypedDict(TypedDict): + r"""Webhook request body to notify the completion of a data sync.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data: NotRequired[DataSyncCompletedWebhookDataTypedDict] + data_connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class DataSyncCompletedWebhook(BaseModel): + r"""Webhook request body to notify the completion of a data sync.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data: Annotated[ + Optional[DataSyncCompletedWebhookData], pydantic.Field(alias="Data") + ] = None + + data_connection_id: Annotated[ + Optional[str], pydantic.Field(alias="DataConnectionId") + ] = None + r"""Unique identifier for a company's data connection.""" + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/datasynccompletedwebhookdata.py b/platform/src/codat_platform/models/shared/datasynccompletedwebhookdata.py new file mode 100644 index 000000000..2b0d55174 --- /dev/null +++ b/platform/src/codat_platform/models/shared/datasynccompletedwebhookdata.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataSyncCompletedWebhookDataTypedDict(TypedDict): + data_type: NotRequired[DataType] + r"""Available data types""" + dataset_id: NotRequired[str] + r"""Unique identifier for the dataset that completed its sync.""" + + +class DataSyncCompletedWebhookData(BaseModel): + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + dataset_id: Annotated[Optional[str], pydantic.Field(alias="datasetId")] = None + r"""Unique identifier for the dataset that completed its sync.""" diff --git a/platform/src/codat_platform/models/shared/datatype.py b/platform/src/codat_platform/models/shared/datatype.py new file mode 100644 index 000000000..e0aff6fb8 --- /dev/null +++ b/platform/src/codat_platform/models/shared/datatype.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class DataType(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" diff --git a/platform/src/codat_platform/models/shared/datatypefeature.py b/platform/src/codat_platform/models/shared/datatypefeature.py new file mode 100644 index 000000000..d63a4320c --- /dev/null +++ b/platform/src/codat_platform/models/shared/datatypefeature.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .supportedfeature import SupportedFeature, SupportedFeatureTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataTypeFeatureTypedDict(TypedDict): + r"""Describes support for a given datatype and associated operations""" + + supported_features: List[SupportedFeatureTypedDict] + data_type: NotRequired[DataType] + r"""Available data types""" + + +class DataTypeFeature(BaseModel): + r"""Describes support for a given datatype and associated operations""" + + supported_features: Annotated[ + List[SupportedFeature], pydantic.Field(alias="supportedFeatures") + ] + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" diff --git a/platform/src/codat_platform/models/shared/datatypewritewebhook.py b/platform/src/codat_platform/models/shared/datatypewritewebhook.py new file mode 100644 index 000000000..7928b7929 --- /dev/null +++ b/platform/src/codat_platform/models/shared/datatypewritewebhook.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatypewritewebhookpayload import ( + DataTypeWriteWebhookPayload, + DataTypeWriteWebhookPayloadTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataTypeWriteWebhookTypedDict(TypedDict): + event_type: NotRequired[str] + r"""The type of event.""" + generated_date: NotRequired[str] + 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: + + ``` + 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. + """ + id: NotRequired[str] + r"""Unique identifier of the event.""" + payload: NotRequired[DataTypeWriteWebhookPayloadTypedDict] + + +class DataTypeWriteWebhook(BaseModel): + event_type: Annotated[Optional[str], pydantic.Field(alias="eventType")] = None + r"""The type of event.""" + + generated_date: Annotated[Optional[str], pydantic.Field(alias="generatedDate")] = ( + None + ) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + id: Optional[str] = None + r"""Unique identifier of the event.""" + + payload: Optional[DataTypeWriteWebhookPayload] = None diff --git a/platform/src/codat_platform/models/shared/datatypewritewebhookpayload.py b/platform/src/codat_platform/models/shared/datatypewritewebhookpayload.py new file mode 100644 index 000000000..aebe764ab --- /dev/null +++ b/platform/src/codat_platform/models/shared/datatypewritewebhookpayload.py @@ -0,0 +1,191 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .companyreference import CompanyReference, CompanyReferenceTypedDict +from .datatypewritewebhookrecord import ( + DataTypeWriteWebhookRecord, + DataTypeWriteWebhookRecordTypedDict, +) +from .writestatus import WriteStatus +from .writetype import WriteType +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataTypeWriteWebhookPayloadTypedDict(TypedDict): + attachment_id: NotRequired[Nullable[str]] + r"""Unique identifier for the uploaded attachment, null if no attachment uploaded.""" + completed_on_date: NotRequired[str] + 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: + + ``` + 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. + """ + connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + id: NotRequired[str] + r"""Unique identifier of the write request. This is also known as the push operation ID.""" + record: NotRequired[DataTypeWriteWebhookRecordTypedDict] + reference_company: NotRequired[CompanyReferenceTypedDict] + requested_on_date: NotRequired[str] + 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: + + ``` + 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. + """ + status: NotRequired[WriteStatus] + r"""The current status of the write request, which is the same as the push operation status.""" + type: NotRequired[WriteType] + r"""Type of write request.""" + + +class DataTypeWriteWebhookPayload(BaseModel): + attachment_id: Annotated[ + OptionalNullable[str], pydantic.Field(alias="attachmentId") + ] = UNSET + r"""Unique identifier for the uploaded attachment, null if no attachment uploaded.""" + + completed_on_date: Annotated[ + Optional[str], pydantic.Field(alias="completedOnDate") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + connection_id: Annotated[Optional[str], pydantic.Field(alias="connectionId")] = None + r"""Unique identifier for a company's data connection.""" + + id: Optional[str] = None + r"""Unique identifier of the write request. This is also known as the push operation ID.""" + + record: Optional[DataTypeWriteWebhookRecord] = None + + reference_company: Annotated[ + Optional[CompanyReference], pydantic.Field(alias="referenceCompany") + ] = None + + requested_on_date: Annotated[ + Optional[str], pydantic.Field(alias="requestedOnDate") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + status: Optional[WriteStatus] = None + r"""The current status of the write request, which is the same as the push operation status.""" + + type: Optional[WriteType] = None + r"""Type of write request.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "attachmentId", + "completedOnDate", + "connectionId", + "id", + "record", + "referenceCompany", + "requestedOnDate", + "status", + "type", + ] + nullable_fields = ["attachmentId"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/datatypewritewebhookrecord.py b/platform/src/codat_platform/models/shared/datatypewritewebhookrecord.py new file mode 100644 index 000000000..15f20adb1 --- /dev/null +++ b/platform/src/codat_platform/models/shared/datatypewritewebhookrecord.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class DataTypeWriteWebhookRecordTypedDict(TypedDict): + id: NotRequired[str] + r"""The unique identifier of the data type created, updated, deleted, or had an attachment uploaded in the accounting platform.""" + + +class DataTypeWriteWebhookRecord(BaseModel): + id: Optional[str] = None + r"""The unique identifier of the data type created, updated, deleted, or had an attachment uploaded in the accounting platform.""" diff --git a/platform/src/codat_platform/models/shared/errormessage.py b/platform/src/codat_platform/models/shared/errormessage.py new file mode 100644 index 000000000..f04bb7b4e --- /dev/null +++ b/platform/src/codat_platform/models/shared/errormessage.py @@ -0,0 +1,103 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .errorvalidation import ErrorValidation, ErrorValidationTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ErrorMessageTypedDict(TypedDict): + r"""Too many requests were made in a given amount of time. Wait a short period and then try again.""" + + can_be_retried: NotRequired[str] + r"""`True` if the error occurred transiently and can be retried.""" + correlation_id: NotRequired[str] + r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" + detailed_error_code: NotRequired[int] + r"""Machine readable error code used to automate processes based on the code returned.""" + error: NotRequired[str] + r"""A brief description of the error.""" + service: NotRequired[str] + r"""Codat's service the returned the error.""" + status_code: NotRequired[int] + r"""The HTTP status code returned by the error.""" + validation: NotRequired[Nullable[ErrorValidationTypedDict]] + r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" + + +class ErrorMessage(BaseModel): + r"""Too many requests were made in a given amount of time. Wait a short period and then try again.""" + + can_be_retried: Annotated[Optional[str], pydantic.Field(alias="canBeRetried")] = ( + None + ) + r"""`True` if the error occurred transiently and can be retried.""" + + correlation_id: Annotated[Optional[str], pydantic.Field(alias="correlationId")] = ( + None + ) + r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" + + detailed_error_code: Annotated[ + Optional[int], pydantic.Field(alias="detailedErrorCode") + ] = None + r"""Machine readable error code used to automate processes based on the code returned.""" + + error: Optional[str] = None + r"""A brief description of the error.""" + + service: Optional[str] = None + r"""Codat's service the returned the error.""" + + status_code: Annotated[Optional[int], pydantic.Field(alias="statusCode")] = None + r"""The HTTP status code returned by the error.""" + + validation: OptionalNullable[ErrorValidation] = UNSET + r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "canBeRetried", + "correlationId", + "detailedErrorCode", + "error", + "service", + "statusCode", + "validation", + ] + nullable_fields = ["validation"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/errorvalidation.py b/platform/src/codat_platform/models/shared/errorvalidation.py new file mode 100644 index 000000000..e05729865 --- /dev/null +++ b/platform/src/codat_platform/models/shared/errorvalidation.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ErrorValidationTypedDict(TypedDict): + r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" + + errors: NotRequired[Nullable[List[ErrorValidationItemTypedDict]]] + warnings: NotRequired[Nullable[List[ErrorValidationItemTypedDict]]] + + +class ErrorValidation(BaseModel): + r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" + + errors: OptionalNullable[List[ErrorValidationItem]] = UNSET + + warnings: OptionalNullable[List[ErrorValidationItem]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["errors", "warnings"] + nullable_fields = ["errors", "warnings"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/errorvalidationitem.py b/platform/src/codat_platform/models/shared/errorvalidationitem.py new file mode 100644 index 000000000..01eab2f35 --- /dev/null +++ b/platform/src/codat_platform/models/shared/errorvalidationitem.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ErrorValidationItemTypedDict(TypedDict): + item_id: NotRequired[Nullable[str]] + r"""Unique identifier for a validation item.""" + message: NotRequired[Nullable[str]] + r"""A message outlining validation item's issue.""" + validator_name: NotRequired[Nullable[str]] + r"""Name of validator.""" + + +class ErrorValidationItem(BaseModel): + item_id: Annotated[OptionalNullable[str], pydantic.Field(alias="itemId")] = UNSET + r"""Unique identifier for a validation item.""" + + message: OptionalNullable[str] = UNSET + r"""A message outlining validation item's issue.""" + + validator_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="validatorName") + ] = UNSET + r"""Name of validator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["itemId", "message", "validatorName"] + nullable_fields = ["itemId", "message", "validatorName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/featurestate.py b/platform/src/codat_platform/models/shared/featurestate.py new file mode 100644 index 000000000..27b65913f --- /dev/null +++ b/platform/src/codat_platform/models/shared/featurestate.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class FeatureState(str, Enum): + r"""The current release state of the feature.""" + + RELEASE = "Release" + ALPHA = "Alpha" + BETA = "Beta" + DEPRECATED = "Deprecated" + NOT_SUPPORTED = "NotSupported" + NOT_IMPLEMENTED = "NotImplemented" diff --git a/platform/src/codat_platform/models/shared/featuretype.py b/platform/src/codat_platform/models/shared/featuretype.py new file mode 100644 index 000000000..f0c620a36 --- /dev/null +++ b/platform/src/codat_platform/models/shared/featuretype.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class FeatureType(str, Enum): + r"""The type of feature.""" + + GET = "Get" + POST = "Post" + CATEGORIZATION = "Categorization" + DELETE = "Delete" + PUT = "Put" + GET_AS_PDF = "GetAsPdf" + DOWNLOAD_ATTACHMENT = "DownloadAttachment" + GET_ATTACHMENT = "GetAttachment" + GET_ATTACHMENTS = "GetAttachments" + UPLOAD_ATTACHMENT = "UploadAttachment" diff --git a/platform/src/codat_platform/models/shared/halref.py b/platform/src/codat_platform/models/shared/halref.py new file mode 100644 index 000000000..2770aefb9 --- /dev/null +++ b/platform/src/codat_platform/models/shared/halref.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class HalRefTypedDict(TypedDict): + href: NotRequired[str] + r"""Uri hypertext reference.""" + + +class HalRef(BaseModel): + href: Optional[str] = None + r"""Uri hypertext reference.""" diff --git a/platform/src/codat_platform/models/shared/imagereference.py b/platform/src/codat_platform/models/shared/imagereference.py new file mode 100644 index 000000000..a59e71248 --- /dev/null +++ b/platform/src/codat_platform/models/shared/imagereference.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ImageReferenceTypedDict(TypedDict): + r"""Image reference.""" + + alt: NotRequired[str] + r"""Alternative text when image is not available.""" + src: NotRequired[str] + r"""Source URL for image.""" + + +class ImageReference(BaseModel): + r"""Image reference.""" + + alt: Optional[str] = None + r"""Alternative text when image is not available.""" + + src: Optional[str] = None + r"""Source URL for image.""" diff --git a/platform/src/codat_platform/models/shared/integration.py b/platform/src/codat_platform/models/shared/integration.py new file mode 100644 index 000000000..425d72bee --- /dev/null +++ b/platform/src/codat_platform/models/shared/integration.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatypefeature import DataTypeFeature, DataTypeFeatureTypedDict +from .sourcetype import SourceType +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class IntegrationTypedDict(TypedDict): + r"""An integration that Codat supports""" + + enabled: bool + r"""Whether this integration is enabled for your customers to use.""" + key: str + 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.""" + logo_url: str + r"""Static url for integration's logo.""" + name: str + r"""Name of integration.""" + data_provided_by: NotRequired[str] + r"""The name of the data provider.""" + datatype_features: NotRequired[List[DataTypeFeatureTypedDict]] + integration_id: NotRequired[str] + r"""A Codat ID representing the integration.""" + is_beta: NotRequired[bool] + r"""`True` if the integration is currently in beta release.""" + is_offline_connector: NotRequired[bool] + r"""`True` if the integration is to an application installed and run locally on an SMBs computer.""" + source_id: NotRequired[str] + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + source_type: NotRequired[SourceType] + r"""The type of platform of the connection.""" + + +class Integration(BaseModel): + r"""An integration that Codat supports""" + + enabled: bool + r"""Whether this integration is enabled for your customers to use.""" + + key: str + 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.""" + + logo_url: Annotated[str, pydantic.Field(alias="logoUrl")] + r"""Static url for integration's logo.""" + + name: str + r"""Name of integration.""" + + data_provided_by: Annotated[ + Optional[str], pydantic.Field(alias="dataProvidedBy") + ] = None + r"""The name of the data provider.""" + + datatype_features: Annotated[ + Optional[List[DataTypeFeature]], pydantic.Field(alias="datatypeFeatures") + ] = None + + integration_id: Annotated[Optional[str], pydantic.Field(alias="integrationId")] = ( + None + ) + r"""A Codat ID representing the integration.""" + + is_beta: Annotated[Optional[bool], pydantic.Field(alias="isBeta")] = None + r"""`True` if the integration is currently in beta release.""" + + is_offline_connector: Annotated[ + Optional[bool], pydantic.Field(alias="isOfflineConnector") + ] = None + r"""`True` if the integration is to an application installed and run locally on an SMBs computer.""" + + source_id: Annotated[Optional[str], pydantic.Field(alias="sourceId")] = None + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + + source_type: Annotated[Optional[SourceType], pydantic.Field(alias="sourceType")] = ( + None + ) + r"""The type of platform of the connection.""" diff --git a/platform/src/codat_platform/models/shared/integrations.py b/platform/src/codat_platform/models/shared/integrations.py new file mode 100644 index 000000000..36173a670 --- /dev/null +++ b/platform/src/codat_platform/models/shared/integrations.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .integration import Integration, IntegrationTypedDict +from .links import Links, LinksTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class IntegrationsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[IntegrationTypedDict]] + + +class Integrations(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Integration]] = None diff --git a/platform/src/codat_platform/models/shared/links.py b/platform/src/codat_platform/models/shared/links.py new file mode 100644 index 000000000..ed5d1391d --- /dev/null +++ b/platform/src/codat_platform/models/shared/links.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .halref import HalRef, HalRefTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class LinksTypedDict(TypedDict): + current: HalRefTypedDict + self_: HalRefTypedDict + next: NotRequired[HalRefTypedDict] + previous: NotRequired[HalRefTypedDict] + + +class Links(BaseModel): + current: HalRef + + self_: Annotated[HalRef, pydantic.Field(alias="self")] + + next: Optional[HalRef] = None + + previous: Optional[HalRef] = None diff --git a/platform/src/codat_platform/models/shared/newcompanysynchronizedwebhook.py b/platform/src/codat_platform/models/shared/newcompanysynchronizedwebhook.py new file mode 100644 index 000000000..b747037ed --- /dev/null +++ b/platform/src/codat_platform/models/shared/newcompanysynchronizedwebhook.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class NewCompanySynchronizedWebhookTypedDict(TypedDict): + r"""Webhook request body to notify that a new company has successfully synchronized at least one dataType for the first time.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data_connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class NewCompanySynchronizedWebhook(BaseModel): + r"""Webhook request body to notify that a new company has successfully synchronized at least one dataType for the first time.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data_connection_id: Annotated[ + Optional[str], pydantic.Field(alias="DataConnectionId") + ] = None + r"""Unique identifier for a company's data connection.""" + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/profile.py b/platform/src/codat_platform/models/shared/profile.py new file mode 100644 index 000000000..ad7b183f9 --- /dev/null +++ b/platform/src/codat_platform/models/shared/profile.py @@ -0,0 +1,72 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ProfileTypedDict(TypedDict): + r"""Describes your Codat client instance""" + + name: str + r"""The name given to the instance.""" + redirect_url: str + r"""The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB.""" + alert_auth_header: NotRequired[str] + r"""Alert or webhooks authorization header.""" + api_key: NotRequired[str] + r"""The API key for this Codat instance.""" + confirm_company_name: NotRequired[bool] + r"""`True` if the company name has been confirmed.""" + icon_url: NotRequired[str] + r"""Static url to your organization's icon.""" + logo_url: NotRequired[str] + r"""Static url to your organization's logo.""" + white_list_urls: NotRequired[List[str]] + r"""A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat.""" + + +class Profile(BaseModel): + r"""Describes your Codat client instance""" + + name: str + r"""The name given to the instance.""" + + redirect_url: Annotated[str, pydantic.Field(alias="redirectUrl")] + r"""The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB.""" + + alert_auth_header: Annotated[ + Optional[str], pydantic.Field(alias="alertAuthHeader") + ] = None + r"""Alert or webhooks authorization header.""" + + api_key: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="apiKey", + ), + ] = None + r"""The API key for this Codat instance.""" + + confirm_company_name: Annotated[ + Optional[bool], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="confirmCompanyName", + ), + ] = None + r"""`True` if the company name has been confirmed.""" + + icon_url: Annotated[Optional[str], pydantic.Field(alias="iconUrl")] = None + r"""Static url to your organization's icon.""" + + logo_url: Annotated[Optional[str], pydantic.Field(alias="logoUrl")] = None + r"""Static url to your organization's logo.""" + + white_list_urls: Annotated[ + Optional[List[str]], pydantic.Field(alias="whiteListUrls") + ] = None + r"""A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat.""" diff --git a/platform/src/codat_platform/models/shared/pulloperation.py b/platform/src/codat_platform/models/shared/pulloperation.py new file mode 100644 index 000000000..93852af40 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pulloperation.py @@ -0,0 +1,224 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DatasetStatus(str, Enum): + r"""The current status of the dataset.""" + + INITIAL = "Initial" + QUEUED = "Queued" + FETCHING = "Fetching" + MAP_QUEUED = "MapQueued" + MAPPING = "Mapping" + COMPLETE = "Complete" + FETCH_ERROR = "FetchError" + MAP_ERROR = "MapError" + INTERNAL_ERROR = "InternalError" + PROCESSING_QUEUED = "ProcessingQueued" + PROCESSING = "Processing" + PROCESSING_ERROR = "ProcessingError" + VALIDATION_QUEUED = "ValidationQueued" + VALIDATING = "Validating" + VALIDATION_ERROR = "ValidationError" + AUTH_ERROR = "AuthError" + CANCELLED = "Cancelled" + NOT_SUPPORTED = "NotSupported" + RATE_LIMIT_ERROR = "RateLimitError" + PERMISSIONS_ERROR = "PermissionsError" + PREREQUISITE_NOT_MET = "PrerequisiteNotMet" + + +class PullOperationTypedDict(TypedDict): + r"""Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + """ + + company_id: str + r"""Unique identifier of the company associated to this pull operation.""" + connection_id: str + r"""Unique identifier of the connection associated to this pull operation.""" + data_type: str + r"""The data type you are requesting in a pull operation.""" + id: str + r"""Unique identifier of the pull operation.""" + is_completed: bool + r"""`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.""" + is_errored: bool + r"""`True` if the pull operation entered an error state.""" + progress: int + r"""An integer signifying the progress of the pull operation.""" + requested: str + 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: + + ``` + 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. + """ + status: DatasetStatus + r"""The current status of the dataset.""" + completed: NotRequired[str] + 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: + + ``` + 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. + """ + error_message: NotRequired[Nullable[str]] + r"""A message about a transient or persistent error returned by Codat or the source platform.""" + status_description: NotRequired[Nullable[str]] + r"""Additional information about the dataset status.""" + + +class PullOperation(BaseModel): + r"""Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + """ + + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier of the company associated to this pull operation.""" + + connection_id: Annotated[str, pydantic.Field(alias="connectionId")] + r"""Unique identifier of the connection associated to this pull operation.""" + + data_type: Annotated[str, pydantic.Field(alias="dataType")] + r"""The data type you are requesting in a pull operation.""" + + id: str + r"""Unique identifier of the pull operation.""" + + is_completed: Annotated[bool, pydantic.Field(alias="isCompleted")] + r"""`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.""" + + is_errored: Annotated[bool, pydantic.Field(alias="isErrored")] + r"""`True` if the pull operation entered an error state.""" + + progress: int + r"""An integer signifying the progress of the pull operation.""" + + requested: str + 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: + + ``` + 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. + """ + + status: DatasetStatus + r"""The current status of the dataset.""" + + completed: Optional[str] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about a transient or persistent error returned by Codat or the source platform.""" + + status_description: Annotated[ + OptionalNullable[str], pydantic.Field(alias="statusDescription") + ] = UNSET + r"""Additional information about the dataset status.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["completed", "errorMessage", "statusDescription"] + nullable_fields = ["errorMessage", "statusDescription"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/pulloperations.py b/platform/src/codat_platform/models/shared/pulloperations.py new file mode 100644 index 000000000..328eb1635 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pulloperations.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .pulloperation import PullOperation, PullOperationTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PullOperationsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[PullOperationTypedDict]] + + +class PullOperations(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[PullOperation]] = None diff --git a/platform/src/codat_platform/models/shared/pushchangetype.py b/platform/src/codat_platform/models/shared/pushchangetype.py new file mode 100644 index 000000000..76371e9e3 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushchangetype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushChangeType(str, Enum): + r"""Type of change being applied to record in third party platform.""" + + UNKNOWN = "Unknown" + CREATED = "Created" + MODIFIED = "Modified" + DELETED = "Deleted" + ATTACHMENT_UPLOADED = "AttachmentUploaded" diff --git a/platform/src/codat_platform/models/shared/pushfieldvalidation.py b/platform/src/codat_platform/models/shared/pushfieldvalidation.py new file mode 100644 index 000000000..1bd6ecdb3 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushfieldvalidation.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PushFieldValidationTypedDict(TypedDict): + details: str + r"""Details on the validation issue.""" + field: NotRequired[str] + r"""Field name that resulted in the validation issue.""" + ref: NotRequired[Nullable[str]] + r"""Unique reference identifier for the validation issue.""" + + +class PushFieldValidation(BaseModel): + details: str + r"""Details on the validation issue.""" + + field: Optional[str] = None + r"""Field name that resulted in the validation issue.""" + + ref: OptionalNullable[str] = UNSET + r"""Unique reference identifier for the validation issue.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["field", "ref"] + nullable_fields = ["ref"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/pushoperation.py b/platform/src/codat_platform/models/shared/pushoperation.py new file mode 100644 index 000000000..60eaf4bdb --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperation.py @@ -0,0 +1,219 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .validation import Validation, ValidationTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + 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.""" + requested_on_utc: str + 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: NotRequired[str] + 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: + + ``` + 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. + """ + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class PushOperation(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + 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.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/pushoperationchange.py b/platform/src/codat_platform/models/shared/pushoperationchange.py new file mode 100644 index 000000000..8e551d41a --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperationchange.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushchangetype import PushChangeType +from .pushoperationref import PushOperationRef, PushOperationRefTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationChangeTypedDict(TypedDict): + attachment_id: NotRequired[Nullable[str]] + r"""Unique identifier for the attachment created otherwise null.""" + record_ref: NotRequired[PushOperationRefTypedDict] + type: NotRequired[PushChangeType] + r"""Type of change being applied to record in third party platform.""" + + +class PushOperationChange(BaseModel): + attachment_id: Annotated[ + OptionalNullable[str], pydantic.Field(alias="attachmentId") + ] = UNSET + r"""Unique identifier for the attachment created otherwise null.""" + + record_ref: Annotated[ + Optional[PushOperationRef], pydantic.Field(alias="recordRef") + ] = None + + type: Optional[PushChangeType] = None + r"""Type of change being applied to record in third party platform.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["attachmentId", "recordRef", "type"] + nullable_fields = ["attachmentId"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/pushoperationref.py b/platform/src/codat_platform/models/shared/pushoperationref.py new file mode 100644 index 000000000..49523619e --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperationref.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationRefTypedDict(TypedDict): + data_type: NotRequired[DataType] + r"""Available data types""" + id: NotRequired[str] + r"""Unique identifier for a push operation.""" + + +class PushOperationRef(BaseModel): + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + id: Optional[str] = None + r"""Unique identifier for a push operation.""" diff --git a/platform/src/codat_platform/models/shared/pushoperations.py b/platform/src/codat_platform/models/shared/pushoperations.py new file mode 100644 index 000000000..595eaac8c --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperations.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .pushoperation import PushOperation, PushOperationTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[PushOperationTypedDict]] + + +class PushOperations(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[PushOperation]] = None diff --git a/platform/src/codat_platform/models/shared/pushoperationstatus.py b/platform/src/codat_platform/models/shared/pushoperationstatus.py new file mode 100644 index 000000000..09fa8b1f2 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperationstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushOperationStatus(str, Enum): + r"""The current status of the push operation.""" + + PENDING = "Pending" + FAILED = "Failed" + SUCCESS = "Success" + TIMED_OUT = "TimedOut" diff --git a/platform/src/codat_platform/models/shared/pushoperationstatuschangedwebhook.py b/platform/src/codat_platform/models/shared/pushoperationstatuschangedwebhook.py new file mode 100644 index 000000000..b53a81cf0 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperationstatuschangedwebhook.py @@ -0,0 +1,73 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoperationstatuschangedwebhookdata import ( + PushOperationStatusChangedWebhookData, + PushOperationStatusChangedWebhookDataTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationStatusChangedWebhookTypedDict(TypedDict): + r"""Webhook request body for a push operation status change.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data: NotRequired[PushOperationStatusChangedWebhookDataTypedDict] + data_connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class PushOperationStatusChangedWebhook(BaseModel): + r"""Webhook request body for a push operation status change.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data: Annotated[ + Optional[PushOperationStatusChangedWebhookData], pydantic.Field(alias="Data") + ] = None + + data_connection_id: Annotated[ + Optional[str], pydantic.Field(alias="DataConnectionId") + ] = None + r"""Unique identifier for a company's data connection.""" + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/pushoperationstatuschangedwebhookdata.py b/platform/src/codat_platform/models/shared/pushoperationstatuschangedwebhookdata.py new file mode 100644 index 000000000..78c3842af --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperationstatuschangedwebhookdata.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .pushoperationstatus import PushOperationStatus +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationStatusChangedWebhookDataTypedDict(TypedDict): + data_type: NotRequired[DataType] + r"""Available data types""" + push_operation_key: NotRequired[str] + 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: NotRequired[PushOperationStatus] + r"""The current status of the push operation.""" + + +class PushOperationStatusChangedWebhookData(BaseModel): + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + push_operation_key: Annotated[ + Optional[str], pydantic.Field(alias="pushOperationKey") + ] = 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] = None + r"""The current status of the push operation.""" diff --git a/platform/src/codat_platform/models/shared/pushoperationtimedoutwebhook.py b/platform/src/codat_platform/models/shared/pushoperationtimedoutwebhook.py new file mode 100644 index 000000000..9906a2ef2 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperationtimedoutwebhook.py @@ -0,0 +1,73 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoperationtimedoutwebhookdata import ( + PushOperationTimedOutWebhookData, + PushOperationTimedOutWebhookDataTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationTimedOutWebhookTypedDict(TypedDict): + r"""Webhook request body notifying that a push push operation has timed out.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + data: NotRequired[PushOperationTimedOutWebhookDataTypedDict] + data_connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class PushOperationTimedOutWebhook(BaseModel): + r"""Webhook request body notifying that a push push operation has timed out.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="CompanyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + data: Annotated[ + Optional[PushOperationTimedOutWebhookData], pydantic.Field(alias="Data") + ] = None + + data_connection_id: Annotated[ + Optional[str], pydantic.Field(alias="DataConnectionId") + ] = None + r"""Unique identifier for a company's data connection.""" + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/platform/src/codat_platform/models/shared/pushoperationtimedoutwebhookdata.py b/platform/src/codat_platform/models/shared/pushoperationtimedoutwebhookdata.py new file mode 100644 index 000000000..9f9a2f080 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoperationtimedoutwebhookdata.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationTimedOutWebhookDataTypedDict(TypedDict): + data_type: NotRequired[DataType] + r"""Available data types""" + push_operation_guid: NotRequired[str] + 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: NotRequired[str] + 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.""" + + +class PushOperationTimedOutWebhookData(BaseModel): + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + push_operation_guid: Annotated[ + Optional[str], pydantic.Field(alias="pushOperationGuid") + ] = 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: Annotated[ + Optional[str], pydantic.Field(alias="pushOperationKey") + ] = 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.""" diff --git a/platform/src/codat_platform/models/shared/pushoption.py b/platform/src/codat_platform/models/shared/pushoption.py new file mode 100644 index 000000000..ba99b3282 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoption.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptionproperty import PushOptionProperty, PushOptionPropertyTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionTypedDict(TypedDict): + display_name: str + r"""The property's display name.""" + required: bool + r"""The property is required if `True`.""" + type: PushOptionType + r"""The option type.""" + description: NotRequired[str] + r"""A description of the property.""" + options: NotRequired[Nullable[List[PushOptionChoiceTypedDict]]] + properties: NotRequired[Nullable[Dict[str, PushOptionPropertyTypedDict]]] + validation: NotRequired[PushValidationInfoTypedDict] + + +class PushOption(BaseModel): + display_name: Annotated[str, pydantic.Field(alias="displayName")] + r"""The property's display name.""" + + required: bool + r"""The property is required if `True`.""" + + type: PushOptionType + r"""The option type.""" + + description: Optional[str] = None + r"""A description of the property.""" + + options: OptionalNullable[List[PushOptionChoice]] = UNSET + + properties: OptionalNullable[Dict[str, PushOptionProperty]] = UNSET + + validation: Optional[PushValidationInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["description", "options", "properties", "validation"] + nullable_fields = ["options", "properties"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/pushoptionchoice.py b/platform/src/codat_platform/models/shared/pushoptionchoice.py new file mode 100644 index 000000000..aba5699a6 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoptionchoice.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptiontype import PushOptionType +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionChoiceTypedDict(TypedDict): + description: NotRequired[str] + r"""A description of the property.""" + display_name: NotRequired[str] + r"""The property's display name.""" + required: NotRequired[bool] + r"""The property is required if `True`.""" + type: NotRequired[PushOptionType] + r"""The option type.""" + value: NotRequired[str] + r"""Allowed value for field.""" + + +class PushOptionChoice(BaseModel): + description: Optional[str] = None + r"""A description of the property.""" + + display_name: Annotated[Optional[str], pydantic.Field(alias="displayName")] = None + r"""The property's display name.""" + + required: Optional[bool] = None + r"""The property is required if `True`.""" + + type: Optional[PushOptionType] = None + r"""The option type.""" + + value: Optional[str] = None + r"""Allowed value for field.""" diff --git a/platform/src/codat_platform/models/shared/pushoptionproperty.py b/platform/src/codat_platform/models/shared/pushoptionproperty.py new file mode 100644 index 000000000..783e6f475 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoptionproperty.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionPropertyTypedDict(TypedDict): + description: str + r"""A description of the property.""" + display_name: str + r"""The property's display name.""" + required: bool + r"""The property is required if `True`.""" + type: PushOptionType + r"""The option type.""" + options: NotRequired[Nullable[List[PushOptionChoiceTypedDict]]] + properties: NotRequired[Nullable[Dict[str, PushOptionPropertyTypedDict]]] + validation: NotRequired[PushValidationInfoTypedDict] + + +class PushOptionProperty(BaseModel): + description: str + r"""A description of the property.""" + + display_name: Annotated[str, pydantic.Field(alias="displayName")] + r"""The property's display name.""" + + required: bool + r"""The property is required if `True`.""" + + type: PushOptionType + r"""The option type.""" + + options: OptionalNullable[List[PushOptionChoice]] = UNSET + + properties: OptionalNullable[Dict[str, PushOptionProperty]] = UNSET + + validation: Optional[PushValidationInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["options", "properties", "validation"] + nullable_fields = ["options", "properties"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/pushoptiontype.py b/platform/src/codat_platform/models/shared/pushoptiontype.py new file mode 100644 index 000000000..c9c246f2a --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushoptiontype.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushOptionType(str, Enum): + r"""The option type.""" + + ARRAY = "Array" + OBJECT = "Object" + STRING = "String" + NUMBER = "Number" + BOOLEAN = "Boolean" + DATE_TIME = "DateTime" + FILE = "File" + MULTI_PART = "MultiPart" diff --git a/platform/src/codat_platform/models/shared/pushvalidationinfo.py b/platform/src/codat_platform/models/shared/pushvalidationinfo.py new file mode 100644 index 000000000..a65b31042 --- /dev/null +++ b/platform/src/codat_platform/models/shared/pushvalidationinfo.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushfieldvalidation import PushFieldValidation, PushFieldValidationTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class PushValidationInfoTypedDict(TypedDict): + information: NotRequired[Nullable[List[PushFieldValidationTypedDict]]] + warnings: NotRequired[Nullable[List[PushFieldValidationTypedDict]]] + + +class PushValidationInfo(BaseModel): + information: OptionalNullable[List[PushFieldValidation]] = UNSET + + warnings: OptionalNullable[List[PushFieldValidation]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["information", "warnings"] + nullable_fields = ["information", "warnings"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/readcompletedwebhook.py b/platform/src/codat_platform/models/shared/readcompletedwebhook.py new file mode 100644 index 000000000..5d7b1c72b --- /dev/null +++ b/platform/src/codat_platform/models/shared/readcompletedwebhook.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .readcompletedwebhookpayload import ( + ReadCompletedWebhookPayload, + ReadCompletedWebhookPayloadTypedDict, +) +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ReadCompletedWebhookTypedDict(TypedDict): + event_type: NotRequired[str] + r"""The type of event.""" + generated_date: NotRequired[str] + 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: + + ``` + 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. + """ + id: NotRequired[str] + r"""Unique identifier of the event.""" + payload: NotRequired[ReadCompletedWebhookPayloadTypedDict] + + +class ReadCompletedWebhook(BaseModel): + event_type: Annotated[Optional[str], pydantic.Field(alias="eventType")] = None + r"""The type of event.""" + + generated_date: Annotated[Optional[str], pydantic.Field(alias="generatedDate")] = ( + None + ) + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + id: Optional[str] = None + r"""Unique identifier of the event.""" + + payload: Optional[ReadCompletedWebhookPayload] = None diff --git a/platform/src/codat_platform/models/shared/readcompletedwebhookpayload.py b/platform/src/codat_platform/models/shared/readcompletedwebhookpayload.py new file mode 100644 index 000000000..48d653e02 --- /dev/null +++ b/platform/src/codat_platform/models/shared/readcompletedwebhookpayload.py @@ -0,0 +1,97 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .companyreference import CompanyReference, CompanyReferenceTypedDict +from .datatype import DataType +from .status import Status +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataTypesTypedDict(TypedDict): + connection_id: NotRequired[str] + r"""Unique identifier for a company's data connection.""" + data_type: NotRequired[DataType] + r"""Available data types""" + records_modified: NotRequired[bool] + r"""`True` if records have been created, updated or deleted in Codat's cache.""" + status: NotRequired[Status] + r"""The current status of the dataset.""" + + +class DataTypes(BaseModel): + connection_id: Annotated[Optional[str], pydantic.Field(alias="connectionId")] = None + r"""Unique identifier for a company's data connection.""" + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + records_modified: Annotated[ + Optional[bool], pydantic.Field(alias="recordsModified") + ] = None + r"""`True` if records have been created, updated or deleted in Codat's cache.""" + + status: Optional[Status] = None + r"""The current status of the dataset.""" + + +class ReadCompletedWebhookPayloadTypedDict(TypedDict): + data_types: NotRequired[List[DataTypesTypedDict]] + modified_from_date: NotRequired[str] + 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: + + ``` + 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. + """ + reference_company: NotRequired[CompanyReferenceTypedDict] + + +class ReadCompletedWebhookPayload(BaseModel): + data_types: Annotated[ + Optional[List[DataTypes]], pydantic.Field(alias="dataTypes") + ] = None + + modified_from_date: Annotated[ + Optional[str], pydantic.Field(alias="modifiedFromDate") + ] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + reference_company: Annotated[ + Optional[CompanyReference], pydantic.Field(alias="referenceCompany") + ] = None diff --git a/platform/src/codat_platform/models/shared/schema_datatype.py b/platform/src/codat_platform/models/shared/schema_datatype.py new file mode 100644 index 000000000..aa72f531c --- /dev/null +++ b/platform/src/codat_platform/models/shared/schema_datatype.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class SchemaDataType(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" diff --git a/platform/src/codat_platform/models/shared/security.py b/platform/src/codat_platform/models/shared/security.py new file mode 100644 index 000000000..8af319409 --- /dev/null +++ b/platform/src/codat_platform/models/shared/security.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from codat_platform.utils import FieldMetadata, SecurityMetadata +from typing_extensions import Annotated, TypedDict + + +class SecurityTypedDict(TypedDict): + auth_header: str + + +class Security(BaseModel): + auth_header: Annotated[ + str, + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="apiKey", + sub_type="header", + field_name="Authorization", + ) + ), + ] diff --git a/platform/src/codat_platform/models/shared/sourcetype.py b/platform/src/codat_platform/models/shared/sourcetype.py new file mode 100644 index 000000000..91e562513 --- /dev/null +++ b/platform/src/codat_platform/models/shared/sourcetype.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class SourceType(str, Enum): + r"""The type of platform of the connection.""" + + ACCOUNTING = "Accounting" + BANKING = "Banking" + BANK_FEED = "BankFeed" + COMMERCE = "Commerce" + EXPENSE = "Expense" + OTHER = "Other" + UNKNOWN = "Unknown" diff --git a/platform/src/codat_platform/models/shared/status.py b/platform/src/codat_platform/models/shared/status.py new file mode 100644 index 000000000..bab5b3828 --- /dev/null +++ b/platform/src/codat_platform/models/shared/status.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class Status(str, Enum): + r"""The current status of the dataset.""" + + INITIAL = "Initial" + QUEUED = "Queued" + FETCHING = "Fetching" + MAP_QUEUED = "MapQueued" + MAPPING = "Mapping" + COMPLETE = "Complete" + FETCH_ERROR = "FetchError" + MAP_ERROR = "MapError" + INTERNAL_ERROR = "InternalError" + PROCESSING_QUEUED = "ProcessingQueued" + PROCESSING = "Processing" + PROCESSING_ERROR = "ProcessingError" + VALIDATION_QUEUED = "ValidationQueued" + VALIDATING = "Validating" + VALIDATION_ERROR = "ValidationError" + AUTH_ERROR = "AuthError" + CANCELLED = "Cancelled" + NOT_SUPPORTED = "NotSupported" + RATE_LIMIT_ERROR = "RateLimitError" + PERMISSIONS_ERROR = "PermissionsError" + PREREQUISITE_NOT_MET = "PrerequisiteNotMet" diff --git a/platform/src/codat_platform/models/shared/supplementaldataconfiguration.py b/platform/src/codat_platform/models/shared/supplementaldataconfiguration.py new file mode 100644 index 000000000..79eef434d --- /dev/null +++ b/platform/src/codat_platform/models/shared/supplementaldataconfiguration.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +import pydantic +from typing import Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SupplementalDataSourceConfigurationTypedDict(TypedDict): + r"""The client's defined name for the object.""" + + data_source: NotRequired[str] + r"""The underlying endpoint of the source system which the configuration is targeting.""" + pull_data: NotRequired[Dict[str, str]] + r"""The additional properties that are required when pulling records.""" + push_data: NotRequired[Dict[str, str]] + r"""The additional properties that are required to create and/or update records.""" + + +class SupplementalDataSourceConfiguration(BaseModel): + r"""The client's defined name for the object.""" + + data_source: Annotated[Optional[str], pydantic.Field(alias="dataSource")] = None + r"""The underlying endpoint of the source system which the configuration is targeting.""" + + pull_data: Annotated[Optional[Dict[str, str]], pydantic.Field(alias="pullData")] = ( + None + ) + r"""The additional properties that are required when pulling records.""" + + push_data: Annotated[Optional[Dict[str, str]], pydantic.Field(alias="pushData")] = ( + None + ) + r"""The additional properties that are required to create and/or update records.""" + + +class SupplementalDataConfigurationTypedDict(TypedDict): + supplemental_data_config: NotRequired[ + Dict[str, SupplementalDataSourceConfigurationTypedDict] + ] + + +class SupplementalDataConfiguration(BaseModel): + supplemental_data_config: Annotated[ + Optional[Dict[str, SupplementalDataSourceConfiguration]], + pydantic.Field(alias="supplementalDataConfig"), + ] = None diff --git a/platform/src/codat_platform/models/shared/supportedfeature.py b/platform/src/codat_platform/models/shared/supportedfeature.py new file mode 100644 index 000000000..ed2b82c46 --- /dev/null +++ b/platform/src/codat_platform/models/shared/supportedfeature.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .featurestate import FeatureState +from .featuretype import FeatureType +from codat_platform.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class SupportedFeatureTypedDict(TypedDict): + feature_state: FeatureState + r"""The current release state of the feature.""" + feature_type: FeatureType + r"""The type of feature.""" + + +class SupportedFeature(BaseModel): + feature_state: Annotated[FeatureState, pydantic.Field(alias="featureState")] + r"""The current release state of the feature.""" + + feature_type: Annotated[FeatureType, pydantic.Field(alias="featureType")] + r"""The type of feature.""" diff --git a/platform/src/codat_platform/models/shared/syncsetting.py b/platform/src/codat_platform/models/shared/syncsetting.py new file mode 100644 index 000000000..494d45bfa --- /dev/null +++ b/platform/src/codat_platform/models/shared/syncsetting.py @@ -0,0 +1,99 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SyncSettingTypedDict(TypedDict): + 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 + r"""Available data types""" + fetch_on_first_link: bool + r"""Whether this data type should be queued after a company has authorized a connection.""" + sync_order: int + r"""The sync in which data types are queued for a sync.""" + sync_schedule: int + r"""Number of hours after which this data type should be refreshed.""" + is_locked: NotRequired[bool] + r"""`True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked.""" + months_to_sync: NotRequired[int] + r"""Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only.""" + sync_from_utc: NotRequired[str] + 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: + + ``` + 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. + """ + sync_from_window: NotRequired[int] + r"""Number of months of data to be fetched. Set this *or* `syncFromUTC`.""" + + +class SyncSetting(BaseModel): + r"""Describes how often, and how much history, should be fetched for the given data type when a pull operation is queued.""" + + data_type: Annotated[DataType, pydantic.Field(alias="dataType")] + r"""Available data types""" + + fetch_on_first_link: Annotated[bool, pydantic.Field(alias="fetchOnFirstLink")] + r"""Whether this data type should be queued after a company has authorized a connection.""" + + sync_order: Annotated[int, pydantic.Field(alias="syncOrder")] + r"""The sync in which data types are queued for a sync.""" + + sync_schedule: Annotated[int, pydantic.Field(alias="syncSchedule")] + r"""Number of hours after which this data type should be refreshed.""" + + is_locked: Annotated[Optional[bool], pydantic.Field(alias="isLocked")] = None + r"""`True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked.""" + + months_to_sync: Annotated[Optional[int], pydantic.Field(alias="monthsToSync")] = ( + None + ) + r"""Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only.""" + + sync_from_utc: Annotated[Optional[str], pydantic.Field(alias="syncFromUtc")] = None + r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 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. + """ + + sync_from_window: Annotated[ + Optional[int], pydantic.Field(alias="syncFromWindow") + ] = None + r"""Number of months of data to be fetched. Set this *or* `syncFromUTC`.""" diff --git a/platform/src/codat_platform/models/shared/syncsettings.py b/platform/src/codat_platform/models/shared/syncsettings.py new file mode 100644 index 000000000..44318d1d3 --- /dev/null +++ b/platform/src/codat_platform/models/shared/syncsettings.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .syncsetting import SyncSetting, SyncSettingTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SyncSettingsTypedDict(TypedDict): + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + overrides_defaults: NotRequired[bool] + r"""Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings).""" + settings: NotRequired[List[SyncSettingTypedDict]] + + +class SyncSettings(BaseModel): + client_id: Annotated[Optional[str], pydantic.Field(alias="clientId")] = None + r"""Unique identifier for your client in Codat.""" + + overrides_defaults: Annotated[ + Optional[bool], pydantic.Field(alias="overridesDefaults") + ] = None + r"""Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings).""" + + settings: Optional[List[SyncSetting]] = None diff --git a/platform/src/codat_platform/models/shared/updateconnectionstatus.py b/platform/src/codat_platform/models/shared/updateconnectionstatus.py new file mode 100644 index 000000000..2ef67c494 --- /dev/null +++ b/platform/src/codat_platform/models/shared/updateconnectionstatus.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .dataconnectionstatus import DataConnectionStatus +from codat_platform.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class UpdateConnectionStatusTypedDict(TypedDict): + status: NotRequired[DataConnectionStatus] + r"""The current authorization status of the data connection.""" + + +class UpdateConnectionStatus(BaseModel): + status: Optional[DataConnectionStatus] = None + r"""The current authorization status of the data connection.""" diff --git a/platform/src/codat_platform/models/shared/validation.py b/platform/src/codat_platform/models/shared/validation.py new file mode 100644 index 000000000..3dc278a6d --- /dev/null +++ b/platform/src/codat_platform/models/shared/validation.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .validationitem import ValidationItem, ValidationItemTypedDict +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ValidationTypedDict(TypedDict): + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + errors: NotRequired[Nullable[List[ValidationItemTypedDict]]] + warnings: NotRequired[Nullable[List[ValidationItemTypedDict]]] + + +class Validation(BaseModel): + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + errors: OptionalNullable[List[ValidationItem]] = UNSET + + warnings: OptionalNullable[List[ValidationItem]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["errors", "warnings"] + nullable_fields = ["errors", "warnings"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/validationitem.py b/platform/src/codat_platform/models/shared/validationitem.py new file mode 100644 index 000000000..77a24c957 --- /dev/null +++ b/platform/src/codat_platform/models/shared/validationitem.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ValidationItemTypedDict(TypedDict): + item_id: NotRequired[Nullable[str]] + r"""Unique identifier for a validation item.""" + message: NotRequired[Nullable[str]] + r"""A message outlining validation item's issue.""" + validator_name: NotRequired[Nullable[str]] + r"""Name of validator.""" + + +class ValidationItem(BaseModel): + item_id: Annotated[OptionalNullable[str], pydantic.Field(alias="itemId")] = UNSET + r"""Unique identifier for a validation item.""" + + message: OptionalNullable[str] = UNSET + r"""A message outlining validation item's issue.""" + + validator_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="validatorName") + ] = UNSET + r"""Name of validator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["itemId", "message", "validatorName"] + nullable_fields = ["itemId", "message", "validatorName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/webhook.py b/platform/src/codat_platform/models/shared/webhook.py new file mode 100644 index 000000000..ec24b5d33 --- /dev/null +++ b/platform/src/codat_platform/models/shared/webhook.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .webhooknotifier import WebhookNotifier, WebhookNotifierTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WebhookTypedDict(TypedDict): + r"""Configuration to provide an event notification to a URL or list of email addresses based on the given type or condition.""" + + notifiers: WebhookNotifierTypedDict + type: str + r"""The type of webhook.""" + company_id: NotRequired[str] + r"""Unique identifier for your SMB in Codat.""" + id: NotRequired[str] + r"""Unique identifier for the configured notification.""" + + +class Webhook(BaseModel): + r"""Configuration to provide an event notification to a URL or list of email addresses based on the given type or condition.""" + + notifiers: WebhookNotifier + + type: str + r"""The type of webhook.""" + + company_id: Annotated[Optional[str], pydantic.Field(alias="companyId")] = None + r"""Unique identifier for your SMB in Codat.""" + + id: Optional[str] = None + r"""Unique identifier for the configured notification.""" diff --git a/platform/src/codat_platform/models/shared/webhookconsumer.py b/platform/src/codat_platform/models/shared/webhookconsumer.py new file mode 100644 index 000000000..214c0b947 --- /dev/null +++ b/platform/src/codat_platform/models/shared/webhookconsumer.py @@ -0,0 +1,108 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WebhookConsumerTypedDict(TypedDict): + 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). + + """ + + company_id: NotRequired[Nullable[str]] + r"""Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID.""" + company_tags: NotRequired[List[str]] + r"""Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`.""" + disabled: NotRequired[Nullable[bool]] + r"""Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`.""" + event_types: NotRequired[List[str]] + r"""An array of event types the webhook consumer subscribes to.""" + id: NotRequired[str] + r"""Unique identifier for the webhook consumer.""" + url: NotRequired[str] + r"""The URL that will consume webhook events dispatched by Codat.""" + + +class WebhookConsumer(BaseModel): + 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). + + """ + + company_id: Annotated[ + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="companyId", + ), + ] = UNSET + r"""Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID.""" + + company_tags: Annotated[ + Optional[List[str]], pydantic.Field(alias="companyTags") + ] = None + r"""Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`.""" + + disabled: OptionalNullable[bool] = False + r"""Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`.""" + + event_types: Annotated[Optional[List[str]], pydantic.Field(alias="eventTypes")] = ( + None + ) + r"""An array of event types the webhook consumer subscribes to.""" + + id: Optional[str] = None + r"""Unique identifier for the webhook consumer.""" + + url: Optional[str] = None + r"""The URL that will consume webhook events dispatched by Codat.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "companyId", + "companyTags", + "disabled", + "eventTypes", + "id", + "url", + ] + nullable_fields = ["companyId", "disabled"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/webhookconsumerprototype.py b/platform/src/codat_platform/models/shared/webhookconsumerprototype.py new file mode 100644 index 000000000..8f1c5325f --- /dev/null +++ b/platform/src/codat_platform/models/shared/webhookconsumerprototype.py @@ -0,0 +1,84 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WebhookConsumerPrototypeTypedDict(TypedDict): + company_id: NotRequired[Nullable[str]] + r"""Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID.""" + company_tags: NotRequired[List[str]] + r"""Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`.""" + disabled: NotRequired[Nullable[bool]] + r"""Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`.""" + event_types: NotRequired[List[str]] + r"""An array of event types the webhook consumer subscribes to.""" + url: NotRequired[str] + r"""The URL that will consume webhook events dispatched by Codat.""" + + +class WebhookConsumerPrototype(BaseModel): + company_id: Annotated[ + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="companyId", + ), + ] = UNSET + r"""Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID.""" + + company_tags: Annotated[ + Optional[List[str]], pydantic.Field(alias="companyTags") + ] = None + r"""Company tags provide an additional way to filter messages, independent of event types. Company tags are case-sensitive, and only messages from companies with matching tags will be sent to this endpoint. Use the format `tagKey:tagValue`.""" + + disabled: OptionalNullable[bool] = False + r"""Flag that enables or disables the endpoint from receiving events. Disabled when set to `true`.""" + + event_types: Annotated[Optional[List[str]], pydantic.Field(alias="eventTypes")] = ( + None + ) + r"""An array of event types the webhook consumer subscribes to.""" + + url: Optional[str] = None + r"""The URL that will consume webhook events dispatched by Codat.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["companyId", "companyTags", "disabled", "eventTypes", "url"] + nullable_fields = ["companyId", "disabled"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/platform/src/codat_platform/models/shared/webhookconsumers.py b/platform/src/codat_platform/models/shared/webhookconsumers.py new file mode 100644 index 000000000..91477e3eb --- /dev/null +++ b/platform/src/codat_platform/models/shared/webhookconsumers.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .webhookconsumer import WebhookConsumer, WebhookConsumerTypedDict +from codat_platform.types import BaseModel +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class WebhookConsumersTypedDict(TypedDict): + results: NotRequired[List[WebhookConsumerTypedDict]] + + +class WebhookConsumers(BaseModel): + results: Optional[List[WebhookConsumer]] = None diff --git a/platform/src/codat_platform/models/shared/webhooknotifier.py b/platform/src/codat_platform/models/shared/webhooknotifier.py new file mode 100644 index 000000000..26f63d9c7 --- /dev/null +++ b/platform/src/codat_platform/models/shared/webhooknotifier.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_platform.types import BaseModel +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class WebhookNotifierTypedDict(TypedDict): + emails: NotRequired[List[str]] + webhook: NotRequired[str] + r"""The URI the webhook service will use to post events.""" + + +class WebhookNotifier(BaseModel): + emails: Optional[List[str]] = None + + webhook: Optional[str] = None + r"""The URI the webhook service will use to post events.""" diff --git a/platform/src/codat_platform/models/shared/webhooks.py b/platform/src/codat_platform/models/shared/webhooks.py new file mode 100644 index 000000000..181611d0f --- /dev/null +++ b/platform/src/codat_platform/models/shared/webhooks.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .webhook import Webhook, WebhookTypedDict +from codat_platform.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class WebhooksTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[WebhookTypedDict]] + + +class Webhooks(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Webhook]] = None diff --git a/platform/src/codat_platform/models/shared/writestatus.py b/platform/src/codat_platform/models/shared/writestatus.py new file mode 100644 index 000000000..829347fac --- /dev/null +++ b/platform/src/codat_platform/models/shared/writestatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class WriteStatus(str, Enum): + r"""The current status of the write request, which is the same as the push operation status.""" + + PENDING = "Pending" + FAILED = "Failed" + SUCCESS = "Success" + TIMED_OUT = "TimedOut" diff --git a/platform/src/codat_platform/models/shared/writetype.py b/platform/src/codat_platform/models/shared/writetype.py new file mode 100644 index 000000000..90270e798 --- /dev/null +++ b/platform/src/codat_platform/models/shared/writetype.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class WriteType(str, Enum): + r"""Type of write request.""" + + CREATE = "Create" + UPDATE = "Update" + DELETE = "Delete" + UPLOAD_ATTACHMENT = "UploadAttachment" diff --git a/platform/src/codat_platform/push_data.py b/platform/src/codat_platform/push_data.py new file mode 100644 index 000000000..cb7fd2bf1 --- /dev/null +++ b/platform/src/codat_platform/push_data.py @@ -0,0 +1,674 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class PushData(BaseSDK): + r"""Initiate and monitor Create, Update, and Delete operations.""" + + def get_model_options( + self, + *, + request: Union[ + operations.GetCreateUpdateModelOptionsByDataTypeRequest, + operations.GetCreateUpdateModelOptionsByDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get push options + + This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. + + Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. + + Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented \"options\" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. + + + > **Supported Integrations** + > + > Check out our [coverage explorer](https://knowledge.codat.io/) for integrations that support push (POST/PUT methods). + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCreateUpdateModelOptionsByDataTypeRequest + ) + request = cast(operations.GetCreateUpdateModelOptionsByDataTypeRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/{dataType}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-create-update-model-options-by-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_model_options_async( + self, + *, + request: Union[ + operations.GetCreateUpdateModelOptionsByDataTypeRequest, + operations.GetCreateUpdateModelOptionsByDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get push options + + This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. + + Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting software. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. + + Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented \"options\" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. + + + > **Supported Integrations** + > + > Check out our [coverage explorer](https://knowledge.codat.io/) for integrations that support push (POST/PUT methods). + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCreateUpdateModelOptionsByDataTypeRequest + ) + request = cast(operations.GetCreateUpdateModelOptionsByDataTypeRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/{dataType}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-create-update-model-options-by-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_operation( + self, + *, + request: Union[ + operations.GetPushOperationRequest, + operations.GetPushOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Get push operation + + The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. + + Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPushOperationRequest) + request = cast(operations.GetPushOperationRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/push/{pushOperationKey}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-push-operation", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_operation_async( + self, + *, + request: Union[ + operations.GetPushOperationRequest, + operations.GetPushOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Get push operation + + The **Get push operation** endpoint returns a specific [push operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. + + Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPushOperationRequest) + request = cast(operations.GetPushOperationRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/push/{pushOperationKey}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-push-operation", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def list_operations( + self, + *, + request: Union[ + operations.GetCompanyPushHistoryRequest, + operations.GetCompanyPushHistoryRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperations]: + r"""List push operations + + The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. + + Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyPushHistoryRequest) + request = cast(operations.GetCompanyPushHistoryRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/push", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-company-push-history", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOperations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_operations_async( + self, + *, + request: Union[ + operations.GetCompanyPushHistoryRequest, + operations.GetCompanyPushHistoryRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperations]: + r"""List push operations + + The **List push operations** endpoint returns a list of [push operations](/using-the-api/push) performed on the company. + + Write operations are actions that send requests to Codat, enabling the creation, updating, deletion of records, or uploading attachments in the connected accounting software. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyPushHistoryRequest) + request = cast(operations.GetCompanyPushHistoryRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/push", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-company-push-history", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOperations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/py.typed b/platform/src/codat_platform/py.typed new file mode 100644 index 000000000..3e38f1a92 --- /dev/null +++ b/platform/src/codat_platform/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. The package enables type hints. diff --git a/platform/src/codat_platform/refresh_data.py b/platform/src/codat_platform/refresh_data.py new file mode 100644 index 000000000..b3f0d33bc --- /dev/null +++ b/platform/src/codat_platform/refresh_data.py @@ -0,0 +1,1076 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class RefreshData(BaseSDK): + r"""Initiate data refreshes, view pull status and history.""" + + def all( + self, + *, + request: Union[ + operations.RefreshCompanyDataRequest, + operations.RefreshCompanyDataRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Refresh all data + + Refreshes all data types with `fetch on first link` set to `true` for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshCompanyDataRequest) + request = cast(operations.RefreshCompanyDataRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/data/all", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="refresh-company-data", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def all_async( + self, + *, + request: Union[ + operations.RefreshCompanyDataRequest, + operations.RefreshCompanyDataRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Refresh all data + + Refreshes all data types with `fetch on first link` set to `true` for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshCompanyDataRequest) + request = cast(operations.RefreshCompanyDataRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/data/all", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="refresh-company-data", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def by_data_type( + self, + *, + request: Union[ + operations.RefreshDataTypeRequest, + operations.RefreshDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Refresh data type + + Refreshes a given data type for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshDataTypeRequest) + request = cast(operations.RefreshDataTypeRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/data/queue/{dataType}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="refresh-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def by_data_type_async( + self, + *, + request: Union[ + operations.RefreshDataTypeRequest, + operations.RefreshDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Refresh data type + + Refreshes a given data type for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RefreshDataTypeRequest) + request = cast(operations.RefreshDataTypeRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/data/queue/{dataType}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="refresh-data-type", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get( + self, + *, + request: Union[ + operations.GetCompanyDataStatusRequest, + operations.GetCompanyDataStatusRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.DataStatuses]: + r"""Get data status + + Get the state of each data type for a company + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyDataStatusRequest) + request = cast(operations.GetCompanyDataStatusRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/dataStatus", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-company-data-status", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.DataStatuses]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + request: Union[ + operations.GetCompanyDataStatusRequest, + operations.GetCompanyDataStatusRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.DataStatuses]: + r"""Get data status + + Get the state of each data type for a company + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyDataStatusRequest) + request = cast(operations.GetCompanyDataStatusRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/dataStatus", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-company-data-status", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.DataStatuses]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_pull_operation( + self, + *, + request: Union[ + operations.GetPullOperationRequest, + operations.GetPullOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Get pull operation + + Retrieve information about a single dataset or pull operation. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPullOperationRequest) + request = cast(operations.GetPullOperationRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/history/{datasetId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-pull-operation", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_pull_operation_async( + self, + *, + request: Union[ + operations.GetPullOperationRequest, + operations.GetPullOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Get pull operation + + Retrieve information about a single dataset or pull operation. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetPullOperationRequest) + request = cast(operations.GetPullOperationRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/history/{datasetId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-pull-operation", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def list_pull_operations( + self, + *, + request: Union[ + operations.ListPullOperationsRequest, + operations.ListPullOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperations]: + r"""List pull operations + + Gets the pull operation history (datasets) for a given company. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListPullOperationsRequest) + request = cast(operations.ListPullOperationsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/history", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="list-pull-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_pull_operations_async( + self, + *, + request: Union[ + operations.ListPullOperationsRequest, + operations.ListPullOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperations]: + r"""List pull operations + + Gets the pull operation history (datasets) for a given company. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListPullOperationsRequest) + request = cast(operations.ListPullOperationsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/history", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="list-pull-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PullOperations]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codatplatform/sdk.py b/platform/src/codat_platform/sdk.py similarity index 52% rename from platform/src/codatplatform/sdk.py rename to platform/src/codat_platform/sdk.py index ac2f948cc..8942f51c8 100644 --- a/platform/src/codatplatform/sdk.py +++ b/platform/src/codat_platform/sdk.py @@ -1,31 +1,36 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .companies import Companies -from .connection_management import ConnectionManagement -from .connections import Connections -from .custom_data_type import CustomDataType -from .groups import Groups -from .integrations import Integrations -from .push_data import PushData -from .refresh_data import RefreshData +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from .httpclient import AsyncHttpClient, HttpClient from .sdkconfiguration import SDKConfiguration -from .settings import Settings -from .supplemental_data import SupplementalData +from .utils.logger import Logger, get_default_logger from .utils.retries import RetryConfig -from .webhooks import Webhooks -from codatplatform import utils -from codatplatform._hooks import SDKHooks -from codatplatform.models import shared +from codat_platform import utils +from codat_platform._hooks import SDKHooks +from codat_platform.companies import Companies +from codat_platform.connection_management import ConnectionManagement +from codat_platform.connections import Connections +from codat_platform.custom_data_type import CustomDataType +from codat_platform.integrations import Integrations +from codat_platform.models import shared +from codat_platform.push_data import PushData +from codat_platform.refresh_data import RefreshData +from codat_platform.settings import Settings +from codat_platform.supplemental_data import SupplementalData +from codat_platform.types import OptionalNullable, UNSET +from codat_platform.webhooks import Webhooks +import httpx from typing import Callable, Dict, Optional, Union -class CodatPlatform: + +class CodatPlatform(BaseSDK): r"""Platform API: Platform API + An API for the common components of all of Codat's products. These end points cover creating and managing your companies, data connections, and integrations. - [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) + [Read about the building blocks of Codat...](https://docs.codat.io/core-concepts/companies) | [See our OpenAPI spec](https://github.com/codatio/oas) --- @@ -36,7 +41,6 @@ class CodatPlatform: | Companies | Create and manage your SMB users' companies. | | Connections | Create new and manage existing data connections for a company. | | Connection management | Configure connection management UI and retrieve access tokens for authentication. | - | Groups | Define and manage sets of companies based on a chosen characteristic. | | Webhooks | Create and manage webhooks that listen to Codat's events. | | Integrations | Get a list of integrations supported by Codat and their logos. | | Refresh data | Initiate data refreshes, view pull status and history. | @@ -46,12 +50,13 @@ class CodatPlatform: | Custom data type | Configure and pull additional data types that are not included in Codat's standardized data model. | """ + settings: Settings r"""Manage company profile configuration, sync settings, and API keys.""" companies: Companies r"""Create and manage your SMB users' companies.""" connection_management: ConnectionManagement - r"""Configure connection management UI and retrieve access tokens for authentication.""" + r"""Configure UI and retrieve access tokens for authentication used by **Connections SDK**.""" connections: Connections r"""Create new and manage existing data connections for a company.""" custom_data_type: CustomDataType @@ -60,8 +65,6 @@ class CodatPlatform: r"""Initiate and monitor Create, Update, and Delete operations.""" refresh_data: RefreshData r"""Initiate data refreshes, view pull status and history.""" - groups: Groups - r"""Define and manage sets of companies based on a chosen characteristic.""" integrations: Integrations r"""Get a list of integrations supported by Codat and their logos.""" supplemental_data: SupplementalData @@ -69,60 +72,78 @@ class CodatPlatform: webhooks: Webhooks r"""Create and manage webhooks that listen to Codat's events.""" - sdk_configuration: SDKConfiguration - - def __init__(self, - security: Union[shared.Security,Callable[[], shared.Security]] = None, - server_idx: Optional[int] = None, - server_url: Optional[str] = None, - url_params: Optional[Dict[str, str]] = None, - client: Optional[requests_http.Session] = None, - retry_config: Optional[RetryConfig] = None - ) -> None: - """Instantiates the SDK configuring it with the provided parameters. + def __init__( + self, + security: Union[shared.Security, Callable[[], shared.Security]], + server_idx: Optional[int] = None, + server_url: Optional[str] = None, + url_params: Optional[Dict[str, str]] = None, + client: Optional[HttpClient] = None, + async_client: Optional[AsyncHttpClient] = None, + retry_config: OptionalNullable[RetryConfig] = UNSET, + timeout_ms: Optional[int] = None, + debug_logger: Optional[Logger] = None, + ) -> None: + r"""Instantiates the SDK configuring it with the provided parameters. :param security: The security details required for authentication - :type security: Union[shared.Security,Callable[[], shared.Security]] - :param server_idx: The index of the server to use for all operations - :type server_idx: int - :param server_url: The server URL to use for all operations - :type server_url: str + :param server_idx: The index of the server to use for all methods + :param server_url: The server URL to use for all methods :param url_params: Parameters to optionally template the server URL with - :type url_params: Dict[str, str] - :param client: The requests.Session HTTP client to use for all operations - :type client: requests_http.Session - :param retry_config: The utils.RetryConfig to use globally - :type retry_config: RetryConfig + :param client: The HTTP client to use for all synchronous methods + :param async_client: The Async HTTP client to use for all asynchronous methods + :param retry_config: The retry configuration to use for all supported methods + :param timeout_ms: Optional request timeout applied to each operation in milliseconds """ if client is None: - client = requests_http.Session() + client = httpx.Client() + + assert issubclass( + type(client), HttpClient + ), "The provided client must implement the HttpClient protocol." + + if async_client is None: + async_client = httpx.AsyncClient() + + if debug_logger is None: + debug_logger = get_default_logger() + + assert issubclass( + type(async_client), AsyncHttpClient + ), "The provided async_client must implement the AsyncHttpClient protocol." if server_url is not None: if url_params is not None: server_url = utils.template_url(server_url, url_params) - - - self.sdk_configuration = SDKConfiguration( - client, - security, - server_url, - server_idx, - retry_config=retry_config + + BaseSDK.__init__( + self, + SDKConfiguration( + client=client, + async_client=async_client, + security=security, + server_url=server_url, + server_idx=server_idx, + retry_config=retry_config, + timeout_ms=timeout_ms, + debug_logger=debug_logger, + ), ) 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) + 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.__dict__['_hooks'] = hooks + self.sdk_configuration.__dict__["_hooks"] = hooks self._init_sdks() - def _init_sdks(self): self.settings = Settings(self.sdk_configuration) self.companies = Companies(self.sdk_configuration) @@ -131,7 +152,20 @@ def _init_sdks(self): self.custom_data_type = CustomDataType(self.sdk_configuration) self.push_data = PushData(self.sdk_configuration) self.refresh_data = RefreshData(self.sdk_configuration) - self.groups = Groups(self.sdk_configuration) self.integrations = Integrations(self.sdk_configuration) self.supplemental_data = SupplementalData(self.sdk_configuration) self.webhooks = Webhooks(self.sdk_configuration) + + def __enter__(self): + return self + + async def __aenter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if self.sdk_configuration.client is not None: + self.sdk_configuration.client.close() + + async def __aexit__(self, exc_type, exc_val, exc_tb): + if self.sdk_configuration.async_client is not None: + await self.sdk_configuration.async_client.aclose() diff --git a/platform/src/codat_platform/sdkconfiguration.py b/platform/src/codat_platform/sdkconfiguration.py new file mode 100644 index 000000000..e300ff8af --- /dev/null +++ b/platform/src/codat_platform/sdkconfiguration.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._hooks import SDKHooks +from .httpclient import AsyncHttpClient, HttpClient +from .utils import Logger, RetryConfig, remove_suffix +from codat_platform.models import shared +from codat_platform.types import OptionalNullable, UNSET +from dataclasses import dataclass +from pydantic import Field +from typing import Callable, Dict, Optional, Tuple, Union + + +SERVERS = [ + "https://api.codat.io", + # Production +] +"""Contains the list of servers available to the SDK""" + + +@dataclass +class SDKConfiguration: + client: HttpClient + async_client: AsyncHttpClient + debug_logger: Logger + security: Optional[Union[shared.Security, Callable[[], shared.Security]]] = None + server_url: Optional[str] = "" + server_idx: Optional[int] = 0 + language: str = "python" + openapi_doc_version: str = "3.0.0" + sdk_version: str = "4.0.0" + gen_version: str = "2.462.1" + user_agent: str = "speakeasy-sdk/python 4.0.0 2.462.1 3.0.0 codat-platform" + retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) + timeout_ms: Optional[int] = None + + def __post_init__(self): + self._hooks = SDKHooks() + + def get_server_details(self) -> Tuple[str, Dict[str, str]]: + if self.server_url is not None and self.server_url: + return remove_suffix(self.server_url, "/"), {} + if self.server_idx is None: + self.server_idx = 0 + + return SERVERS[self.server_idx], {} + + def get_hooks(self) -> SDKHooks: + return self._hooks diff --git a/platform/src/codat_platform/settings.py b/platform/src/codat_platform/settings.py new file mode 100644 index 000000000..c67c239f2 --- /dev/null +++ b/platform/src/codat_platform/settings.py @@ -0,0 +1,1378 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Settings(BaseSDK): + r"""Manage company profile configuration, sync settings, and API keys.""" + + def create_api_key( + self, + *, + request: Optional[ + Union[shared.CreateAPIKey, shared.CreateAPIKeyTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.APIKeyDetails]: + r"""Create API key + + Use the *Create API keys* endpoint to generate a new API key for your client. + + [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. + + 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. + + ### Tips and pitfalls + + * Your first API key is created for you. Access this key via [Codat's Portal](https://app.codat.io/developers/api-keys). + * 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.CreateAPIKey]) + request = cast(Optional[shared.CreateAPIKey], request) + + req = self.build_request( + method="POST", + path="/apiKeys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.CreateAPIKey] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="create-api-key", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.APIKeyDetails]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_api_key_async( + self, + *, + request: Optional[ + Union[shared.CreateAPIKey, shared.CreateAPIKeyTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.APIKeyDetails]: + r"""Create API key + + Use the *Create API keys* endpoint to generate a new API key for your client. + + [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. + + 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. + + ### Tips and pitfalls + + * Your first API key is created for you. Access this key via [Codat's Portal](https://app.codat.io/developers/api-keys). + * 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.CreateAPIKey]) + request = cast(Optional[shared.CreateAPIKey], request) + + req = self.build_request_async( + method="POST", + path="/apiKeys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.CreateAPIKey] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="create-api-key", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.APIKeyDetails]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def delete_api_key( + self, + *, + request: Union[ + operations.DeleteAPIKeyRequest, operations.DeleteAPIKeyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.ErrorMessage]: + r"""Delete API key + + Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. + + [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. + + 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. + + ### Tips and pitfalls + + * 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteAPIKeyRequest) + request = cast(operations.DeleteAPIKeyRequest, request) + + req = self.build_request( + method="DELETE", + path="/apiKeys/{apiKeyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="delete-api-key", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def delete_api_key_async( + self, + *, + request: Union[ + operations.DeleteAPIKeyRequest, operations.DeleteAPIKeyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.ErrorMessage]: + r"""Delete API key + + Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. + + [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. + + 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. + + ### Tips and pitfalls + + * 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. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteAPIKeyRequest) + request = cast(operations.DeleteAPIKeyRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/apiKeys/{apiKeyId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="delete-api-key", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_profile( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Profile]: + r"""Get profile + + Fetch your Codat profile. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request( + method="GET", + path="/profile", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-profile", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Profile]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_profile_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Profile]: + r"""Get profile + + Fetch your Codat profile. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request_async( + method="GET", + path="/profile", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-profile", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Profile]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_sync_settings( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.SyncSettings]: + 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. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request( + method="GET", + path="/profile/syncSettings", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-profile-syncSettings", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.SyncSettings]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_sync_settings_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.SyncSettings]: + 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. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request_async( + method="GET", + path="/profile/syncSettings", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-profile-syncSettings", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.SyncSettings]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def list_api_keys( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.APIKeys]: + r"""List API keys + + Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. + + [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. + + 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. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request( + method="GET", + path="/apiKeys", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="list-api-keys", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.APIKeys]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_api_keys_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.APIKeys]: + r"""List API keys + + Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. + + [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. + + 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. + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request_async( + method="GET", + path="/apiKeys", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="list-api-keys", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.APIKeys]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def update_profile( + self, + *, + request: Optional[Union[shared.Profile, shared.ProfileTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Profile]: + r"""Update profile + + Update your Codat profile + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.Profile]) + request = cast(Optional[shared.Profile], request) + + req = self.build_request( + method="PUT", + path="/profile", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.Profile] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="update-profile", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Profile]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def update_profile_async( + self, + *, + request: Optional[Union[shared.Profile, shared.ProfileTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Profile]: + r"""Update profile + + Update your Codat profile + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.Profile]) + request = cast(Optional[shared.Profile], request) + + req = self.build_request_async( + method="PUT", + path="/profile", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.Profile] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="update-profile", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Profile]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def update_sync_settings( + self, + *, + request: Optional[ + Union[ + operations.UpdateProfileSyncSettingsRequestBody, + operations.UpdateProfileSyncSettingsRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Update all sync settings + + Update sync settings for all data types. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[operations.UpdateProfileSyncSettingsRequestBody] + ) + request = cast( + Optional[operations.UpdateProfileSyncSettingsRequestBody], request + ) + + req = self.build_request( + method="POST", + path="/profile/syncSettings", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[operations.UpdateProfileSyncSettingsRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="update-profile-syncSettings", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def update_sync_settings_async( + self, + *, + request: Optional[ + Union[ + operations.UpdateProfileSyncSettingsRequestBody, + operations.UpdateProfileSyncSettingsRequestBodyTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Update all sync settings + + Update sync settings for all data types. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[operations.UpdateProfileSyncSettingsRequestBody] + ) + request = cast( + Optional[operations.UpdateProfileSyncSettingsRequestBody], request + ) + + req = self.build_request_async( + method="POST", + path="/profile/syncSettings", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, + False, + True, + "json", + Optional[operations.UpdateProfileSyncSettingsRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="update-profile-syncSettings", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/supplemental_data.py b/platform/src/codat_platform/supplemental_data.py new file mode 100644 index 000000000..8069b79f1 --- /dev/null +++ b/platform/src/codat_platform/supplemental_data.py @@ -0,0 +1,472 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class SupplementalData(BaseSDK): + r"""Configure and pull additional data you can include in Codat's standard data types.""" + + def configure( + self, + *, + request: Union[ + operations.ConfigureSupplementalDataRequest, + operations.ConfigureSupplementalDataRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Configure + + The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. + + [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. + + **Integration-specific behaviour** + See the *examples* for integration-specific frequently requested properties. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.ConfigureSupplementalDataRequest + ) + request = cast(operations.ConfigureSupplementalDataRequest, request) + + req = self.build_request( + method="PUT", + path="/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.supplemental_data_configuration, + False, + True, + "json", + Optional[shared.SupplementalDataConfiguration], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="configure-supplemental-data", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def configure_async( + self, + *, + request: Union[ + operations.ConfigureSupplementalDataRequest, + operations.ConfigureSupplementalDataRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Configure + + The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. + + [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. + + **Integration-specific behaviour** + See the *examples* for integration-specific frequently requested properties. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.ConfigureSupplementalDataRequest + ) + request = cast(operations.ConfigureSupplementalDataRequest, request) + + req = self.build_request_async( + method="PUT", + path="/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.supplemental_data_configuration, + False, + True, + "json", + Optional[shared.SupplementalDataConfiguration], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="configure-supplemental-data", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def get_configuration( + self, + *, + request: Union[ + operations.GetSupplementalDataConfigurationRequest, + operations.GetSupplementalDataConfigurationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.SupplementalDataConfiguration]: + r"""Get configuration + + The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. + + [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetSupplementalDataConfigurationRequest + ) + request = cast(operations.GetSupplementalDataConfigurationRequest, request) + + req = self.build_request( + method="GET", + path="/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-supplemental-data-configuration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.SupplementalDataConfiguration] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_configuration_async( + self, + *, + request: Union[ + operations.GetSupplementalDataConfigurationRequest, + operations.GetSupplementalDataConfigurationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.SupplementalDataConfiguration]: + r"""Get configuration + + The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. + + [Supplemental data](https://docs.codat.io/using-the-api/supplemental-data/overview) is additional data you can include in Codat's standard data types. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetSupplementalDataConfigurationRequest + ) + request = cast(operations.GetSupplementalDataConfigurationRequest, request) + + req = self.build_request_async( + method="GET", + path="/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-supplemental-data-configuration", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.SupplementalDataConfiguration] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codat_platform/types/__init__.py b/platform/src/codat_platform/types/__init__.py new file mode 100644 index 000000000..fc76fe0c5 --- /dev/null +++ b/platform/src/codat_platform/types/__init__.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basemodel import ( + BaseModel, + Nullable, + OptionalNullable, + UnrecognizedInt, + UnrecognizedStr, + UNSET, + UNSET_SENTINEL, +) + +__all__ = [ + "BaseModel", + "Nullable", + "OptionalNullable", + "UnrecognizedInt", + "UnrecognizedStr", + "UNSET", + "UNSET_SENTINEL", +] diff --git a/platform/src/codat_platform/types/basemodel.py b/platform/src/codat_platform/types/basemodel.py new file mode 100644 index 000000000..a6187efa6 --- /dev/null +++ b/platform/src/codat_platform/types/basemodel.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from pydantic import ConfigDict, model_serializer +from pydantic import BaseModel as PydanticBaseModel +from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType +from typing_extensions import TypeAliasType, TypeAlias + + +class BaseModel(PydanticBaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() + ) + + +class Unset(BaseModel): + @model_serializer(mode="plain") + def serialize_model(self): + return UNSET_SENTINEL + + def __bool__(self) -> Literal[False]: + return False + + +UNSET = Unset() +UNSET_SENTINEL = "~?~unset~?~sentinel~?~" + + +T = TypeVar("T") +if TYPE_CHECKING: + Nullable: TypeAlias = Union[T, None] + OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] +else: + Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) + OptionalNullable = TypeAliasType( + "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) + ) + +UnrecognizedInt = NewType("UnrecognizedInt", int) +UnrecognizedStr = NewType("UnrecognizedStr", str) diff --git a/platform/src/codat_platform/utils/__init__.py b/platform/src/codat_platform/utils/__init__.py new file mode 100644 index 000000000..26d51ae8f --- /dev/null +++ b/platform/src/codat_platform/utils/__init__.py @@ -0,0 +1,97 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .annotations import get_discriminator +from .enums import OpenEnumMeta +from .headers import get_headers, get_response_headers +from .metadata import ( + FieldMetadata, + find_metadata, + FormMetadata, + HeaderMetadata, + MultipartFormMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, + SecurityMetadata, +) +from .queryparams import get_query_params +from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig +from .requestbodies import serialize_request_body, SerializedRequestBody +from .security import get_security +from .serializers import ( + get_pydantic_model, + marshal_json, + unmarshal, + unmarshal_json, + serialize_decimal, + serialize_float, + serialize_int, + stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, + validate_decimal, + validate_float, + validate_int, + validate_open_enum, +) +from .url import generate_url, template_url, remove_suffix +from .values import ( + get_global_from_env, + match_content_type, + match_status_codes, + match_response, +) +from .logger import Logger, get_body_content, get_default_logger + +__all__ = [ + "BackoffStrategy", + "FieldMetadata", + "find_metadata", + "FormMetadata", + "generate_url", + "get_body_content", + "get_default_logger", + "get_discriminator", + "get_global_from_env", + "get_headers", + "get_pydantic_model", + "get_query_params", + "get_response_headers", + "get_security", + "HeaderMetadata", + "Logger", + "marshal_json", + "match_content_type", + "match_status_codes", + "match_response", + "MultipartFormMetadata", + "OpenEnumMeta", + "PathParamMetadata", + "QueryParamMetadata", + "remove_suffix", + "Retries", + "retry", + "retry_async", + "RetryConfig", + "RequestMetadata", + "SecurityMetadata", + "serialize_decimal", + "serialize_float", + "serialize_int", + "serialize_request_body", + "SerializedRequestBody", + "stream_to_text", + "stream_to_text_async", + "stream_to_bytes", + "stream_to_bytes_async", + "template_url", + "unmarshal", + "unmarshal_json", + "validate_decimal", + "validate_const", + "validate_float", + "validate_int", + "validate_open_enum", +] diff --git a/platform/src/codat_platform/utils/annotations.py b/platform/src/codat_platform/utils/annotations.py new file mode 100644 index 000000000..387874edd --- /dev/null +++ b/platform/src/codat_platform/utils/annotations.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from enum import Enum +from typing import Any, Optional + +def get_discriminator(model: Any, fieldname: str, key: str) -> str: + """ + Recursively search for the discriminator attribute in a model. + + Args: + model (Any): The model to search within. + fieldname (str): The name of the field to search for. + key (str): The key to search for in dictionaries. + + Returns: + str: The name of the discriminator attribute. + + Raises: + ValueError: If the discriminator attribute is not found. + """ + upper_fieldname = fieldname.upper() + + def get_field_discriminator(field: Any) -> Optional[str]: + """Search for the discriminator attribute in a given field.""" + + if isinstance(field, dict): + if key in field: + return f'{field[key]}' + + if hasattr(field, fieldname): + attr = getattr(field, fieldname) + if isinstance(attr, Enum): + return f'{attr.value}' + return f'{attr}' + + if hasattr(field, upper_fieldname): + attr = getattr(field, upper_fieldname) + if isinstance(attr, Enum): + return f'{attr.value}' + return f'{attr}' + + return None + + + if isinstance(model, list): + for field in model: + discriminator = get_field_discriminator(field) + if discriminator is not None: + return discriminator + + discriminator = get_field_discriminator(model) + if discriminator is not None: + return discriminator + + raise ValueError(f'Could not find discriminator field {fieldname} in {model}') diff --git a/platform/src/codat_platform/utils/enums.py b/platform/src/codat_platform/utils/enums.py new file mode 100644 index 000000000..c650b10cb --- /dev/null +++ b/platform/src/codat_platform/utils/enums.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import enum + + +class OpenEnumMeta(enum.EnumMeta): + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value diff --git a/platform/src/codat_platform/utils/eventstreaming.py b/platform/src/codat_platform/utils/eventstreaming.py new file mode 100644 index 000000000..74a63f757 --- /dev/null +++ b/platform/src/codat_platform/utils/eventstreaming.py @@ -0,0 +1,238 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import re +import json +from typing import ( + Callable, + Generic, + TypeVar, + Optional, + Generator, + AsyncGenerator, + Tuple, +) +import httpx + +T = TypeVar("T") + + +class EventStream(Generic[T]): + response: httpx.Response + generator: Generator[T, None, None] + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + ): + self.response = response + self.generator = stream_events(response, decoder, sentinel) + + def __iter__(self): + return self + + def __next__(self): + return next(self.generator) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.response.close() + + +class EventStreamAsync(Generic[T]): + response: httpx.Response + generator: AsyncGenerator[T, None] + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + ): + self.response = response + self.generator = stream_events_async(response, decoder, sentinel) + + def __aiter__(self): + return self + + async def __anext__(self): + return await self.generator.__anext__() + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + await self.response.aclose() + + +class ServerEvent: + id: Optional[str] = None + event: Optional[str] = None + data: Optional[str] = None + retry: Optional[int] = None + + +MESSAGE_BOUNDARIES = [ + b"\r\n\r\n", + b"\n\n", + b"\r\r", +] + + +async def stream_events_async( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> AsyncGenerator[T, None]: + buffer = bytearray() + position = 0 + discard = False + async for chunk in response.aiter_bytes(): + # We've encountered the sentinel value and should no longer process + # incoming data. Instead we throw new data away until the server closes + # the connection. + if discard: + continue + + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard = _parse_event(block, decoder, sentinel) + if event is not None: + yield event + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard = _parse_event(buffer, decoder, sentinel) + if event is not None: + yield event + + +def stream_events( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> Generator[T, None, None]: + buffer = bytearray() + position = 0 + discard = False + for chunk in response.iter_bytes(): + # We've encountered the sentinel value and should no longer process + # incoming data. Instead we throw new data away until the server closes + # the connection. + if discard: + continue + + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard = _parse_event(block, decoder, sentinel) + if event is not None: + yield event + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard = _parse_event(buffer, decoder, sentinel) + if event is not None: + yield event + + +def _parse_event( + raw: bytearray, decoder: Callable[[str], T], sentinel: Optional[str] = None +) -> Tuple[Optional[T], bool]: + block = raw.decode() + lines = re.split(r"\r?\n|\r", block) + publish = False + event = ServerEvent() + data = "" + for line in lines: + if not line: + continue + + delim = line.find(":") + if delim <= 0: + continue + + field = line[0:delim] + value = line[delim + 1 :] if delim < len(line) - 1 else "" + if len(value) and value[0] == " ": + value = value[1:] + + if field == "event": + event.event = value + publish = True + elif field == "data": + data += value + "\n" + publish = True + elif field == "id": + event.id = value + publish = True + elif field == "retry": + event.retry = int(value) if value.isdigit() else None + publish = True + + if sentinel and data == f"{sentinel}\n": + return None, True + + if data: + data = data[:-1] + event.data = data + + data_is_primitive = ( + data.isnumeric() or data == "true" or data == "false" or data == "null" + ) + data_is_json = ( + data.startswith("{") or data.startswith("[") or data.startswith('"') + ) + + if data_is_primitive or data_is_json: + try: + event.data = json.loads(data) + except Exception: + pass + + out = None + if publish: + out = decoder(json.dumps(event.__dict__)) + + return out, False + + +def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): + if len(sequence) > (len(buffer) - position): + return None + + for i, seq in enumerate(sequence): + if buffer[position + i] != seq: + return None + + return sequence diff --git a/platform/src/codat_platform/utils/forms.py b/platform/src/codat_platform/utils/forms.py new file mode 100644 index 000000000..9f5a731e9 --- /dev/null +++ b/platform/src/codat_platform/utils/forms.py @@ -0,0 +1,208 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .serializers import marshal_json + +from .metadata import ( + FormMetadata, + MultipartFormMetadata, + find_field_metadata, +) +from .values import _is_set, _val_to_string + + +def _populate_form( + field_name: str, + explode: bool, + obj: Any, + delimiter: str, + form: Dict[str, List[str]], +): + if not _is_set(obj): + return form + + if isinstance(obj, BaseModel): + items = [] + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_field_name = obj_field.alias if obj_field.alias is not None else name + if obj_field_name == "": + continue + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + form[obj_field_name] = [_val_to_string(val)] + else: + items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, Dict): + items = [] + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + form[key] = [_val_to_string(value)] + else: + items.append(f"{key}{delimiter}{_val_to_string(value)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + if explode: + if not field_name in form: + form[field_name] = [] + form[field_name].append(_val_to_string(value)) + else: + items.append(_val_to_string(value)) + + if len(items) > 0: + form[field_name] = [delimiter.join([str(item) for item in items])] + else: + form[field_name] = [_val_to_string(obj)] + + return form + + +def serialize_multipart_form( + media_type: str, request: Any +) -> Tuple[str, Dict[str, Any], Dict[str, Any]]: + form: Dict[str, Any] = {} + files: Dict[str, Any] = {} + + if not isinstance(request, BaseModel): + raise TypeError("invalid request body type") + + request_fields: Dict[str, FieldInfo] = request.__class__.model_fields + request_field_types = get_type_hints(request.__class__) + + for name in request_fields: + field = request_fields[name] + + val = getattr(request, name) + if not _is_set(val): + continue + + field_metadata = find_field_metadata(field, MultipartFormMetadata) + if not field_metadata: + continue + + f_name = field.alias if field.alias is not None else name + + if field_metadata.file: + file_fields: Dict[str, FieldInfo] = val.__class__.model_fields + + file_name = "" + field_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(val, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(val, file_field_name, None) + else: + field_name = ( + file_field.alias + if file_field.alias is not None + else file_field_name + ) + file_name = getattr(val, file_field_name) + + if field_name == "" or file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + if content_type is not None: + files[field_name] = (file_name, content, content_type) + else: + files[field_name] = (file_name, content) + elif field_metadata.json: + files[f_name] = ( + None, + marshal_json(val, request_field_types[name]), + "application/json", + ) + else: + if isinstance(val, List): + values = [] + + for value in val: + if not _is_set(value): + continue + values.append(_val_to_string(value)) + + form[f_name + "[]"] = values + else: + form[f_name] = _val_to_string(val) + return media_type, form, files + + +def serialize_form_data(data: Any) -> Dict[str, Any]: + form: Dict[str, List[str]] = {} + + if isinstance(data, BaseModel): + data_fields: Dict[str, FieldInfo] = data.__class__.model_fields + data_field_types = get_type_hints(data.__class__) + for name in data_fields: + field = data_fields[name] + + val = getattr(data, name) + if not _is_set(val): + continue + + metadata = find_field_metadata(field, FormMetadata) + if metadata is None: + continue + + f_name = field.alias if field.alias is not None else name + + if metadata.json: + form[f_name] = [marshal_json(val, data_field_types[name])] + else: + if metadata.style == "form": + _populate_form( + f_name, + metadata.explode, + val, + ",", + form, + ) + else: + raise ValueError(f"Invalid form style for field {name}") + elif isinstance(data, Dict): + for key, value in data.items(): + if _is_set(value): + form[key] = [_val_to_string(value)] + else: + raise TypeError(f"Invalid request body type {type(data)} for form data") + + return form diff --git a/platform/src/codat_platform/utils/headers.py b/platform/src/codat_platform/utils/headers.py new file mode 100644 index 000000000..37864cbbb --- /dev/null +++ b/platform/src/codat_platform/utils/headers.py @@ -0,0 +1,136 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + List, + Optional, +) +from httpx import Headers +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + HeaderMetadata, + find_field_metadata, +) + +from .values import _is_set, _populate_from_globals, _val_to_string + + +def get_headers(headers_params: Any, gbls: Optional[Any] = None) -> Dict[str, str]: + headers: Dict[str, str] = {} + + globals_already_populated = [] + if _is_set(headers_params): + globals_already_populated = _populate_headers(headers_params, gbls, headers, []) + if _is_set(gbls): + _populate_headers(gbls, None, headers, globals_already_populated) + + return headers + + +def _populate_headers( + headers_params: Any, + gbls: Any, + header_values: Dict[str, str], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(headers_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = headers_params.__class__.model_fields + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + f_name = field.alias if field.alias is not None else name + + metadata = find_field_metadata(field, HeaderMetadata) + if metadata is None: + continue + + value, global_found = _populate_from_globals( + name, getattr(headers_params, name), HeaderMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + value = _serialize_header(metadata.explode, value) + + if value != "": + header_values[f_name] = value + + return globals_already_populated + + +def _serialize_header(explode: bool, obj: Any) -> str: + if not _is_set(obj): + return "" + + if isinstance(obj, BaseModel): + items = [] + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_param_metadata = find_field_metadata(obj_field, HeaderMetadata) + + if not obj_param_metadata: + continue + + f_name = obj_field.alias if obj_field.alias is not None else name + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + items.append(f"{f_name}={_val_to_string(val)}") + else: + items.append(f_name) + items.append(_val_to_string(val)) + + if len(items) > 0: + return ",".join(items) + elif isinstance(obj, Dict): + items = [] + + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + items.append(f"{key}={_val_to_string(value)}") + else: + items.append(key) + items.append(_val_to_string(value)) + + if len(items) > 0: + return ",".join([str(item) for item in items]) + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + items.append(_val_to_string(value)) + + if len(items) > 0: + return ",".join(items) + elif _is_set(obj): + return f"{_val_to_string(obj)}" + + return "" + + +def get_response_headers(headers: Headers) -> Dict[str, List[str]]: + res: Dict[str, List[str]] = {} + for k, v in headers.items(): + if not k in res: + res[k] = [] + + res[k].append(v) + return res diff --git a/platform/src/codat_platform/utils/logger.py b/platform/src/codat_platform/utils/logger.py new file mode 100644 index 000000000..b661aff65 --- /dev/null +++ b/platform/src/codat_platform/utils/logger.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Any, Protocol + + +class Logger(Protocol): + def debug(self, msg: str, *args: Any, **kwargs: Any) -> None: + pass + + +class NoOpLogger: + def debug(self, msg: str, *args: Any, **kwargs: Any) -> None: + pass + + +def get_body_content(req: httpx.Request) -> str: + return "" if not hasattr(req, "_content") else str(req.content) + + +def get_default_logger() -> Logger: + return NoOpLogger() diff --git a/platform/src/codat_platform/utils/metadata.py b/platform/src/codat_platform/utils/metadata.py new file mode 100644 index 000000000..173b3e5ce --- /dev/null +++ b/platform/src/codat_platform/utils/metadata.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Optional, Type, TypeVar, Union +from dataclasses import dataclass +from pydantic.fields import FieldInfo + + +T = TypeVar("T") + + +@dataclass +class SecurityMetadata: + option: bool = False + scheme: bool = False + scheme_type: Optional[str] = None + sub_type: Optional[str] = None + field_name: Optional[str] = None + + def get_field_name(self, default: str) -> str: + return self.field_name or default + + +@dataclass +class ParamMetadata: + serialization: Optional[str] = None + style: str = "simple" + explode: bool = False + + +@dataclass +class PathParamMetadata(ParamMetadata): + pass + + +@dataclass +class QueryParamMetadata(ParamMetadata): + style: str = "form" + explode: bool = True + + +@dataclass +class HeaderMetadata(ParamMetadata): + pass + + +@dataclass +class RequestMetadata: + media_type: str = "application/octet-stream" + + +@dataclass +class MultipartFormMetadata: + file: bool = False + content: bool = False + json: bool = False + + +@dataclass +class FormMetadata: + json: bool = False + style: str = "form" + explode: bool = True + + +class FieldMetadata: + security: Optional[SecurityMetadata] = None + path: Optional[PathParamMetadata] = None + query: Optional[QueryParamMetadata] = None + header: Optional[HeaderMetadata] = None + request: Optional[RequestMetadata] = None + form: Optional[FormMetadata] = None + multipart: Optional[MultipartFormMetadata] = None + + def __init__( + self, + security: Optional[SecurityMetadata] = None, + path: Optional[Union[PathParamMetadata, bool]] = None, + query: Optional[Union[QueryParamMetadata, bool]] = None, + header: Optional[Union[HeaderMetadata, bool]] = None, + request: Optional[Union[RequestMetadata, bool]] = None, + form: Optional[Union[FormMetadata, bool]] = None, + multipart: Optional[Union[MultipartFormMetadata, bool]] = None, + ): + self.security = security + self.path = PathParamMetadata() if isinstance(path, bool) else path + self.query = QueryParamMetadata() if isinstance(query, bool) else query + self.header = HeaderMetadata() if isinstance(header, bool) else header + self.request = RequestMetadata() if isinstance(request, bool) else request + self.form = FormMetadata() if isinstance(form, bool) else form + self.multipart = ( + MultipartFormMetadata() if isinstance(multipart, bool) else multipart + ) + + +def find_field_metadata(field_info: FieldInfo, metadata_type: Type[T]) -> Optional[T]: + metadata = find_metadata(field_info, FieldMetadata) + if not metadata: + return None + + fields = metadata.__dict__ + + for field in fields: + if isinstance(fields[field], metadata_type): + return fields[field] + + return None + + +def find_metadata(field_info: FieldInfo, metadata_type: Type[T]) -> Optional[T]: + metadata = field_info.metadata + if not metadata: + return None + + for md in metadata: + if isinstance(md, metadata_type): + return md + + return None diff --git a/platform/src/codat_platform/utils/queryparams.py b/platform/src/codat_platform/utils/queryparams.py new file mode 100644 index 000000000..37a6e7f9a --- /dev/null +++ b/platform/src/codat_platform/utils/queryparams.py @@ -0,0 +1,205 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, +) + +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + QueryParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) +from .forms import _populate_form + + +def get_query_params( + query_params: Any, + gbls: Optional[Any] = None, +) -> Dict[str, List[str]]: + params: Dict[str, List[str]] = {} + + globals_already_populated = _populate_query_params(query_params, gbls, params, []) + if _is_set(gbls): + _populate_query_params(gbls, None, params, globals_already_populated) + + return params + + +def _populate_query_params( + query_params: Any, + gbls: Any, + query_param_values: Dict[str, List[str]], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(query_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields + param_field_types = get_type_hints(query_params.__class__) + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + + metadata = find_field_metadata(field, QueryParamMetadata) + if not metadata: + continue + + value = getattr(query_params, name) if _is_set(query_params) else None + + value, global_found = _populate_from_globals( + name, value, QueryParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + f_name = field.alias if field.alias is not None else name + serialization = metadata.serialization + if serialization is not None: + serialized_parms = _get_serialized_params( + metadata, f_name, value, param_field_types[name] + ) + for key, value in serialized_parms.items(): + if key in query_param_values: + query_param_values[key].extend(value) + else: + query_param_values[key] = [value] + else: + style = metadata.style + if style == "deepObject": + _populate_deep_object_query_params(f_name, value, query_param_values) + elif style == "form": + _populate_delimited_query_params( + metadata, f_name, value, ",", query_param_values + ) + elif style == "pipeDelimited": + _populate_delimited_query_params( + metadata, f_name, value, "|", query_param_values + ) + else: + raise NotImplementedError( + f"query param style {style} not yet supported" + ) + + return globals_already_populated + + +def _populate_deep_object_query_params( + field_name: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj): + return + + if isinstance(obj, BaseModel): + _populate_deep_object_query_params_basemodel(field_name, obj, params) + elif isinstance(obj, Dict): + _populate_deep_object_query_params_dict(field_name, obj, params) + + +def _populate_deep_object_query_params_basemodel( + prior_params_key: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj) or not isinstance(obj, BaseModel): + return + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + + f_name = obj_field.alias if obj_field.alias is not None else name + + params_key = f"{prior_params_key}[{f_name}]" + + obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) + if not _is_set(obj_param_metadata): + continue + + obj_val = getattr(obj, name) + if not _is_set(obj_val): + continue + + if isinstance(obj_val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, obj_val, params) + elif isinstance(obj_val, Dict): + _populate_deep_object_query_params_dict(params_key, obj_val, params) + elif isinstance(obj_val, List): + _populate_deep_object_query_params_list(params_key, obj_val, params) + else: + params[params_key] = [_val_to_string(obj_val)] + + +def _populate_deep_object_query_params_dict( + prior_params_key: str, + value: Dict, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for key, val in value.items(): + if not _is_set(val): + continue + + params_key = f"{prior_params_key}[{key}]" + + if isinstance(val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, val, params) + elif isinstance(val, Dict): + _populate_deep_object_query_params_dict(params_key, val, params) + elif isinstance(val, List): + _populate_deep_object_query_params_list(params_key, val, params) + else: + params[params_key] = [_val_to_string(val)] + + +def _populate_deep_object_query_params_list( + params_key: str, + value: List, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for val in value: + if not _is_set(val): + continue + + if params.get(params_key) is None: + params[params_key] = [] + + params[params_key].append(_val_to_string(val)) + + +def _populate_delimited_query_params( + metadata: QueryParamMetadata, + field_name: str, + obj: Any, + delimiter: str, + query_param_values: Dict[str, List[str]], +): + _populate_form( + field_name, + metadata.explode, + obj, + delimiter, + query_param_values, + ) diff --git a/platform/src/codat_platform/utils/requestbodies.py b/platform/src/codat_platform/utils/requestbodies.py new file mode 100644 index 000000000..4f586ae79 --- /dev/null +++ b/platform/src/codat_platform/utils/requestbodies.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import io +from dataclasses import dataclass +import re +from typing import ( + Any, + Optional, +) + +from .forms import serialize_form_data, serialize_multipart_form + +from .serializers import marshal_json + +SERIALIZATION_METHOD_TO_CONTENT_TYPE = { + "json": "application/json", + "form": "application/x-www-form-urlencoded", + "multipart": "multipart/form-data", + "raw": "application/octet-stream", + "string": "text/plain", +} + + +@dataclass +class SerializedRequestBody: + media_type: str + content: Optional[Any] = None + data: Optional[Any] = None + files: Optional[Any] = None + + +def serialize_request_body( + request_body: Any, + nullable: bool, + optional: bool, + serialization_method: str, + request_body_type, +) -> Optional[SerializedRequestBody]: + if request_body is None: + if not nullable and optional: + return None + + media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] + + serialized_request_body = SerializedRequestBody(media_type) + + if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None: + serialized_request_body.content = marshal_json(request_body, request_body_type) + elif re.match(r"multipart\/.*", media_type) is not None: + ( + serialized_request_body.media_type, + serialized_request_body.data, + serialized_request_body.files, + ) = serialize_multipart_form(media_type, request_body) + elif re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None: + serialized_request_body.data = serialize_form_data(request_body) + elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): + serialized_request_body.content = request_body + elif isinstance(request_body, str): + serialized_request_body.content = request_body + else: + raise TypeError( + f"invalid request body type {type(request_body)} for mediaType {media_type}" + ) + + return serialized_request_body diff --git a/platform/src/codat_platform/utils/retries.py b/platform/src/codat_platform/utils/retries.py new file mode 100644 index 000000000..4d6086716 --- /dev/null +++ b/platform/src/codat_platform/utils/retries.py @@ -0,0 +1,217 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import asyncio +import random +import time +from typing import List + +import httpx + + +class BackoffStrategy: + initial_interval: int + max_interval: int + exponent: float + max_elapsed_time: int + + def __init__( + self, + initial_interval: int, + max_interval: int, + exponent: float, + max_elapsed_time: int, + ): + self.initial_interval = initial_interval + self.max_interval = max_interval + self.exponent = exponent + self.max_elapsed_time = max_elapsed_time + + +class RetryConfig: + strategy: str + backoff: BackoffStrategy + retry_connection_errors: bool + + def __init__( + self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool + ): + self.strategy = strategy + self.backoff = backoff + self.retry_connection_errors = retry_connection_errors + + +class Retries: + config: RetryConfig + status_codes: List[str] + + def __init__(self, config: RetryConfig, status_codes: List[str]): + self.config = config + self.status_codes = status_codes + + +class TemporaryError(Exception): + response: httpx.Response + + def __init__(self, response: httpx.Response): + self.response = response + + +class PermanentError(Exception): + inner: Exception + + def __init__(self, inner: Exception): + self.inner = inner + + +def retry(func, retries: Retries): + if retries.config.strategy == "backoff": + + def do_request() -> httpx.Response: + res: httpx.Response + try: + res = func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except httpx.ConnectError as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except httpx.TimeoutException as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return retry_with_backoff( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return func() + + +async def retry_async(func, retries: Retries): + if retries.config.strategy == "backoff": + + async def do_request() -> httpx.Response: + res: httpx.Response + try: + res = await func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except httpx.ConnectError as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except httpx.TimeoutException as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return await retry_with_backoff_async( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return await func() + + +def retry_with_backoff( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + sleep = min(sleep, max_interval / 1000) + time.sleep(sleep) + retries += 1 + + +async def retry_with_backoff_async( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return await func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + sleep = min(sleep, max_interval / 1000) + await asyncio.sleep(sleep) + retries += 1 diff --git a/platform/src/codat_platform/utils/security.py b/platform/src/codat_platform/utils/security.py new file mode 100644 index 000000000..295a3f400 --- /dev/null +++ b/platform/src/codat_platform/utils/security.py @@ -0,0 +1,174 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import base64 +from typing import ( + Any, + Dict, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + SecurityMetadata, + find_field_metadata, +) + + +def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: + headers: Dict[str, str] = {} + query_params: Dict[str, List[str]] = {} + + if security is None: + return headers, query_params + + if not isinstance(security, BaseModel): + raise TypeError("security must be a pydantic model") + + sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields + for name in sec_fields: + sec_field = sec_fields[name] + + value = getattr(security, name) + if value is None: + continue + + metadata = find_field_metadata(sec_field, SecurityMetadata) + if metadata is None: + continue + if metadata.option: + _parse_security_option(headers, query_params, value) + return headers, query_params + if metadata.scheme: + # Special case for basic auth or custom auth which could be a flattened model + if metadata.sub_type in ["basic", "custom"] and not isinstance( + value, BaseModel + ): + _parse_security_scheme(headers, query_params, metadata, name, security) + else: + _parse_security_scheme(headers, query_params, metadata, name, value) + + return headers, query_params + + +def _parse_security_option( + headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any +): + if not isinstance(option, BaseModel): + raise TypeError("security option must be a pydantic model") + + opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields + for name in opt_fields: + opt_field = opt_fields[name] + + metadata = find_field_metadata(opt_field, SecurityMetadata) + if metadata is None or not metadata.scheme: + continue + _parse_security_scheme( + headers, query_params, metadata, name, getattr(option, name) + ) + + +def _parse_security_scheme( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + field_name: str, + scheme: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + if isinstance(scheme, BaseModel): + if scheme_type == "http": + if sub_type == "basic": + _parse_basic_auth_scheme(headers, scheme) + return + if sub_type == "custom": + return + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + value = getattr(scheme, name) + + _parse_security_scheme_value( + headers, query_params, scheme_metadata, metadata, name, value + ) + else: + _parse_security_scheme_value( + headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme + ) + + +def _parse_security_scheme_value( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + security_metadata: SecurityMetadata, + field_name: str, + value: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + header_name = security_metadata.get_field_name(field_name) + + if scheme_type == "apiKey": + if sub_type == "header": + headers[header_name] = value + elif sub_type == "query": + query_params[header_name] = [value] + else: + raise ValueError("sub type {sub_type} not supported") + elif scheme_type == "openIdConnect": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "oauth2": + if sub_type != "client_credentials": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "http": + if sub_type == "bearer": + headers[header_name] = _apply_bearer(value) + elif sub_type == "custom": + return + else: + raise ValueError("sub type {sub_type} not supported") + else: + raise ValueError("scheme type {scheme_type} not supported") + + +def _apply_bearer(token: str) -> str: + return token.lower().startswith("bearer ") and token or f"Bearer {token}" + + +def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): + username = "" + password = "" + + if not isinstance(scheme, BaseModel): + raise TypeError("basic auth scheme must be a pydantic model") + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + field_name = metadata.field_name + value = getattr(scheme, name) + + if field_name == "username": + username = value + if field_name == "password": + password = value + + data = f"{username}:{password}".encode() + headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/platform/src/codat_platform/utils/serializers.py b/platform/src/codat_platform/utils/serializers.py new file mode 100644 index 000000000..c5eb36597 --- /dev/null +++ b/platform/src/codat_platform/utils/serializers.py @@ -0,0 +1,215 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from decimal import Decimal +import json +from typing import Any, Dict, List, Union, get_args +import httpx +from typing_extensions import get_origin +from pydantic import ConfigDict, create_model +from pydantic_core import from_json +from typing_inspect import is_optional_type + +from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset + + +def serialize_decimal(as_str: bool): + def serialize(d): + if is_optional_type(type(d)) and d is None: + return None + if isinstance(d, Unset): + return d + + if not isinstance(d, Decimal): + raise ValueError("Expected Decimal object") + + return str(d) if as_str else float(d) + + return serialize + + +def validate_decimal(d): + if d is None: + return None + + if isinstance(d, (Decimal, Unset)): + return d + + if not isinstance(d, (str, int, float)): + raise ValueError("Expected string, int or float") + + return Decimal(str(d)) + + +def serialize_float(as_str: bool): + def serialize(f): + if is_optional_type(type(f)) and f is None: + return None + if isinstance(f, Unset): + return f + + if not isinstance(f, float): + raise ValueError("Expected float") + + return str(f) if as_str else f + + return serialize + + +def validate_float(f): + if f is None: + return None + + if isinstance(f, (float, Unset)): + return f + + if not isinstance(f, str): + raise ValueError("Expected string") + + return float(f) + + +def serialize_int(as_str: bool): + def serialize(i): + if is_optional_type(type(i)) and i is None: + return None + if isinstance(i, Unset): + return i + + if not isinstance(i, int): + raise ValueError("Expected int") + + return str(i) if as_str else i + + return serialize + + +def validate_int(b): + if b is None: + return None + + if isinstance(b, (int, Unset)): + return b + + if not isinstance(b, str): + raise ValueError("Expected string") + + return int(b) + + +def validate_open_enum(is_int: bool): + def validate(e): + if e is None: + return None + + if isinstance(e, Unset): + return e + + if is_int: + if not isinstance(e, int): + raise ValueError("Expected int") + else: + if not isinstance(e, str): + raise ValueError("Expected string") + + return e + + return validate + + +def validate_const(v): + def validate(c): + if is_optional_type(type(c)) and c is None: + return None + + if v != c: + raise ValueError(f"Expected {v}") + + return c + + return validate + + +def unmarshal_json(raw, typ: Any) -> Any: + return unmarshal(from_json(raw), typ) + + +def unmarshal(val, typ: Any) -> Any: + unmarshaller = create_model( + "Unmarshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = unmarshaller(body=val) + + # pyright: ignore[reportAttributeAccessIssue] + return m.body # type: ignore + + +def marshal_json(val, typ): + if is_nullable(typ) and val is None: + return "null" + + marshaller = create_model( + "Marshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = marshaller(body=val) + + d = m.model_dump(by_alias=True, mode="json", exclude_none=True) + + if len(d) == 0: + return "" + + return json.dumps(d[next(iter(d))], separators=(",", ":"), sort_keys=True) + + +def is_nullable(field): + origin = get_origin(field) + if origin is Nullable or origin is OptionalNullable: + return True + + if not origin is Union or type(None) not in get_args(field): + return False + + for arg in get_args(field): + if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: + return True + + return False + + +def stream_to_text(stream: httpx.Response) -> str: + return "".join(stream.iter_text()) + + +async def stream_to_text_async(stream: httpx.Response) -> str: + return "".join([chunk async for chunk in stream.aiter_text()]) + + +def stream_to_bytes(stream: httpx.Response) -> bytes: + return stream.content + + +async def stream_to_bytes_async(stream: httpx.Response) -> bytes: + return await stream.aread() + + +def get_pydantic_model(data: Any, typ: Any) -> Any: + if not _contains_pydantic_model(data): + return unmarshal(data, typ) + + return data + + +def _contains_pydantic_model(data: Any) -> bool: + if isinstance(data, BaseModel): + return True + if isinstance(data, List): + return any(_contains_pydantic_model(item) for item in data) + if isinstance(data, Dict): + return any(_contains_pydantic_model(value) for value in data.values()) + + return False diff --git a/platform/src/codat_platform/utils/url.py b/platform/src/codat_platform/utils/url.py new file mode 100644 index 000000000..c78ccbae4 --- /dev/null +++ b/platform/src/codat_platform/utils/url.py @@ -0,0 +1,155 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from decimal import Decimal +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, + Union, + get_args, + get_origin, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + PathParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) + + +def generate_url( + server_url: str, + path: str, + path_params: Any, + gbls: Optional[Any] = None, +) -> str: + path_param_values: Dict[str, str] = {} + + globals_already_populated = _populate_path_params( + path_params, gbls, path_param_values, [] + ) + if _is_set(gbls): + _populate_path_params(gbls, None, path_param_values, globals_already_populated) + + for key, value in path_param_values.items(): + path = path.replace("{" + key + "}", value, 1) + + return remove_suffix(server_url, "/") + path + + +def _populate_path_params( + path_params: Any, + gbls: Any, + path_param_values: Dict[str, str], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(path_params, BaseModel): + return globals_already_populated + + path_param_fields: Dict[str, FieldInfo] = path_params.__class__.model_fields + path_param_field_types = get_type_hints(path_params.__class__) + for name in path_param_fields: + if name in skip_fields: + continue + + field = path_param_fields[name] + + param_metadata = find_field_metadata(field, PathParamMetadata) + if param_metadata is None: + continue + + param = getattr(path_params, name) if _is_set(path_params) else None + param, global_found = _populate_from_globals( + name, param, PathParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + if not _is_set(param): + continue + + f_name = field.alias if field.alias is not None else name + serialization = param_metadata.serialization + if serialization is not None: + serialized_params = _get_serialized_params( + param_metadata, f_name, param, path_param_field_types[name] + ) + for key, value in serialized_params.items(): + path_param_values[key] = value + else: + pp_vals: List[str] = [] + if param_metadata.style == "simple": + if isinstance(param, List): + for pp_val in param: + if not _is_set(pp_val): + continue + pp_vals.append(_val_to_string(pp_val)) + path_param_values[f_name] = ",".join(pp_vals) + elif isinstance(param, Dict): + for pp_key in param: + if not _is_set(param[pp_key]): + continue + if param_metadata.explode: + pp_vals.append(f"{pp_key}={_val_to_string(param[pp_key])}") + else: + pp_vals.append(f"{pp_key},{_val_to_string(param[pp_key])}") + path_param_values[f_name] = ",".join(pp_vals) + elif not isinstance(param, (str, int, float, complex, bool, Decimal)): + param_fields: Dict[str, FieldInfo] = param.__class__.model_fields + for name in param_fields: + param_field = param_fields[name] + + param_value_metadata = find_field_metadata( + param_field, PathParamMetadata + ) + if param_value_metadata is None: + continue + + param_name = ( + param_field.alias if param_field.alias is not None else name + ) + + param_field_val = getattr(param, name) + if not _is_set(param_field_val): + continue + if param_metadata.explode: + pp_vals.append( + f"{param_name}={_val_to_string(param_field_val)}" + ) + else: + pp_vals.append( + f"{param_name},{_val_to_string(param_field_val)}" + ) + path_param_values[f_name] = ",".join(pp_vals) + elif _is_set(param): + path_param_values[f_name] = _val_to_string(param) + + return globals_already_populated + + +def is_optional(field): + return get_origin(field) is Union and type(None) in get_args(field) + + +def template_url(url_with_params: str, params: Dict[str, str]) -> str: + for key, value in params.items(): + url_with_params = url_with_params.replace("{" + key + "}", value) + + return url_with_params + + +def remove_suffix(input_string, suffix): + if suffix and input_string.endswith(suffix): + return input_string[: -len(suffix)] + return input_string diff --git a/platform/src/codat_platform/utils/values.py b/platform/src/codat_platform/utils/values.py new file mode 100644 index 000000000..2b4b68321 --- /dev/null +++ b/platform/src/codat_platform/utils/values.py @@ -0,0 +1,134 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from datetime import datetime +from enum import Enum +from email.message import Message +import os +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union + +from httpx import Response +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from ..types.basemodel import Unset + +from .serializers import marshal_json + +from .metadata import ParamMetadata, find_field_metadata + + +def match_content_type(content_type: str, pattern: str) -> bool: + if pattern in (content_type, "*", "*/*"): + return True + + msg = Message() + msg["content-type"] = content_type + media_type = msg.get_content_type() + + if media_type == pattern: + return True + + parts = media_type.split("/") + if len(parts) == 2: + if pattern in (f"{parts[0]}/*", f"*/{parts[1]}"): + return True + + return False + + +def match_status_codes(status_codes: List[str], status_code: int) -> bool: + if "default" in status_codes: + return True + + 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 + + +T = TypeVar("T") + + +def get_global_from_env( + value: Optional[T], env_key: str, type_cast: Callable[[str], T] +) -> Optional[T]: + if value is not None: + return value + env_value = os.getenv(env_key) + if env_value is not None: + try: + return type_cast(env_value) + except ValueError: + pass + return None + + +def match_response( + response: Response, code: Union[str, List[str]], content_type: str +) -> bool: + codes = code if isinstance(code, list) else [code] + return match_status_codes(codes, response.status_code) and match_content_type( + response.headers.get("content-type", "application/octet-stream"), content_type + ) + + +def _populate_from_globals( + param_name: str, value: Any, param_metadata_type: type, gbls: Any +) -> Tuple[Any, bool]: + if gbls is None: + return value, False + + if not isinstance(gbls, BaseModel): + raise TypeError("globals must be a pydantic model") + + global_fields: Dict[str, FieldInfo] = gbls.__class__.model_fields + found = False + for name in global_fields: + field = global_fields[name] + if name is not param_name: + continue + + found = True + + if value is not None: + return value, True + + global_value = getattr(gbls, name) + + param_metadata = find_field_metadata(field, param_metadata_type) + if param_metadata is None: + return value, True + + return global_value, True + + return value, found + + +def _val_to_string(val) -> str: + if isinstance(val, bool): + return str(val).lower() + if isinstance(val, datetime): + return str(val.isoformat().replace("+00:00", "Z")) + if isinstance(val, Enum): + return str(val.value) + + return str(val) + + +def _get_serialized_params( + metadata: ParamMetadata, field_name: str, obj: Any, typ: type +) -> Dict[str, str]: + params: Dict[str, str] = {} + + serialization = metadata.serialization + if serialization == "json": + params[field_name] = marshal_json(obj, typ) + + return params + + +def _is_set(value: Any) -> bool: + return value is not None and not isinstance(value, Unset) diff --git a/platform/src/codat_platform/webhooks.py b/platform/src/codat_platform/webhooks.py new file mode 100644 index 000000000..feba33cf8 --- /dev/null +++ b/platform/src/codat_platform/webhooks.py @@ -0,0 +1,1293 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_platform import utils +from codat_platform._hooks import HookContext +from codat_platform.models import errors, operations, shared +from codat_platform.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast +from typing_extensions import deprecated + + +class Webhooks(BaseSDK): + r"""Create and manage webhooks that listen to Codat's events.""" + + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) + def create( + self, + *, + request: Optional[Union[shared.CreateRule, shared.CreateRuleTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Webhook]: + r"""Create webhook (legacy) + + Use the *Create webhooks (legacy)* endpoint to create a rule-based webhook for your client. + + **Note:** This endpoint has been deprecated. Please use the [*Create webhook consumer*](https://docs.codat.io/platform-api#/operations/create-webhook-consumer) endpoint to create a webhook moving forward. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.CreateRule]) + request = cast(Optional[shared.CreateRule], request) + + req = self.build_request( + method="POST", + path="/rules", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.CreateRule] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="create-rule", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Webhook]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) + async def create_async( + self, + *, + request: Optional[Union[shared.CreateRule, shared.CreateRuleTypedDict]] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Webhook]: + r"""Create webhook (legacy) + + Use the *Create webhooks (legacy)* endpoint to create a rule-based webhook for your client. + + **Note:** This endpoint has been deprecated. Please use the [*Create webhook consumer*](https://docs.codat.io/platform-api#/operations/create-webhook-consumer) endpoint to create a webhook moving forward. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, Optional[shared.CreateRule]) + request = cast(Optional[shared.CreateRule], request) + + req = self.build_request_async( + method="POST", + path="/rules", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.CreateRule] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="create-rule", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["401", "402", "403", "429", "4XX", "500", "503", "5XX"], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Webhook]) + if utils.match_response( + http_res, ["401", "402", "403", "429", "500", "503"], "application/json" + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def create_consumer( + self, + *, + request: Optional[ + Union[ + shared.WebhookConsumerPrototype, + shared.WebhookConsumerPrototypeTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.WebhookConsumer]: + 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). + + ### Tips and traps + - The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[shared.WebhookConsumerPrototype] + ) + request = cast(Optional[shared.WebhookConsumerPrototype], request) + + req = self.build_request( + method="POST", + path="/webhooks", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.WebhookConsumerPrototype] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="create-webhook-consumer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.WebhookConsumer]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_consumer_async( + self, + *, + request: Optional[ + Union[ + shared.WebhookConsumerPrototype, + shared.WebhookConsumerPrototypeTypedDict, + ] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.WebhookConsumer]: + 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). + + ### Tips and traps + - The number of webhook consumers you can create is limited to 50. If you have reached the maximum number of consumers, use the [*Delete webhook consumer*](https://docs.codat.io/platform-api#/operations/delete-webhook-consumer) endpoint to delete an unused consumer first. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, Optional[shared.WebhookConsumerPrototype] + ) + request = cast(Optional[shared.WebhookConsumerPrototype], request) + + req = self.build_request_async( + method="POST", + path="/webhooks", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, True, "json", Optional[shared.WebhookConsumerPrototype] + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="create-webhook-consumer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.WebhookConsumer]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def delete_consumer( + self, + *, + request: Union[ + operations.DeleteWebhookConsumerRequest, + operations.DeleteWebhookConsumerRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + 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). + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteWebhookConsumerRequest) + request = cast(operations.DeleteWebhookConsumerRequest, request) + + req = self.build_request( + method="DELETE", + path="/webhooks/{webhookId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="delete-webhook-consumer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def delete_consumer_async( + self, + *, + request: Union[ + operations.DeleteWebhookConsumerRequest, + operations.DeleteWebhookConsumerRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + 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). + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.DeleteWebhookConsumerRequest) + request = cast(operations.DeleteWebhookConsumerRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/webhooks/{webhookId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="delete-webhook-consumer", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "204", "*"): + return + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) + def get( + self, + *, + request: Union[ + operations.GetWebhookRequest, operations.GetWebhookRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Webhook]: + r"""Get webhook (legacy) + + Use the *Get webhook (legacy)* endpoint to retrieve a specific webhook for your client. + + **Note:** This endpoint has been deprecated. Please use the [*List webhook consumers*](https://docs.codat.io/platform-api#/operations/list-webhook-consumers) endpoint for listing webhooks moving forward. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetWebhookRequest) + request = cast(operations.GetWebhookRequest, request) + + req = self.build_request( + method="GET", + path="/rules/{ruleId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-webhook", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Webhook]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) + async def get_async( + self, + *, + request: Union[ + operations.GetWebhookRequest, operations.GetWebhookRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Webhook]: + r"""Get webhook (legacy) + + Use the *Get webhook (legacy)* endpoint to retrieve a specific webhook for your client. + + **Note:** This endpoint has been deprecated. Please use the [*List webhook consumers*](https://docs.codat.io/platform-api#/operations/list-webhook-consumers) endpoint for listing webhooks moving forward. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetWebhookRequest) + request = cast(operations.GetWebhookRequest, request) + + req = self.build_request_async( + method="GET", + path="/rules/{ruleId}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-webhook", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Webhook]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) + def list( + self, + *, + request: Union[ + operations.ListRulesRequest, operations.ListRulesRequestTypedDict + ] = operations.ListRulesRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Webhooks]: + r"""List webhooks (legacy) + + Use the *List webhooks (legacy)* endpoint to retrieve all existing rule-based webhooks for your client. + + **Note:** This endpoint has been deprecated. Please use the [*List webhook consumers*](https://docs.codat.io/platform-api#/operations/list-webhook-consumers) endpoint for listing webhooks moving forward. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListRulesRequest) + request = cast(operations.ListRulesRequest, request) + + req = self.build_request( + method="GET", + path="/rules", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="list-rules", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Webhooks]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + @deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." + ) + async def list_async( + self, + *, + request: Union[ + operations.ListRulesRequest, operations.ListRulesRequestTypedDict + ] = operations.ListRulesRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Webhooks]: + r"""List webhooks (legacy) + + Use the *List webhooks (legacy)* endpoint to retrieve all existing rule-based webhooks for your client. + + **Note:** This endpoint has been deprecated. Please use the [*List webhook consumers*](https://docs.codat.io/platform-api#/operations/list-webhook-consumers) endpoint for listing webhooks moving forward. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.ListRulesRequest) + request = cast(operations.ListRulesRequest, request) + + req = self.build_request_async( + method="GET", + path="/rules", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="list-rules", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.Webhooks]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def list_consumers( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.WebhookConsumers]: + 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). + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request( + method="GET", + path="/webhooks", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="list-webhook-consumers", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.WebhookConsumers] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def list_consumers_async( + self, + *, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.WebhookConsumers]: + 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). + + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + req = self.build_request_async( + method="GET", + path="/webhooks", + base_url=base_url, + url_variables=url_variables, + request=None, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="list-webhook-consumers", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.WebhookConsumers] + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) diff --git a/platform/src/codatplatform/__init__.py b/platform/src/codatplatform/__init__.py deleted file mode 100644 index e6c0deeb6..000000000 --- a/platform/src/codatplatform/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .sdk import * -from .sdkconfiguration import * diff --git a/platform/src/codatplatform/_hooks/__init__.py b/platform/src/codatplatform/_hooks/__init__.py deleted file mode 100644 index 5fd985a8a..000000000 --- a/platform/src/codatplatform/_hooks/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""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/companies.py b/platform/src/codatplatform/companies.py deleted file mode 100644 index fca9672c9..000000000 --- a/platform/src/codatplatform/companies.py +++ /dev/null @@ -1,443 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class Companies: - r"""Create and manage your SMB users' companies.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: Optional[shared.CompanyRequestBody], retries: Optional[utils.RetryConfig] = None) -> operations.CreateCompanyResponse: - r"""Create company - Use the *Create company* endpoint to create a new [company](https://docs.codat.io/platform-api#/schemas/Company) that represents your customer in Codat. - - 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. - - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CompanyRequestBody], "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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateCompanyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def delete(self, request: operations.DeleteCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteCompanyResponse: - r"""Delete a company - The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/platform-api#/schemas/Company), its [connections](https://docs.codat.io/platform-api#/schemas/Connection) and any cached data. This operation is irreversible. - - 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(base_url, '/companies/{companyId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('DELETE', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.DeleteCompanyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCompanyResponse: - r"""Get company - The *Get company* endpoint returns a single company for a given `companyId`. - - 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(base_url, '/companies/{companyId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCompanyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListCompaniesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListCompaniesResponse: - r"""List companies - The *List companies* endpoint returns a list of [companies] associated to your instances. - - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListCompaniesResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Companies]) - res.companies = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update(self, request: operations.UpdateCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UpdateCompanyResponse: - r"""Update company - Use the *Update company* endpoint to update both the name and description of the company. - If you use [groups](https://docs.codat.io/platform-api#/schemas/Group) to manage a set of companies, use the [Add company](https://docs.codat.io/platform-api#/operations/add-company-to-group) or [Remove company](https://docs.codat.io/platform-api#/operations/remove-company-from-group) endpoints to add or remove a company from a group. - - 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(base_url, '/companies/{companyId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateCompanyRequest, "company_request_body", 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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateCompanyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/connection_management.py b/platform/src/codatplatform/connection_management.py deleted file mode 100644 index ad427b1ce..000000000 --- a/platform/src/codatplatform/connection_management.py +++ /dev/null @@ -1,107 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .cors_settings import CorsSettings -from .sdkconfiguration import SDKConfiguration -from codatplatform import utils -from codatplatform._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class ConnectionManagement: - r"""Configure connection management UI and retrieve access tokens for authentication.""" - cors_settings: CorsSettings - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - self._init_sdks() - - def _init_sdks(self): - self.cors_settings = CorsSettings(self.sdk_configuration) - - - - def get_access_token(self, request: operations.GetConnectionManagementAccessTokenRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetConnectionManagementAccessTokenResponse: - r"""Get access token - Use the *Get access token* endpoint to retrieve a new access token for use by the [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management). - - The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. - """ - hook_ctx = HookContext(operation_id='get-connection-management-access-token', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(base_url, '/companies/{companyId}/connectionManagement/accessToken', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetConnectionManagementAccessTokenResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.ConnectionManagementAccessToken]) - res.connection_management_access_token = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/connections.py b/platform/src/codatplatform/connections.py deleted file mode 100644 index 893462341..000000000 --- a/platform/src/codatplatform/connections.py +++ /dev/null @@ -1,512 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class Connections: - r"""Create new and manage existing data connections for a company.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateConnectionResponse: - r"""Create connection - Creates a connection for the company by providing a valid `platformKey`. - - 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(base_url, '/companies/{companyId}/connections', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateConnectionRequest, "request_body", 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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def delete(self, request: operations.DeleteConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteConnectionResponse: - r"""Delete connection - 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(base_url, '/companies/{companyId}/connections/{connectionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('DELETE', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.DeleteConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - pass - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetConnectionResponse: - 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(base_url, '/companies/{companyId}/connections/{connectionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListConnectionsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListConnectionsResponse: - 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(base_url, '/companies/{companyId}/connections', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListConnectionsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connections]) - res.connections = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UnlinkConnectionResponse: - 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(base_url, '/companies/{companyId}/connections/{connectionId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UnlinkConnectionRequest, "update_connection_status", 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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PATCH', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UnlinkConnectionResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update_authorization(self, request: operations.UpdateConnectionAuthorizationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UpdateConnectionAuthorizationResponse: - 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(base_url, '/companies/{companyId}/connections/{connectionId}/authorization', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateConnectionAuthorizationRequest, "request_body", 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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateConnectionAuthorizationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/cors_settings.py b/platform/src/codatplatform/cors_settings.py deleted file mode 100644 index 02800efb8..000000000 --- a/platform/src/codatplatform/cors_settings.py +++ /dev/null @@ -1,190 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class CorsSettings: - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def get(self, retries: Optional[utils.RetryConfig] = None) -> operations.GetConnectionManagementCorsSettingsResponse: - r"""Get CORS settings - The *Get CORS settings* endpoint returns the allowed origins (i.e. your domains) you want to allow cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)) with Codat. - - Enabling CORS with Codat is required by our embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. - - The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. - """ - hook_ctx = HookContext(operation_id='get-connection-management-cors-settings', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = base_url + '/connectionManagement/corsSettings' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetConnectionManagementCorsSettingsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.ConnectionManagementAllowedOrigins]) - res.connection_management_allowed_origins = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def set(self, request: Optional[shared.ConnectionManagementAllowedOrigins], retries: Optional[utils.RetryConfig] = None) -> operations.SetConnectionManagementCorsSettingsResponse: - r"""Set CORS settings - The *Set CORS settings* endpoint allows you to register allowed origins (i.e. your domains) for use in cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)). - - Enabling CORS with Codat is required by our embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) to access Codat's API endpoints. - - The embedded [connection management UI](https://docs.codat.io/auth-flow/optimize/connection-management) lets your customers control access to their data by allowing them to manage their existing connections. - """ - hook_ctx = HookContext(operation_id='set-connection-management-cors-settings', oauth2_scopes=[], security_source=self.sdk_configuration.security) - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = base_url + '/connectionManagement/corsSettings' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.ConnectionManagementAllowedOrigins], "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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.SetConnectionManagementCorsSettingsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.ConnectionManagementAllowedOrigins]) - res.connection_management_allowed_origins = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/custom_data_type.py b/platform/src/codatplatform/custom_data_type.py deleted file mode 100644 index 67966b216..000000000 --- a/platform/src/codatplatform/custom_data_type.py +++ /dev/null @@ -1,360 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class CustomDataType: - r"""Configure and pull additional data types that are not included in Codat's standardized data model.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def configure(self, request: operations.ConfigureCustomDataTypeRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ConfigureCustomDataTypeResponse: - r"""Configure custom data type - The *Configure custom data type* endpoint allows you to maintain or change the configuration required to return a custom data type for a specific integration. - - 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. - - ### Tips and traps - - - You can only configure a single custom data type for a single platform at a time. Use the endpoint multiple times if you need to configure it for multiple platforms. - - - You can only indicate a single data source for each customer data type. - - - 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(base_url, '/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.ConfigureCustomDataTypeRequest, "custom_data_type_configuration", 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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ConfigureCustomDataTypeResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CustomDataTypeConfiguration]) - res.custom_data_type_configuration = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_configuration(self, request: operations.GetCustomDataTypeConfigurationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCustomDataTypeConfigurationResponse: - r"""Get custom data configuration - The *Get custom data configuration* endpoint returns existing configuration details for the specified custom data type and integration pair you previously configured. - - 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(base_url, '/integrations/{platformKey}/dataTypes/custom/{customDataIdentifier}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCustomDataTypeConfigurationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CustomDataTypeRecords]) - res.custom_data_type_records = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListCustomDataTypeRecordsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListCustomDataTypeRecordsResponse: - r"""List custom data type records - The *List custom data type records* endpoint returns a paginated list of records pulled for the specified custom data type you previously configured. - - 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(base_url, '/companies/{companyId}/connections/{connectionId}/data/custom/{customDataIdentifier}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','451','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListCustomDataTypeRecordsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.CustomDataTypeRecords]) - res.custom_data_type_records = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 451, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def refresh(self, request: operations.RefreshCustomDataTypeRequest, retries: Optional[utils.RetryConfig] = None) -> operations.RefreshCustomDataTypeResponse: - 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(base_url, '/companies/{companyId}/connections/{connectionId}/data/queue/custom/{customDataIdentifier}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','451','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.RefreshCustomDataTypeResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) - res.pull_operation = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 451, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/groups.py b/platform/src/codatplatform/groups.py deleted file mode 100644 index 07e5d5805..000000000 --- a/platform/src/codatplatform/groups.py +++ /dev/null @@ -1,356 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class Groups: - r"""Define and manage sets of companies based on a chosen characteristic.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def add_company(self, request: operations.AddCompanyToGroupRequest, retries: Optional[utils.RetryConfig] = None) -> operations.AddCompanyToGroupResponse: - r"""Add company - Use the *Add company* endpoint to assign a company to a group. A company can belong to multiple groups, but can only be added to one group at a time. - - [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(base_url, '/companies/{companyId}/groups', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.AddCompanyToGroupRequest, "company_group_assignment", 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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PATCH', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.AddCompanyToGroupResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def create(self, request: Optional[shared.GroupPrototype], retries: Optional[utils.RetryConfig] = None) -> operations.CreateGroupResponse: - r"""Create group - Use the *Create group* endpoint to generate a new group that you can assign your companies to. - - [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. - - ### Tips and traps - - * 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.GroupPrototype], "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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','409','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateGroupResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Group]) - res.group = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 409, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, retries: Optional[utils.RetryConfig] = None) -> operations.ListGroupsResponse: - r"""List groups - Use the *List group* endpoint to return a list of all groups that currently exist for your client. - - [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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListGroupsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Groups]) - res.groups = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def remove_company(self, request: operations.RemoveCompanyFromGroupRequest, retries: Optional[utils.RetryConfig] = None) -> operations.RemoveCompanyFromGroupResponse: - r"""Remove company - Use the *Remove company* endpoint to remove a company from a group. - - [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(base_url, '/companies/{companyId}/groups/{groupId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('DELETE', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.RemoveCompanyFromGroupResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/integrations.py b/platform/src/codatplatform/integrations.py deleted file mode 100644 index 4d32fead2..000000000 --- a/platform/src/codatplatform/integrations.py +++ /dev/null @@ -1,262 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class Integrations: - r"""Get a list of integrations supported by Codat and their logos.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def get(self, request: operations.GetIntegrationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetIntegrationResponse: - 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(base_url, '/integrations/{platformKey}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetIntegrationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Integration]) - res.integration = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_branding(self, request: operations.GetIntegrationsBrandingRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetIntegrationsBrandingResponse: - 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(base_url, '/integrations/{platformKey}/branding', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetIntegrationsBrandingResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Branding]) - res.branding = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListIntegrationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListIntegrationsResponse: - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListIntegrationsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Integrations]) - res.integrations = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/models/__init__.py b/platform/src/codatplatform/models/__init__.py deleted file mode 100644 index 722bb9982..000000000 --- a/platform/src/codatplatform/models/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - - -# package diff --git a/platform/src/codatplatform/models/errors/__init__.py b/platform/src/codatplatform/models/errors/__init__.py deleted file mode 100644 index bf15fd116..000000000 --- a/platform/src/codatplatform/models/errors/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .errormessage import * -from .sdkerror import * - -__all__ = ["ErrorMessage","SDKError"] diff --git a/platform/src/codatplatform/models/errors/errormessage.py b/platform/src/codatplatform/models/errors/errormessage.py deleted file mode 100644 index 0b366e95a..000000000 --- a/platform/src/codatplatform/models/errors/errormessage.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from ...models.shared import errorvalidation as shared_errorvalidation -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) - -@dataclasses.dataclass -class ErrorMessage(Exception): - r"""Bad Request""" - UNSET='__SPEAKEASY_UNSET__' - can_be_retried: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('canBeRetried'), 'exclude': lambda f: f is None }}) - r"""`True` if the error occurred transiently and can be retried.""" - correlation_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('correlationId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" - detailed_error_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detailedErrorCode'), 'exclude': lambda f: f is None }}) - r"""Machine readable error code used to automate processes based on the code returned.""" - error: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('error'), 'exclude': lambda f: f is None }}) - r"""A brief description of the error.""" - service: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('service'), 'exclude': lambda f: f is None }}) - r"""Codat's service the returned the error.""" - status_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) - r"""The HTTP status code returned by the error.""" - validation: Optional[shared_errorvalidation.ErrorValidation] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is ErrorMessage.UNSET }}) - r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" - - - def __str__(self) -> str: - return utils.marshal_json(self, type(self)) diff --git a/platform/src/codatplatform/models/errors/sdkerror.py b/platform/src/codatplatform/models/errors/sdkerror.py deleted file mode 100644 index 6bb02bbd6..000000000 --- a/platform/src/codatplatform/models/errors/sdkerror.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http - - -class SDKError(Exception): - """Represents an error returned by the API.""" - message: str - status_code: int - body: str - raw_response: requests_http.Response - - def __init__(self, message: str, status_code: int, body: str, raw_response: requests_http.Response): - self.message = message - self.status_code = status_code - self.body = body - self.raw_response = raw_response - - def __str__(self): - body = '' - if len(self.body) > 0: - body = f'\n{self.body}' - - return f'{self.message}: Status {self.status_code}{body}' diff --git a/platform/src/codatplatform/models/operations/__init__.py b/platform/src/codatplatform/models/operations/__init__.py deleted file mode 100644 index 9b8ad0f16..000000000 --- a/platform/src/codatplatform/models/operations/__init__.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .add_company_to_group import * -from .configure_custom_data_type import * -from .configure_supplemental_data import * -from .create_api_key import * -from .create_company import * -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 * -from .get_connection import * -from .get_connection_management_access_token import * -from .get_connection_management_cors_settings import * -from .get_create_update_model_options_by_data_type import * -from .get_custom_data_type_configuration import * -from .get_integration import * -from .get_integrations_branding import * -from .get_profile import * -from .get_profile_syncsettings import * -from .get_pull_operation import * -from .get_push_operation import * -from .get_supplemental_data_configuration import * -from .get_webhook import * -from .list_api_keys import * -from .list_companies import * -from .list_connections import * -from .list_custom_data_type_records import * -from .list_groups import * -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 * -from .remove_company_from_group import * -from .set_connection_management_cors_settings import * -from .unlink_connection import * -from .update_company import * -from .update_connection_authorization import * -from .update_profile import * -from .update_profile_syncsettings import * - -__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","GetConnectionManagementAccessTokenRequest","GetConnectionManagementAccessTokenResponse","GetConnectionManagementCorsSettingsResponse","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","SetConnectionManagementCorsSettingsResponse","UnlinkConnectionRequest","UnlinkConnectionResponse","UpdateCompanyRequest","UpdateCompanyResponse","UpdateConnectionAuthorizationRequest","UpdateConnectionAuthorizationResponse","UpdateProfileResponse","UpdateProfileSyncSettingsRequestBody","UpdateProfileSyncSettingsResponse"] diff --git a/platform/src/codatplatform/models/operations/add_company_to_group.py b/platform/src/codatplatform/models/operations/add_company_to_group.py deleted file mode 100644 index f7afeabc6..000000000 --- a/platform/src/codatplatform/models/operations/add_company_to_group.py +++ /dev/null @@ -1,31 +0,0 @@ -"""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 company as shared_company -from ...models.shared import companygroupassignment as shared_companygroupassignment -from typing import Optional - - -@dataclasses.dataclass -class AddCompanyToGroupRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - company_group_assignment: Optional[shared_companygroupassignment.CompanyGroupAssignment] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class AddCompanyToGroupResponse: - 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""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/platform/src/codatplatform/models/operations/configure_custom_data_type.py b/platform/src/codatplatform/models/operations/configure_custom_data_type.py deleted file mode 100644 index 839fb1649..000000000 --- a/platform/src/codatplatform/models/operations/configure_custom_data_type.py +++ /dev/null @@ -1,33 +0,0 @@ -"""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 customdatatypeconfiguration as shared_customdatatypeconfiguration -from typing import Optional - - -@dataclasses.dataclass -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.""" - 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.""" - - - - -@dataclasses.dataclass -class ConfigureCustomDataTypeResponse: - 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""" - custom_data_type_configuration: Optional[shared_customdatatypeconfiguration.CustomDataTypeConfiguration] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/configure_supplemental_data.py b/platform/src/codatplatform/models/operations/configure_supplemental_data.py deleted file mode 100644 index 119c362f7..000000000 --- a/platform/src/codatplatform/models/operations/configure_supplemental_data.py +++ /dev/null @@ -1,56 +0,0 @@ -"""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 supplementaldataconfiguration as shared_supplementaldataconfiguration -from enum import Enum -from typing import Optional - -class DataType(str, Enum): - r"""Data types that support supplemental data""" - CHART_OF_ACCOUNTS = 'chartOfAccounts' - BILLS = 'bills' - COMPANY = 'company' - CREDIT_NOTES = 'creditNotes' - CUSTOMERS = 'customers' - INVOICES = 'invoices' - ITEMS = 'items' - JOURNAL_ENTRIES = 'journalEntries' - SUPPLIERS = 'suppliers' - TAX_RATES = 'taxRates' - COMMERCE_COMPANY_INFO = 'commerce-companyInfo' - COMMERCE_CUSTOMERS = 'commerce-customers' - COMMERCE_DISPUTES = 'commerce-disputes' - COMMERCE_LOCATIONS = 'commerce-locations' - COMMERCE_ORDERS = 'commerce-orders' - COMMERCE_PAYMENTS = 'commerce-payments' - COMMERCE_PAYMENT_METHODS = 'commerce-paymentMethods' - COMMERCE_PRODUCTS = 'commerce-products' - COMMERCE_PRODUCT_CATEGORIES = 'commerce-productCategories' - COMMERCE_TAX_COMPONENTS = 'commerce-taxComponents' - COMMERCE_TRANSACTIONS = 'commerce-transactions' - - -@dataclasses.dataclass -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.""" - 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.""" - - - - -@dataclasses.dataclass -class ConfigureSupplementalDataResponse: - 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/create_api_key.py b/platform/src/codatplatform/models/operations/create_api_key.py deleted file mode 100644 index 61b1ac8c4..000000000 --- a/platform/src/codatplatform/models/operations/create_api_key.py +++ /dev/null @@ -1,22 +0,0 @@ -"""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 apikeydetails as shared_apikeydetails -from typing import Optional - - -@dataclasses.dataclass -class CreateAPIKeyResponse: - UNSET='__SPEAKEASY_UNSET__' - 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""" - api_key_details: Optional[shared_apikeydetails.APIKeyDetails] = dataclasses.field(default=UNSET) - r"""Success""" - - diff --git a/platform/src/codatplatform/models/operations/create_company.py b/platform/src/codatplatform/models/operations/create_company.py deleted file mode 100644 index d7751fcaf..000000000 --- a/platform/src/codatplatform/models/operations/create_company.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 company as shared_company -from typing import Optional - - -@dataclasses.dataclass -class CreateCompanyResponse: - 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""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/create_connection.py b/platform/src/codatplatform/models/operations/create_connection.py deleted file mode 100644 index 6ba75073c..000000000 --- a/platform/src/codatplatform/models/operations/create_connection.py +++ /dev/null @@ -1,41 +0,0 @@ -"""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 connection as shared_connection -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateConnectionRequestBody: - platform_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platformKey'), 'exclude': lambda f: f is None }}) - 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.""" - - - - -@dataclasses.dataclass -class CreateConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - request_body: Optional[CreateConnectionRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class CreateConnectionResponse: - 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""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/create_group.py b/platform/src/codatplatform/models/operations/create_group.py deleted file mode 100644 index 2c1e17fc8..000000000 --- a/platform/src/codatplatform/models/operations/create_group.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 group as shared_group -from typing import Optional - - -@dataclasses.dataclass -class CreateGroupResponse: - 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""" - group: Optional[shared_group.Group] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/platform/src/codatplatform/models/operations/create_rule.py b/platform/src/codatplatform/models/operations/create_rule.py deleted file mode 100644 index 46680583b..000000000 --- a/platform/src/codatplatform/models/operations/create_rule.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 webhook as shared_webhook -from typing import Optional - - -@dataclasses.dataclass -class CreateRuleResponse: - 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: Optional[shared_webhook.Webhook] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/create_webhook_consumer.py b/platform/src/codatplatform/models/operations/create_webhook_consumer.py deleted file mode 100644 index 795be21fe..000000000 --- a/platform/src/codatplatform/models/operations/create_webhook_consumer.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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_api_key.py b/platform/src/codatplatform/models/operations/delete_api_key.py deleted file mode 100644 index 549593296..000000000 --- a/platform/src/codatplatform/models/operations/delete_api_key.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.errors import errormessage as errors_errormessage -from typing import Optional - - -@dataclasses.dataclass -class DeleteAPIKeyRequest: - api_key_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'apiKeyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for api key.""" - - - - -@dataclasses.dataclass -class DeleteAPIKeyResponse: - 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""" - error_message: Optional[errors_errormessage.ErrorMessage] = dataclasses.field(default=None) - r"""Too many requests were made in a given amount of time. Wait a short period and then try again.""" - - diff --git a/platform/src/codatplatform/models/operations/delete_company.py b/platform/src/codatplatform/models/operations/delete_company.py deleted file mode 100644 index e544df054..000000000 --- a/platform/src/codatplatform/models/operations/delete_company.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DeleteCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class DeleteCompanyResponse: - 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/delete_connection.py b/platform/src/codatplatform/models/operations/delete_connection.py deleted file mode 100644 index f6a77abb5..000000000 --- a/platform/src/codatplatform/models/operations/delete_connection.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DeleteConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - - - - -@dataclasses.dataclass -class DeleteConnectionResponse: - 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/delete_webhook_consumer.py b/platform/src/codatplatform/models/operations/delete_webhook_consumer.py deleted file mode 100644 index c139eb4b7..000000000 --- a/platform/src/codatplatform/models/operations/delete_webhook_consumer.py +++ /dev/null @@ -1,25 +0,0 @@ -"""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_company.py b/platform/src/codatplatform/models/operations/get_company.py deleted file mode 100644 index 65e6aba22..000000000 --- a/platform/src/codatplatform/models/operations/get_company.py +++ /dev/null @@ -1,29 +0,0 @@ -"""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 company as shared_company -from typing import Optional - - -@dataclasses.dataclass -class GetCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetCompanyResponse: - 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""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_company_data_status.py b/platform/src/codatplatform/models/operations/get_company_data_status.py deleted file mode 100644 index dbe63c4a9..000000000 --- a/platform/src/codatplatform/models/operations/get_company_data_status.py +++ /dev/null @@ -1,29 +0,0 @@ -"""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 datastatuses as shared_datastatuses -from typing import Optional - - -@dataclasses.dataclass -class GetCompanyDataStatusRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetCompanyDataStatusResponse: - 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""" - data_statuses: Optional[shared_datastatuses.DataStatuses] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_company_push_history.py b/platform/src/codatplatform/models/operations/get_company_push_history.py deleted file mode 100644 index 200cb98b4..000000000 --- a/platform/src/codatplatform/models/operations/get_company_push_history.py +++ /dev/null @@ -1,37 +0,0 @@ -"""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 pushoperations as shared_pushoperations -from typing import Optional - - -@dataclasses.dataclass -class GetCompanyPushHistoryRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class GetCompanyPushHistoryResponse: - 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""" - push_operations: Optional[shared_pushoperations.PushOperations] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_connection.py b/platform/src/codatplatform/models/operations/get_connection.py deleted file mode 100644 index 083a24ed2..000000000 --- a/platform/src/codatplatform/models/operations/get_connection.py +++ /dev/null @@ -1,31 +0,0 @@ -"""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 connection as shared_connection -from typing import Optional - - -@dataclasses.dataclass -class GetConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - - - - -@dataclasses.dataclass -class GetConnectionResponse: - 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""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_connection_management_access_token.py b/platform/src/codatplatform/models/operations/get_connection_management_access_token.py deleted file mode 100644 index 1e23b95a3..000000000 --- a/platform/src/codatplatform/models/operations/get_connection_management_access_token.py +++ /dev/null @@ -1,29 +0,0 @@ -"""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 connectionmanagementaccesstoken as shared_connectionmanagementaccesstoken -from typing import Optional - - -@dataclasses.dataclass -class GetConnectionManagementAccessTokenRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetConnectionManagementAccessTokenResponse: - 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""" - connection_management_access_token: Optional[shared_connectionmanagementaccesstoken.ConnectionManagementAccessToken] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/platform/src/codatplatform/models/operations/get_connection_management_cors_settings.py b/platform/src/codatplatform/models/operations/get_connection_management_cors_settings.py deleted file mode 100644 index 9065e12a0..000000000 --- a/platform/src/codatplatform/models/operations/get_connection_management_cors_settings.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 connectionmanagementallowedorigins as shared_connectionmanagementallowedorigins -from typing import Optional - - -@dataclasses.dataclass -class GetConnectionManagementCorsSettingsResponse: - 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""" - connection_management_allowed_origins: Optional[shared_connectionmanagementallowedorigins.ConnectionManagementAllowedOrigins] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/platform/src/codatplatform/models/operations/get_create_update_model_options_by_data_type.py b/platform/src/codatplatform/models/operations/get_create_update_model_options_by_data_type.py deleted file mode 100644 index 17d9abdcb..000000000 --- a/platform/src/codatplatform/models/operations/get_create_update_model_options_by_data_type.py +++ /dev/null @@ -1,34 +0,0 @@ -"""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 pushoption as shared_pushoption -from ...models.shared import schema_datatype as shared_schema_datatype -from typing import Optional - - -@dataclasses.dataclass -class GetCreateUpdateModelOptionsByDataTypeRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - data_type: shared_schema_datatype.SchemaDataType = dataclasses.field(metadata={'path_param': { 'field_name': 'dataType', 'style': 'simple', 'explode': False }}) - r"""The key of a Codat data type""" - - - - -@dataclasses.dataclass -class GetCreateUpdateModelOptionsByDataTypeResponse: - 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""" - push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) - r"""OK""" - - 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 deleted file mode 100644 index faaab882c..000000000 --- a/platform/src/codatplatform/models/operations/get_custom_data_type_configuration.py +++ /dev/null @@ -1,31 +0,0 @@ -"""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 customdatatyperecords as shared_customdatatyperecords -from typing import Optional - - -@dataclasses.dataclass -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.""" - - - - -@dataclasses.dataclass -class GetCustomDataTypeConfigurationResponse: - 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""" - custom_data_type_records: Optional[shared_customdatatyperecords.CustomDataTypeRecords] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_integration.py b/platform/src/codatplatform/models/operations/get_integration.py deleted file mode 100644 index aeaa32b6a..000000000 --- a/platform/src/codatplatform/models/operations/get_integration.py +++ /dev/null @@ -1,29 +0,0 @@ -"""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 integration as shared_integration -from typing import Optional - - -@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.""" - - - - -@dataclasses.dataclass -class GetIntegrationResponse: - 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""" - integration: Optional[shared_integration.Integration] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_integrations_branding.py b/platform/src/codatplatform/models/operations/get_integrations_branding.py deleted file mode 100644 index 4ff6f972d..000000000 --- a/platform/src/codatplatform/models/operations/get_integrations_branding.py +++ /dev/null @@ -1,29 +0,0 @@ -"""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 branding as shared_branding -from typing import Optional - - -@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.""" - - - - -@dataclasses.dataclass -class GetIntegrationsBrandingResponse: - 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""" - branding: Optional[shared_branding.Branding] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_profile.py b/platform/src/codatplatform/models/operations/get_profile.py deleted file mode 100644 index ca802806a..000000000 --- a/platform/src/codatplatform/models/operations/get_profile.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 profile as shared_profile -from typing import Optional - - -@dataclasses.dataclass -class GetProfileResponse: - 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""" - profile: Optional[shared_profile.Profile] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_profile_syncsettings.py b/platform/src/codatplatform/models/operations/get_profile_syncsettings.py deleted file mode 100644 index 075af96fd..000000000 --- a/platform/src/codatplatform/models/operations/get_profile_syncsettings.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 syncsettings as shared_syncsettings -from typing import Optional - - -@dataclasses.dataclass -class GetProfileSyncSettingsResponse: - 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""" - sync_settings: Optional[shared_syncsettings.SyncSettings] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_pull_operation.py b/platform/src/codatplatform/models/operations/get_pull_operation.py deleted file mode 100644 index ecdbbb805..000000000 --- a/platform/src/codatplatform/models/operations/get_pull_operation.py +++ /dev/null @@ -1,31 +0,0 @@ -"""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 pulloperation as shared_pulloperation -from typing import Optional - - -@dataclasses.dataclass -class GetPullOperationRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - dataset_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'datasetId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for the dataset that completed its sync.""" - - - - -@dataclasses.dataclass -class GetPullOperationResponse: - 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""" - pull_operation: Optional[shared_pulloperation.PullOperation] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_push_operation.py b/platform/src/codatplatform/models/operations/get_push_operation.py deleted file mode 100644 index bcca4f62d..000000000 --- a/platform/src/codatplatform/models/operations/get_push_operation.py +++ /dev/null @@ -1,31 +0,0 @@ -"""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 pushoperation as shared_pushoperation -from typing import Optional - - -@dataclasses.dataclass -class GetPushOperationRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - push_operation_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'pushOperationKey', 'style': 'simple', 'explode': False }}) - r"""Push operation key.""" - - - - -@dataclasses.dataclass -class GetPushOperationResponse: - 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""" - push_operation: Optional[shared_pushoperation.PushOperation] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_supplemental_data_configuration.py b/platform/src/codatplatform/models/operations/get_supplemental_data_configuration.py deleted file mode 100644 index d21564e90..000000000 --- a/platform/src/codatplatform/models/operations/get_supplemental_data_configuration.py +++ /dev/null @@ -1,56 +0,0 @@ -"""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 supplementaldataconfiguration as shared_supplementaldataconfiguration -from enum import Enum -from typing import Optional - -class PathParamDataType(str, Enum): - r"""Data types that support supplemental data""" - CHART_OF_ACCOUNTS = 'chartOfAccounts' - BILLS = 'bills' - COMPANY = 'company' - CREDIT_NOTES = 'creditNotes' - CUSTOMERS = 'customers' - INVOICES = 'invoices' - ITEMS = 'items' - JOURNAL_ENTRIES = 'journalEntries' - SUPPLIERS = 'suppliers' - TAX_RATES = 'taxRates' - COMMERCE_COMPANY_INFO = 'commerce-companyInfo' - COMMERCE_CUSTOMERS = 'commerce-customers' - COMMERCE_DISPUTES = 'commerce-disputes' - COMMERCE_LOCATIONS = 'commerce-locations' - COMMERCE_ORDERS = 'commerce-orders' - COMMERCE_PAYMENTS = 'commerce-payments' - COMMERCE_PAYMENT_METHODS = 'commerce-paymentMethods' - COMMERCE_PRODUCTS = 'commerce-products' - COMMERCE_PRODUCT_CATEGORIES = 'commerce-productCategories' - COMMERCE_TAX_COMPONENTS = 'commerce-taxComponents' - COMMERCE_TRANSACTIONS = 'commerce-transactions' - - -@dataclasses.dataclass -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.""" - - - - -@dataclasses.dataclass -class GetSupplementalDataConfigurationResponse: - 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""" - supplemental_data_configuration: Optional[shared_supplementaldataconfiguration.SupplementalDataConfiguration] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/get_webhook.py b/platform/src/codatplatform/models/operations/get_webhook.py deleted file mode 100644 index fbe60cff1..000000000 --- a/platform/src/codatplatform/models/operations/get_webhook.py +++ /dev/null @@ -1,29 +0,0 @@ -"""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 webhook as shared_webhook -from typing import Optional - - -@dataclasses.dataclass -class GetWebhookRequest: - rule_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'ruleId', 'style': 'simple', 'explode': False }}) - r"""Unique ID of the webhook or rule.""" - - - - -@dataclasses.dataclass -class GetWebhookResponse: - 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: Optional[shared_webhook.Webhook] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/list_api_keys.py b/platform/src/codatplatform/models/operations/list_api_keys.py deleted file mode 100644 index 9a29a5e9c..000000000 --- a/platform/src/codatplatform/models/operations/list_api_keys.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 apikeys as shared_apikeys -from typing import Optional - - -@dataclasses.dataclass -class ListAPIKeysResponse: - 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""" - api_keys: Optional[shared_apikeys.APIKeys] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/platform/src/codatplatform/models/operations/list_companies.py b/platform/src/codatplatform/models/operations/list_companies.py deleted file mode 100644 index 41f52fdfb..000000000 --- a/platform/src/codatplatform/models/operations/list_companies.py +++ /dev/null @@ -1,35 +0,0 @@ -"""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 companies as shared_companies -from typing import Optional - - -@dataclasses.dataclass -class ListCompaniesRequest: - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListCompaniesResponse: - 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""" - companies: Optional[shared_companies.Companies] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/list_connections.py b/platform/src/codatplatform/models/operations/list_connections.py deleted file mode 100644 index e4665b548..000000000 --- a/platform/src/codatplatform/models/operations/list_connections.py +++ /dev/null @@ -1,37 +0,0 @@ -"""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 connections as shared_connections -from typing import Optional - - -@dataclasses.dataclass -class ListConnectionsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListConnectionsResponse: - 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""" - connections: Optional[shared_connections.Connections] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/list_custom_data_type_records.py b/platform/src/codatplatform/models/operations/list_custom_data_type_records.py deleted file mode 100644 index ddcd47afa..000000000 --- a/platform/src/codatplatform/models/operations/list_custom_data_type_records.py +++ /dev/null @@ -1,37 +0,0 @@ -"""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 customdatatyperecords as shared_customdatatyperecords -from typing import Optional - - -@dataclasses.dataclass -class ListCustomDataTypeRecordsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - custom_data_identifier: str = dataclasses.field(metadata={'path_param': { 'field_name': 'customDataIdentifier', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a custom data type.""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - - - - -@dataclasses.dataclass -class ListCustomDataTypeRecordsResponse: - 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""" - custom_data_type_records: Optional[shared_customdatatyperecords.CustomDataTypeRecords] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/list_groups.py b/platform/src/codatplatform/models/operations/list_groups.py deleted file mode 100644 index 94ebd2631..000000000 --- a/platform/src/codatplatform/models/operations/list_groups.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 groups as shared_groups -from typing import Optional - - -@dataclasses.dataclass -class ListGroupsResponse: - 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""" - groups: Optional[shared_groups.Groups] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/platform/src/codatplatform/models/operations/list_integrations.py b/platform/src/codatplatform/models/operations/list_integrations.py deleted file mode 100644 index 7adb05af9..000000000 --- a/platform/src/codatplatform/models/operations/list_integrations.py +++ /dev/null @@ -1,35 +0,0 @@ -"""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 integrations as shared_integrations -from typing import Optional - - -@dataclasses.dataclass -class ListIntegrationsRequest: - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListIntegrationsResponse: - 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""" - integrations: Optional[shared_integrations.Integrations] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/list_pull_operations.py b/platform/src/codatplatform/models/operations/list_pull_operations.py deleted file mode 100644 index d25577197..000000000 --- a/platform/src/codatplatform/models/operations/list_pull_operations.py +++ /dev/null @@ -1,37 +0,0 @@ -"""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 pulloperations as shared_pulloperations -from typing import Optional - - -@dataclasses.dataclass -class ListPullOperationsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListPullOperationsResponse: - 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""" - pull_operations: Optional[shared_pulloperations.PullOperations] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/list_rules.py b/platform/src/codatplatform/models/operations/list_rules.py deleted file mode 100644 index 78cd137a7..000000000 --- a/platform/src/codatplatform/models/operations/list_rules.py +++ /dev/null @@ -1,35 +0,0 @@ -"""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 webhooks as shared_webhooks -from typing import Optional - - -@dataclasses.dataclass -class ListRulesRequest: - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListRulesResponse: - 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""" - webhooks: Optional[shared_webhooks.Webhooks] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/list_webhook_consumers.py b/platform/src/codatplatform/models/operations/list_webhook_consumers.py deleted file mode 100644 index 496b49d7f..000000000 --- a/platform/src/codatplatform/models/operations/list_webhook_consumers.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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/operations/refresh_company_data.py b/platform/src/codatplatform/models/operations/refresh_company_data.py deleted file mode 100644 index 9abcb1baa..000000000 --- a/platform/src/codatplatform/models/operations/refresh_company_data.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class RefreshCompanyDataRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class RefreshCompanyDataResponse: - 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/refresh_custom_data_type.py b/platform/src/codatplatform/models/operations/refresh_custom_data_type.py deleted file mode 100644 index fb30d9155..000000000 --- a/platform/src/codatplatform/models/operations/refresh_custom_data_type.py +++ /dev/null @@ -1,33 +0,0 @@ -"""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 pulloperation as shared_pulloperation -from typing import Optional - - -@dataclasses.dataclass -class RefreshCustomDataTypeRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - custom_data_identifier: str = dataclasses.field(metadata={'path_param': { 'field_name': 'customDataIdentifier', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a custom data type.""" - - - - -@dataclasses.dataclass -class RefreshCustomDataTypeResponse: - 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""" - pull_operation: Optional[shared_pulloperation.PullOperation] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/refresh_data_type.py b/platform/src/codatplatform/models/operations/refresh_data_type.py deleted file mode 100644 index 1c2f20d9f..000000000 --- a/platform/src/codatplatform/models/operations/refresh_data_type.py +++ /dev/null @@ -1,34 +0,0 @@ -"""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 pulloperation as shared_pulloperation -from ...models.shared import schema_datatype as shared_schema_datatype -from typing import Optional - - -@dataclasses.dataclass -class RefreshDataTypeRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - data_type: shared_schema_datatype.SchemaDataType = dataclasses.field(metadata={'path_param': { 'field_name': 'dataType', 'style': 'simple', 'explode': False }}) - r"""The key of a Codat data type""" - connection_id: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'connectionId', 'style': 'form', 'explode': True }}) - r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" - - - - -@dataclasses.dataclass -class RefreshDataTypeResponse: - 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""" - pull_operation: Optional[shared_pulloperation.PullOperation] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/remove_company_from_group.py b/platform/src/codatplatform/models/operations/remove_company_from_group.py deleted file mode 100644 index 2cf3a6e5d..000000000 --- a/platform/src/codatplatform/models/operations/remove_company_from_group.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class RemoveCompanyFromGroupRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - group_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'groupId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for the group.""" - - - - -@dataclasses.dataclass -class RemoveCompanyFromGroupResponse: - 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/set_connection_management_cors_settings.py b/platform/src/codatplatform/models/operations/set_connection_management_cors_settings.py deleted file mode 100644 index 08f5da11f..000000000 --- a/platform/src/codatplatform/models/operations/set_connection_management_cors_settings.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 connectionmanagementallowedorigins as shared_connectionmanagementallowedorigins -from typing import Optional - - -@dataclasses.dataclass -class SetConnectionManagementCorsSettingsResponse: - 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""" - connection_management_allowed_origins: Optional[shared_connectionmanagementallowedorigins.ConnectionManagementAllowedOrigins] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/platform/src/codatplatform/models/operations/unlink_connection.py b/platform/src/codatplatform/models/operations/unlink_connection.py deleted file mode 100644 index ad4ba6b26..000000000 --- a/platform/src/codatplatform/models/operations/unlink_connection.py +++ /dev/null @@ -1,33 +0,0 @@ -"""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 connection as shared_connection -from ...models.shared import updateconnectionstatus as shared_updateconnectionstatus -from typing import Optional - - -@dataclasses.dataclass -class UnlinkConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - update_connection_status: Optional[shared_updateconnectionstatus.UpdateConnectionStatus] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UnlinkConnectionResponse: - 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""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/update_company.py b/platform/src/codatplatform/models/operations/update_company.py deleted file mode 100644 index 4eae4a4d0..000000000 --- a/platform/src/codatplatform/models/operations/update_company.py +++ /dev/null @@ -1,31 +0,0 @@ -"""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 company as shared_company -from ...models.shared import companyrequestbody as shared_companyrequestbody -from typing import Optional - - -@dataclasses.dataclass -class UpdateCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - company_request_body: Optional[shared_companyrequestbody.CompanyRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UpdateCompanyResponse: - 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""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/update_connection_authorization.py b/platform/src/codatplatform/models/operations/update_connection_authorization.py deleted file mode 100644 index 3ae434d80..000000000 --- a/platform/src/codatplatform/models/operations/update_connection_authorization.py +++ /dev/null @@ -1,32 +0,0 @@ -"""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 connection as shared_connection -from typing import Dict, Optional - - -@dataclasses.dataclass -class UpdateConnectionAuthorizationRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - request_body: Optional[Dict[str, str]] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UpdateConnectionAuthorizationResponse: - 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""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/update_profile.py b/platform/src/codatplatform/models/operations/update_profile.py deleted file mode 100644 index 99890f536..000000000 --- a/platform/src/codatplatform/models/operations/update_profile.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 profile as shared_profile -from typing import Optional - - -@dataclasses.dataclass -class UpdateProfileResponse: - 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""" - profile: Optional[shared_profile.Profile] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/platform/src/codatplatform/models/operations/update_profile_syncsettings.py b/platform/src/codatplatform/models/operations/update_profile_syncsettings.py deleted file mode 100644 index e1b429b38..000000000 --- a/platform/src/codatplatform/models/operations/update_profile_syncsettings.py +++ /dev/null @@ -1,36 +0,0 @@ -"""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 syncsetting as shared_syncsetting -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateProfileSyncSettingsRequestBody: - r"""Include a `syncSetting` object for each data type. - `syncFromWindow`, `syncFromUTC` & `monthsToSync` only need to be included if you wish to set a value for them. - """ - client_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('clientId') }}) - r"""Unique identifier for your client in Codat.""" - settings: List[shared_syncsetting.SyncSetting] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('settings') }}) - overrides_defaults: Optional[bool] = dataclasses.field(default=True, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('overridesDefaults'), 'exclude': lambda f: f is None }}) - r"""Set to `True` if you want to override default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings).""" - - - - -@dataclasses.dataclass -class UpdateProfileSyncSettingsResponse: - 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/shared/__init__.py b/platform/src/codatplatform/models/shared/__init__.py deleted file mode 100644 index e9b6abb2d..000000000 --- a/platform/src/codatplatform/models/shared/__init__.py +++ /dev/null @@ -1,91 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .apikeydetails import * -from .apikeys import * -from .branding import * -from .brandingbutton import * -from .brandingimage import * -from .brandinglogo import * -from .clientratelimitreachedwebhook import * -from .clientratelimitreachedwebhookdata import * -from .clientratelimitresetwebhook import * -from .clientratelimitresetwebhookdata import * -from .companies import * -from .company import * -from .companygroupassignment import * -from .companyrequestbody import * -from .connection import * -from .connectionmanagementaccesstoken import * -from .connectionmanagementallowedorigins import * -from .connections import * -from .connectionstatuschangedwebhook import * -from .connectionstatuschangedwebhookdata import * -from .createapikey import * -from .createrule import * -from .customdatatypeconfiguration import * -from .customdatatyperecord import * -from .customdatatyperecords import * -from .dataconnectionerror import * -from .dataconnectionstatus import * -from .datasetdatachangedwebhook import * -from .datasetstatuschangederrorwebhook import * -from .datasetstatuschangederrorwebhookdata import * -from .datastatus import * -from .datastatuses import * -from .datasynccompletedwebhook import * -from .datasynccompletedwebhookdata import * -from .datatype import * -from .datatypefeature import * -from .errorvalidation import * -from .errorvalidationitem import * -from .featurestate import * -from .featuretype import * -from .group import * -from .groupprototype import * -from .groupref import * -from .groups import * -from .halref import * -from .imagereference import * -from .integration import * -from .integrations import * -from .links import * -from .newcompanysynchronizedwebhook import * -from .newcompanysynchronizedwebhookdata import * -from .profile import * -from .pulloperation import * -from .pulloperations import * -from .pushchangetype import * -from .pushfieldvalidation import * -from .pushoperation import * -from .pushoperationchange import * -from .pushoperationref import * -from .pushoperations import * -from .pushoperationstatus import * -from .pushoperationstatuschangedwebhook import * -from .pushoperationstatuschangedwebhookdata import * -from .pushoperationtimedoutwebhook import * -from .pushoperationtimedoutwebhookdata import * -from .pushoption import * -from .pushoptionchoice import * -from .pushoptionproperty import * -from .pushoptiontype import * -from .pushvalidationinfo import * -from .schema_datatype import * -from .security import * -from .sourcetype import * -from .status import * -from .supplementaldataconfiguration import * -from .supportedfeature import * -from .syncsetting import * -from .syncsettings import * -from .updateconnectionstatus import * -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","ConnectionManagementAccessToken","ConnectionManagementAllowedOrigins","ConnectionStatusChangedWebhook","ConnectionStatusChangedWebhookData","Connections","Content","CreateAPIKey","CreateRule","CustomDataTypeConfiguration","CustomDataTypeRecord","CustomDataTypeRecords","DataConnectionError","DataConnectionStatus","DataStatus","DataStatuses","DataSyncCompletedWebhook","DataSyncCompletedWebhookData","DataType","DataTypeFeature","DataTypes","DatasetDataChangedWebhook","DatasetDataChangedWebhookData","DatasetStatus","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/apikeydetails.py b/platform/src/codatplatform/models/shared/apikeydetails.py deleted file mode 100644 index 427d114f1..000000000 --- a/platform/src/codatplatform/models/shared/apikeydetails.py +++ /dev/null @@ -1,43 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class APIKeyDetails: - r"""Details of the API key.""" - UNSET='__SPEAKEASY_UNSET__' - api_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('apiKey'), 'exclude': lambda f: f is None }}) - r"""The API key value used to make authenticated http requests.""" - created_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdDate'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - 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 API key.""" - name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is APIKeyDetails.UNSET }}) - r"""A meaningful name assigned to the API key.""" - - diff --git a/platform/src/codatplatform/models/shared/apikeys.py b/platform/src/codatplatform/models/shared/apikeys.py deleted file mode 100644 index b2965e9fe..000000000 --- a/platform/src/codatplatform/models/shared/apikeys.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .apikeydetails import APIKeyDetails -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class APIKeys: - results: Optional[List[APIKeyDetails]] = 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/branding.py b/platform/src/codatplatform/models/shared/branding.py deleted file mode 100644 index d2ddeffe1..000000000 --- a/platform/src/codatplatform/models/shared/branding.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .brandingbutton import BrandingButton -from .brandinglogo import BrandingLogo -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Branding: - button: Optional[BrandingButton] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('button'), 'exclude': lambda f: f is None }}) - r"""Button branding references.""" - logo: Optional[BrandingLogo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('logo'), 'exclude': lambda f: f is None }}) - r"""Logo branding references.""" - source_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceId'), 'exclude': lambda f: f is None }}) - r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" - - diff --git a/platform/src/codatplatform/models/shared/brandingbutton.py b/platform/src/codatplatform/models/shared/brandingbutton.py deleted file mode 100644 index 96a980b14..000000000 --- a/platform/src/codatplatform/models/shared/brandingbutton.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .brandingimage import BrandingImage -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class BrandingButton: - r"""Button branding references.""" - default: Optional[BrandingImage] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('default'), 'exclude': lambda f: f is None }}) - hover: Optional[BrandingImage] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('hover'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/brandingimage.py b/platform/src/codatplatform/models/shared/brandingimage.py deleted file mode 100644 index 2dd2003e6..000000000 --- a/platform/src/codatplatform/models/shared/brandingimage.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .imagereference import ImageReference -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class BrandingImage: - image: Optional[ImageReference] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('image'), 'exclude': lambda f: f is None }}) - r"""Image reference.""" - - diff --git a/platform/src/codatplatform/models/shared/brandinglogo.py b/platform/src/codatplatform/models/shared/brandinglogo.py deleted file mode 100644 index a9c629d25..000000000 --- a/platform/src/codatplatform/models/shared/brandinglogo.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .brandingimage import BrandingImage -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class BrandingLogo: - r"""Logo branding references.""" - full: Optional[BrandingImage] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('full'), 'exclude': lambda f: f is None }}) - square: Optional[BrandingImage] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('square'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/clientratelimitreachedwebhook.py b/platform/src/codatplatform/models/shared/clientratelimitreachedwebhook.py deleted file mode 100644 index b561431c5..000000000 --- a/platform/src/codatplatform/models/shared/clientratelimitreachedwebhook.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .clientratelimitreachedwebhookdata import ClientRateLimitReachedWebhookData -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitReachedWebhook: - r"""Webhook request body for a client that has reached their rate limit.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/clientratelimitreachedwebhookdata.py b/platform/src/codatplatform/models/shared/clientratelimitreachedwebhookdata.py deleted file mode 100644 index a138957c5..000000000 --- a/platform/src/codatplatform/models/shared/clientratelimitreachedwebhookdata.py +++ /dev/null @@ -1,37 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitReachedWebhookData: - daily_quota: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DailyQuota'), 'exclude': lambda f: f is None }}) - r"""The number of available requests per day.""" - expires_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ExpiresUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - - diff --git a/platform/src/codatplatform/models/shared/clientratelimitresetwebhook.py b/platform/src/codatplatform/models/shared/clientratelimitresetwebhook.py deleted file mode 100644 index 3859f41cf..000000000 --- a/platform/src/codatplatform/models/shared/clientratelimitresetwebhook.py +++ /dev/null @@ -1,32 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .clientratelimitresetwebhookdata import ClientRateLimitResetWebhookData -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitResetWebhook: - r"""Webhook request body for a client that has had their rate limit reset.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/clientratelimitresetwebhookdata.py b/platform/src/codatplatform/models/shared/clientratelimitresetwebhookdata.py deleted file mode 100644 index 368201d28..000000000 --- a/platform/src/codatplatform/models/shared/clientratelimitresetwebhookdata.py +++ /dev/null @@ -1,42 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitResetWebhookData: - UNSET='__SPEAKEASY_UNSET__' - daily_quota: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DailyQuota'), 'exclude': lambda f: f is None }}) - r"""The number of available requests per day.""" - expires_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ExpiresUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - 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 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/companies.py b/platform/src/codatplatform/models/shared/companies.py deleted file mode 100644 index 5ff1bfe1f..000000000 --- a/platform/src/codatplatform/models/shared/companies.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .company import Company -from .links import Links -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Companies: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Company]] = 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/company.py b/platform/src/codatplatform/models/shared/company.py deleted file mode 100644 index fb6495ec3..000000000 --- a/platform/src/codatplatform/models/shared/company.py +++ /dev/null @@ -1,82 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .connection import Connection -from .groupref import GroupRef -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Company: - r"""In Codat, a 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](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. - - Typically each company is one of your customers. - - When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. - """ - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Unique identifier for your SMB in Codat.""" - name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) - r"""The name of the company""" - redirect: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('redirect') }}) - r"""The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.""" - created: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - created_by_user_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdByUserName'), 'exclude': lambda f: f is None }}) - r"""Name of user that created the company in Codat.""" - data_connections: Optional[List[Connection]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnections'), 'exclude': lambda f: f is None }}) - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" - groups: Optional[List[GroupRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('groups'), 'exclude': lambda f: f is None }}) - r"""An array of groups the company has been assigned to.""" - last_sync: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lastSync'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - platform: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platform'), 'exclude': lambda f: f is None }}) - r"""`platformKeys` name used when creating the company. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - - diff --git a/platform/src/codatplatform/models/shared/companygroupassignment.py b/platform/src/codatplatform/models/shared/companygroupassignment.py deleted file mode 100644 index 8e6f3eef2..000000000 --- a/platform/src/codatplatform/models/shared/companygroupassignment.py +++ /dev/null @@ -1,15 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CompanyGroupAssignment: - group_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('groupId'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/companyrequestbody.py b/platform/src/codatplatform/models/shared/companyrequestbody.py deleted file mode 100644 index 05f93aad1..000000000 --- a/platform/src/codatplatform/models/shared/companyrequestbody.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .groupref import GroupRef -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CompanyRequestBody: - name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) - r"""Name of company being connected.""" - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" - groups: Optional[List[GroupRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('groups'), 'exclude': lambda f: f is None }}) - r"""Reference to the groups that the company is assigned to.""" - - diff --git a/platform/src/codatplatform/models/shared/connection.py b/platform/src/codatplatform/models/shared/connection.py deleted file mode 100644 index 734b80dce..000000000 --- a/platform/src/codatplatform/models/shared/connection.py +++ /dev/null @@ -1,89 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .dataconnectionerror import DataConnectionError -from .dataconnectionstatus import DataConnectionStatus -from .sourcetype import SourceType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Any, Dict, List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Connection: - r"""A connection represents a [company's](https://docs.codat.io/platform-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. - - A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: - - - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. - - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. - - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. - Any combination of accounting, banking, and commerce data connections is allowed. - - Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). - """ - created: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created') }}) - 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: - - ``` - 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. - """ - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Unique identifier for a company's data connection.""" - integration_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('integrationId') }}) - r"""A Codat ID representing the integration.""" - integration_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('integrationKey') }}) - r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" - link_url: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('linkUrl') }}) - r"""The link URL your customers can use to authorize access to their business application.""" - platform_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platformName') }}) - r"""Name of integration connected to company.""" - source_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceId') }}) - r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" - source_type: SourceType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceType') }}) - r"""The type of platform of the connection.""" - status: DataConnectionStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current authorization status of the data connection.""" - additional_properties: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('additionalProperties'), 'exclude': lambda f: f is None }}) - connection_info: Optional[Dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('connectionInfo'), 'exclude': lambda f: f is None }}) - data_connection_errors: Optional[List[DataConnectionError]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionErrors'), 'exclude': lambda f: f is None }}) - last_sync: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lastSync'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - - diff --git a/platform/src/codatplatform/models/shared/connectionmanagementaccesstoken.py b/platform/src/codatplatform/models/shared/connectionmanagementaccesstoken.py deleted file mode 100644 index b8f9975ed..000000000 --- a/platform/src/codatplatform/models/shared/connectionmanagementaccesstoken.py +++ /dev/null @@ -1,16 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ConnectionManagementAccessToken: - access_token: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accessToken'), 'exclude': lambda f: f is None }}) - r"""Access token that allows SMBs to manage connections that have access to their data.""" - - diff --git a/platform/src/codatplatform/models/shared/connectionmanagementallowedorigins.py b/platform/src/codatplatform/models/shared/connectionmanagementallowedorigins.py deleted file mode 100644 index 0f78e667a..000000000 --- a/platform/src/codatplatform/models/shared/connectionmanagementallowedorigins.py +++ /dev/null @@ -1,16 +0,0 @@ -"""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 ConnectionManagementAllowedOrigins: - allowed_origins: Optional[List[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('allowedOrigins'), 'exclude': lambda f: f is None }}) - r"""An array of allowed origins (i.e. your domains) to permit cross-origin resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).n resource sharing ([CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)).""" - - diff --git a/platform/src/codatplatform/models/shared/connections.py b/platform/src/codatplatform/models/shared/connections.py deleted file mode 100644 index 0e298d79e..000000000 --- a/platform/src/codatplatform/models/shared/connections.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .connection import Connection -from .links import Links -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Connections: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Connection]] = 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/connectionstatuschangedwebhook.py b/platform/src/codatplatform/models/shared/connectionstatuschangedwebhook.py deleted file mode 100644 index 644ebaf45..000000000 --- a/platform/src/codatplatform/models/shared/connectionstatuschangedwebhook.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .connectionstatuschangedwebhookdata import ConnectionStatusChangedWebhookData -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ConnectionStatusChangedWebhook: - r"""Webhook request body for a company's data connection status changed.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[ConnectionStatusChangedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/connectionstatuschangedwebhookdata.py b/platform/src/codatplatform/models/shared/connectionstatuschangedwebhookdata.py deleted file mode 100644 index 713e6a79a..000000000 --- a/platform/src/codatplatform/models/shared/connectionstatuschangedwebhookdata.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .dataconnectionstatus import DataConnectionStatus -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ConnectionStatusChangedWebhookData: - 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.""" - new_status: Optional[DataConnectionStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('newStatus'), 'exclude': lambda f: f is None }}) - r"""The current authorization status of the data connection.""" - old_status: Optional[DataConnectionStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('oldStatus'), 'exclude': lambda f: f is None }}) - r"""The current authorization status of the data connection.""" - platform_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platformKey'), 'exclude': lambda f: f is None }}) - 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.""" - - diff --git a/platform/src/codatplatform/models/shared/createapikey.py b/platform/src/codatplatform/models/shared/createapikey.py deleted file mode 100644 index a0d2a14d1..000000000 --- a/platform/src/codatplatform/models/shared/createapikey.py +++ /dev/null @@ -1,18 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateAPIKey: - r"""Details about the newly created API key.""" - UNSET='__SPEAKEASY_UNSET__' - name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is CreateAPIKey.UNSET }}) - r"""A meaningful name assigned to the API key.""" - - diff --git a/platform/src/codatplatform/models/shared/createrule.py b/platform/src/codatplatform/models/shared/createrule.py deleted file mode 100644 index e96e3e61e..000000000 --- a/platform/src/codatplatform/models/shared/createrule.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .webhooknotifier import WebhookNotifier -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateRule: - 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.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - - diff --git a/platform/src/codatplatform/models/shared/customdatatypeconfiguration.py b/platform/src/codatplatform/models/shared/customdatatypeconfiguration.py deleted file mode 100644 index 678d9f1dd..000000000 --- a/platform/src/codatplatform/models/shared/customdatatypeconfiguration.py +++ /dev/null @@ -1,24 +0,0 @@ -"""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 Dict, List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CustomDataTypeConfiguration: - r"""Client's configuration details for a specific custom data type and platform pair.""" - UNSET='__SPEAKEASY_UNSET__' - data_source: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataSource'), 'exclude': lambda f: f is None }}) - r"""Underlying endpoint of the source platform that will serve as a data source for the custom data type. This value is not validated by Codat.""" - key_by: Optional[List[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('keyBy'), 'exclude': lambda f: f is None }}) - r"""An array of properties from the source system that can be used to uniquely identify the records returned for the custom data type. This value is not validated by Codat.""" - required_data: Optional[Dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requiredData'), 'exclude': lambda f: f is None }}) - r"""Properties required to be fetched from the underlying platform for the custom data type that is being configured. This value is not validated by Codat.""" - source_modified_date: Optional[List[str]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is CustomDataTypeConfiguration.UNSET }}) - r"""Property in the source platform nominated by the client that defines the date when a record was last modified there. This value is not validated by Codat.""" - - diff --git a/platform/src/codatplatform/models/shared/customdatatyperecord.py b/platform/src/codatplatform/models/shared/customdatatyperecord.py deleted file mode 100644 index d61212bbb..000000000 --- a/platform/src/codatplatform/models/shared/customdatatyperecord.py +++ /dev/null @@ -1,32 +0,0 @@ -"""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 Dict, Optional - - -@dataclasses.dataclass -class Content: - pass - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ModifiedDate: - modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CustomDataTypeRecord: - content: Optional[Dict[str, Content]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('content'), 'exclude': lambda f: f is None }}) - r"""Values from the source system for the properties defined in the custom data type configuration.""" - 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 of the record.""" - modified_date: Optional[ModifiedDate] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/customdatatyperecords.py b/platform/src/codatplatform/models/shared/customdatatyperecords.py deleted file mode 100644 index c596d14e4..000000000 --- a/platform/src/codatplatform/models/shared/customdatatyperecords.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .customdatatyperecord import CustomDataTypeRecord -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CustomDataTypeRecords: - r"""Resulting records pulled from the source platform for a specific custom data type.""" - page_number: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber'), 'exclude': lambda f: f is None }}) - r"""Current page number.""" - page_size: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize'), 'exclude': lambda f: f is None }}) - r"""Number of items to return in results array.""" - results: Optional[List[CustomDataTypeRecord]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - total_results: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults'), 'exclude': lambda f: f is None }}) - r"""Total number of items.""" - - diff --git a/platform/src/codatplatform/models/shared/dataconnectionerror.py b/platform/src/codatplatform/models/shared/dataconnectionerror.py deleted file mode 100644 index f8049156c..000000000 --- a/platform/src/codatplatform/models/shared/dataconnectionerror.py +++ /dev/null @@ -1,41 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DataConnectionError: - error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) - r"""A brief message about the error.""" - errored_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('erroredOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - status_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) - r"""The HTTP status code returned by the error.""" - status_text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusText'), 'exclude': lambda f: f is None }}) - r"""A non-numeric status code/text.""" - - diff --git a/platform/src/codatplatform/models/shared/dataconnectionstatus.py b/platform/src/codatplatform/models/shared/dataconnectionstatus.py deleted file mode 100644 index 377013d42..000000000 --- a/platform/src/codatplatform/models/shared/dataconnectionstatus.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class DataConnectionStatus(str, Enum): - r"""The current authorization status of the data connection.""" - PENDING_AUTH = 'PendingAuth' - LINKED = 'Linked' - UNLINKED = 'Unlinked' - DEAUTHORIZED = 'Deauthorized' diff --git a/platform/src/codatplatform/models/shared/datasetdatachangedwebhook.py b/platform/src/codatplatform/models/shared/datasetdatachangedwebhook.py deleted file mode 100644 index 36eccced2..000000000 --- a/platform/src/codatplatform/models/shared/datasetdatachangedwebhook.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@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""" - 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.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DatasetDataChangedWebhook: - r"""Webhook request body to notify that a data synchronization has completed.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[DatasetDataChangedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py b/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py deleted file mode 100644 index 6af2da43e..000000000 --- a/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhook.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datasetstatuschangederrorwebhookdata import DatasetStatusChangedErrorWebhookData -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DatasetStatusChangedErrorWebhook: - r"""Webhook request body to notify that a data synchronization has completed.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[DatasetStatusChangedErrorWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py b/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py deleted file mode 100644 index bbf9f0327..000000000 --- a/platform/src/codatplatform/models/shared/datasetstatuschangederrorwebhookdata.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@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""" - 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 }}) - r"""The current status of the dataset's sync.""" - - diff --git a/platform/src/codatplatform/models/shared/datastatus.py b/platform/src/codatplatform/models/shared/datastatus.py deleted file mode 100644 index ead995d44..000000000 --- a/platform/src/codatplatform/models/shared/datastatus.py +++ /dev/null @@ -1,92 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .status import Status -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import Optional - -class DataTypes(str, Enum): - r"""Available data types""" - ACCOUNT_TRANSACTIONS = 'accountTransactions' - BALANCE_SHEET = 'balanceSheet' - BANK_ACCOUNTS = 'bankAccounts' - BANK_TRANSACTIONS = 'bankTransactions' - BILL_CREDIT_NOTES = 'billCreditNotes' - BILL_PAYMENTS = 'billPayments' - BILLS = 'bills' - CASH_FLOW_STATEMENT = 'cashFlowStatement' - CHART_OF_ACCOUNTS = 'chartOfAccounts' - COMPANY = 'company' - CREDIT_NOTES = 'creditNotes' - CUSTOMERS = 'customers' - DIRECT_COSTS = 'directCosts' - DIRECT_INCOMES = 'directIncomes' - INVOICES = 'invoices' - ITEM_RECEIPTS = 'itemReceipts' - ITEMS = 'items' - JOURNAL_ENTRIES = 'journalEntries' - JOURNALS = 'journals' - PAYMENT_METHODS = 'paymentMethods' - PAYMENTS = 'payments' - PROFIT_AND_LOSS = 'profitAndLoss' - PURCHASE_ORDERS = 'purchaseOrders' - SALES_ORDERS = 'salesOrders' - SUPPLIERS = 'suppliers' - TAX_RATES = 'taxRates' - TRACKING_CATEGORIES = 'trackingCategories' - TRANSFERS = 'transfers' - BANKING_ACCOUNT_BALANCES = 'banking-accountBalances' - BANKING_ACCOUNTS = 'banking-accounts' - BANKING_TRANSACTION_CATEGORIES = 'banking-transactionCategories' - BANKING_TRANSACTIONS = 'banking-transactions' - COMMERCE_COMPANY_INFO = 'commerce-companyInfo' - COMMERCE_CUSTOMERS = 'commerce-customers' - COMMERCE_DISPUTES = 'commerce-disputes' - COMMERCE_LOCATIONS = 'commerce-locations' - COMMERCE_ORDERS = 'commerce-orders' - COMMERCE_PAYMENT_METHODS = 'commerce-paymentMethods' - COMMERCE_PAYMENTS = 'commerce-payments' - COMMERCE_PRODUCT_CATEGORIES = 'commerce-productCategories' - COMMERCE_PRODUCTS = 'commerce-products' - COMMERCE_TAX_COMPONENTS = 'commerce-taxComponents' - COMMERCE_TRANSACTIONS = 'commerce-transactions' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DataStatus: - r"""Describes the state of data in the Codat cache for a company and data type""" - current_status: Status = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentStatus') }}) - r"""The current status of the dataset.""" - data_type: DataTypes = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType') }}) - 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: - - ``` - 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. - """ - latest_successful_sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latestSuccessfulSyncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the most recent successful sync of data type.""" - latest_sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latestSyncId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for most recent sync of data type.""" - - diff --git a/platform/src/codatplatform/models/shared/datastatuses.py b/platform/src/codatplatform/models/shared/datastatuses.py deleted file mode 100644 index 35cc3a3cf..000000000 --- a/platform/src/codatplatform/models/shared/datastatuses.py +++ /dev/null @@ -1,101 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datastatus import DataStatus -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DataStatuses: - account_transactions: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountTransactions'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - balance_sheet: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('balanceSheet'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - bank_accounts: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bankAccounts'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - bank_transactions: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bankTransactions'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - banking_account_balances: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('banking-accountBalances'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - banking_accounts: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('banking-accounts'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - banking_transaction_categories: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('banking-transactionCategories'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - banking_transactions: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('banking-transactions'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - bill_credit_notes: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('billCreditNotes'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - bill_payments: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('billPayments'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - bills: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bills'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - cash_flow_statement: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cashFlowStatement'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - chart_of_accounts: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('chartOfAccounts'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_company_info: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-companyInfo'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_customers: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-customers'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_disputes: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-disputes'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_locations: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-locations'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_orders: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-orders'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_payment_methods: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-paymentMethods'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_payments: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-payments'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_product_categories: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-productCategories'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_products: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-products'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_tax_components: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-taxComponents'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - commerce_transactions: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('commerce-transactions'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - company: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('company'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - credit_notes: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('creditNotes'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - customers: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customers'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - direct_costs: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('directCosts'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - direct_incomes: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('directIncomes'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - invoices: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('invoices'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - item_receipts: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemReceipts'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - items: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('items'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - journal_entries: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('journalEntries'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - journals: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('journals'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - payment_methods: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('paymentMethods'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - payments: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payments'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - profit_and_loss: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('profitAndLoss'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - purchase_orders: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('purchaseOrders'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - sales_orders: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('salesOrders'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - suppliers: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('suppliers'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - tax_rates: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxRates'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - tracking_categories: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('trackingCategories'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - transfers: Optional[DataStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('transfers'), 'exclude': lambda f: f is None }}) - r"""Describes the state of data in the Codat cache for a company and data type""" - - diff --git a/platform/src/codatplatform/models/shared/datasynccompletedwebhook.py b/platform/src/codatplatform/models/shared/datasynccompletedwebhook.py deleted file mode 100644 index 0d927012a..000000000 --- a/platform/src/codatplatform/models/shared/datasynccompletedwebhook.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datasynccompletedwebhookdata import DataSyncCompletedWebhookData -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DataSyncCompletedWebhook: - r"""Webhook request body to notify the completion of a data sync.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[DataSyncCompletedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/datasynccompletedwebhookdata.py b/platform/src/codatplatform/models/shared/datasynccompletedwebhookdata.py deleted file mode 100644 index f1abc012b..000000000 --- a/platform/src/codatplatform/models/shared/datasynccompletedwebhookdata.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@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""" - 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 deleted file mode 100644 index 76eee21a3..000000000 --- a/platform/src/codatplatform/models/shared/datatype.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class DataType(str, Enum): - r"""Available data types""" - ACCOUNT_TRANSACTIONS = 'accountTransactions' - BALANCE_SHEET = 'balanceSheet' - BANK_ACCOUNTS = 'bankAccounts' - BANK_TRANSACTIONS = 'bankTransactions' - BILL_CREDIT_NOTES = 'billCreditNotes' - BILL_PAYMENTS = 'billPayments' - BILLS = 'bills' - CASH_FLOW_STATEMENT = 'cashFlowStatement' - CHART_OF_ACCOUNTS = 'chartOfAccounts' - COMPANY = 'company' - CREDIT_NOTES = 'creditNotes' - CUSTOMERS = 'customers' - DIRECT_COSTS = 'directCosts' - DIRECT_INCOMES = 'directIncomes' - INVOICES = 'invoices' - ITEM_RECEIPTS = 'itemReceipts' - ITEMS = 'items' - JOURNAL_ENTRIES = 'journalEntries' - JOURNALS = 'journals' - PAYMENT_METHODS = 'paymentMethods' - PAYMENTS = 'payments' - PROFIT_AND_LOSS = 'profitAndLoss' - PURCHASE_ORDERS = 'purchaseOrders' - SALES_ORDERS = 'salesOrders' - SUPPLIERS = 'suppliers' - TAX_RATES = 'taxRates' - TRACKING_CATEGORIES = 'trackingCategories' - TRANSFERS = 'transfers' - BANKING_ACCOUNT_BALANCES = 'banking-accountBalances' - BANKING_ACCOUNTS = 'banking-accounts' - BANKING_TRANSACTION_CATEGORIES = 'banking-transactionCategories' - BANKING_TRANSACTIONS = 'banking-transactions' - COMMERCE_COMPANY_INFO = 'commerce-companyInfo' - COMMERCE_CUSTOMERS = 'commerce-customers' - COMMERCE_DISPUTES = 'commerce-disputes' - COMMERCE_LOCATIONS = 'commerce-locations' - COMMERCE_ORDERS = 'commerce-orders' - COMMERCE_PAYMENT_METHODS = 'commerce-paymentMethods' - COMMERCE_PAYMENTS = 'commerce-payments' - COMMERCE_PRODUCT_CATEGORIES = 'commerce-productCategories' - COMMERCE_PRODUCTS = 'commerce-products' - COMMERCE_TAX_COMPONENTS = 'commerce-taxComponents' - COMMERCE_TRANSACTIONS = 'commerce-transactions' diff --git a/platform/src/codatplatform/models/shared/datatypefeature.py b/platform/src/codatplatform/models/shared/datatypefeature.py deleted file mode 100644 index 9fc937293..000000000 --- a/platform/src/codatplatform/models/shared/datatypefeature.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from .supportedfeature import SupportedFeature -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -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""" - - diff --git a/platform/src/codatplatform/models/shared/errorvalidation.py b/platform/src/codatplatform/models/shared/errorvalidation.py deleted file mode 100644 index 124103058..000000000 --- a/platform/src/codatplatform/models/shared/errorvalidation.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .errorvalidationitem import ErrorValidationItem -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ErrorValidation: - r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" - UNSET='__SPEAKEASY_UNSET__' - errors: Optional[List[ErrorValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errors'), 'exclude': lambda f: f is ErrorValidation.UNSET }}) - warnings: Optional[List[ErrorValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is ErrorValidation.UNSET }}) - - diff --git a/platform/src/codatplatform/models/shared/errorvalidationitem.py b/platform/src/codatplatform/models/shared/errorvalidationitem.py deleted file mode 100644 index 424f949ed..000000000 --- a/platform/src/codatplatform/models/shared/errorvalidationitem.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ErrorValidationItem: - UNSET='__SPEAKEASY_UNSET__' - item_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemId'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""Unique identifier for a validation item.""" - message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""A message outlining validation item's issue.""" - validator_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validatorName'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""Name of validator.""" - - diff --git a/platform/src/codatplatform/models/shared/featurestate.py b/platform/src/codatplatform/models/shared/featurestate.py deleted file mode 100644 index 886707d9d..000000000 --- a/platform/src/codatplatform/models/shared/featurestate.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class FeatureState(str, Enum): - r"""The current release state of the feature.""" - RELEASE = 'Release' - ALPHA = 'Alpha' - BETA = 'Beta' - DEPRECATED = 'Deprecated' - NOT_SUPPORTED = 'NotSupported' - NOT_IMPLEMENTED = 'NotImplemented' diff --git a/platform/src/codatplatform/models/shared/featuretype.py b/platform/src/codatplatform/models/shared/featuretype.py deleted file mode 100644 index 81af9c452..000000000 --- a/platform/src/codatplatform/models/shared/featuretype.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class FeatureType(str, Enum): - r"""The type of feature.""" - GET = 'Get' - POST = 'Post' - CATEGORIZATION = 'Categorization' - DELETE = 'Delete' - PUT = 'Put' - GET_AS_PDF = 'GetAsPdf' - DOWNLOAD_ATTACHMENT = 'DownloadAttachment' - GET_ATTACHMENT = 'GetAttachment' - GET_ATTACHMENTS = 'GetAttachments' - UPLOAD_ATTACHMENT = 'UploadAttachment' diff --git a/platform/src/codatplatform/models/shared/group.py b/platform/src/codatplatform/models/shared/group.py deleted file mode 100644 index a2e22cc53..000000000 --- a/platform/src/codatplatform/models/shared/group.py +++ /dev/null @@ -1,19 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Group: - r"""A container you can use to organize companies together according to a shared characteristic of your choice.""" - 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 group.""" - name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) - r"""Descriptive name of the group.""" - - diff --git a/platform/src/codatplatform/models/shared/groupprototype.py b/platform/src/codatplatform/models/shared/groupprototype.py deleted file mode 100644 index ca47aa917..000000000 --- a/platform/src/codatplatform/models/shared/groupprototype.py +++ /dev/null @@ -1,17 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class GroupPrototype: - r"""The group template used to create a group.""" - name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) - r"""Descriptive name of the group.""" - - diff --git a/platform/src/codatplatform/models/shared/groupref.py b/platform/src/codatplatform/models/shared/groupref.py deleted file mode 100644 index 752731b12..000000000 --- a/platform/src/codatplatform/models/shared/groupref.py +++ /dev/null @@ -1,16 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class GroupRef: - 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 group.""" - - diff --git a/platform/src/codatplatform/models/shared/groups.py b/platform/src/codatplatform/models/shared/groups.py deleted file mode 100644 index 329892e7d..000000000 --- a/platform/src/codatplatform/models/shared/groups.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .group import Group -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Groups: - results: Optional[List[Group]] = 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/halref.py b/platform/src/codatplatform/models/shared/halref.py deleted file mode 100644 index dc041e03d..000000000 --- a/platform/src/codatplatform/models/shared/halref.py +++ /dev/null @@ -1,16 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class HalRef: - href: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('href'), 'exclude': lambda f: f is None }}) - r"""Uri hypertext reference.""" - - diff --git a/platform/src/codatplatform/models/shared/imagereference.py b/platform/src/codatplatform/models/shared/imagereference.py deleted file mode 100644 index 75680d3ff..000000000 --- a/platform/src/codatplatform/models/shared/imagereference.py +++ /dev/null @@ -1,19 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ImageReference: - r"""Image reference.""" - alt: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('alt'), 'exclude': lambda f: f is None }}) - r"""Alternative text when image is not available.""" - src: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('src'), 'exclude': lambda f: f is None }}) - r"""Source URL for image.""" - - diff --git a/platform/src/codatplatform/models/shared/integration.py b/platform/src/codatplatform/models/shared/integration.py deleted file mode 100644 index 29fe63db0..000000000 --- a/platform/src/codatplatform/models/shared/integration.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatypefeature import DataTypeFeature -from .sourcetype import SourceType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Integration: - r"""An integration that Codat supports""" - enabled: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('enabled') }}) - r"""Whether this integration is enabled for your customers to use.""" - key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('key') }}) - 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.""" - logo_url: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('logoUrl') }}) - r"""Static url for integration's logo.""" - name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) - r"""Name of integration.""" - data_provided_by: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataProvidedBy'), 'exclude': lambda f: f is None }}) - r"""The name of the data provider.""" - datatype_features: Optional[List[DataTypeFeature]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datatypeFeatures'), 'exclude': lambda f: f is None }}) - integration_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('integrationId'), 'exclude': lambda f: f is None }}) - r"""A Codat ID representing the integration.""" - is_beta: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isBeta'), 'exclude': lambda f: f is None }}) - r"""`True` if the integration is currently in beta release.""" - is_offline_connector: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isOfflineConnector'), 'exclude': lambda f: f is None }}) - r"""`True` if the integration is to an application installed and run locally on an SMBs computer.""" - source_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceId'), 'exclude': lambda f: f is None }}) - r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" - source_type: Optional[SourceType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceType'), 'exclude': lambda f: f is None }}) - r"""The type of platform of the connection.""" - - diff --git a/platform/src/codatplatform/models/shared/integrations.py b/platform/src/codatplatform/models/shared/integrations.py deleted file mode 100644 index 1eeb95a89..000000000 --- a/platform/src/codatplatform/models/shared/integrations.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .integration import Integration -from .links import Links -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Integrations: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Integration]] = 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/links.py b/platform/src/codatplatform/models/shared/links.py deleted file mode 100644 index 66e6dd781..000000000 --- a/platform/src/codatplatform/models/shared/links.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .halref import HalRef -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Links: - current: HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('current') }}) - self_: HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('self') }}) - next: Optional[HalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('next'), 'exclude': lambda f: f is None }}) - previous: Optional[HalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('previous'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhook.py b/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhook.py deleted file mode 100644 index d1f0415ce..000000000 --- a/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhook.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .newcompanysynchronizedwebhookdata import NewCompanySynchronizedWebhookData -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class NewCompanySynchronizedWebhook: - r"""Webhook request body to notify that a new company has successfully synchronized at least one dataType for the first time.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[NewCompanySynchronizedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhookdata.py b/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhookdata.py deleted file mode 100644 index 04bb7027f..000000000 --- a/platform/src/codatplatform/models/shared/newcompanysynchronizedwebhookdata.py +++ /dev/null @@ -1,9 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses - - -@dataclasses.dataclass -class NewCompanySynchronizedWebhookData: - pass diff --git a/platform/src/codatplatform/models/shared/profile.py b/platform/src/codatplatform/models/shared/profile.py deleted file mode 100644 index 42b5e318c..000000000 --- a/platform/src/codatplatform/models/shared/profile.py +++ /dev/null @@ -1,37 +0,0 @@ -"""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 Profile: - r"""Describes your Codat client instance""" - name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) - r"""The name given to the instance.""" - redirect_url: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('redirectUrl') }}) - r"""The redirect URL pasted on to the SMB once Codat's [Hosted Link](https://docs.codat.io/auth-flow/authorize-hosted-link) has been completed by the SMB.""" - alert_auth_header: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('alertAuthHeader'), 'exclude': lambda f: f is None }}) - r"""Alert or webhooks authorization header.""" - api_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('apiKey'), 'exclude': lambda f: f is None }}) - r"""The API key for this Codat instance. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - confirm_company_name: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('confirmCompanyName'), 'exclude': lambda f: f is None }}) - r"""`True` if the company name has been confirmed. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - icon_url: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('iconUrl'), 'exclude': lambda f: f is None }}) - r"""Static url to your organization's icon.""" - logo_url: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('logoUrl'), 'exclude': lambda f: f is None }}) - r"""Static url to your organization's logo.""" - white_list_urls: Optional[List[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('whiteListUrls'), 'exclude': lambda f: f is None }}) - r"""A list of urls that are allowed to communicate with Codat. If empty any url is allowed to communicate with Codat.""" - - diff --git a/platform/src/codatplatform/models/shared/pulloperation.py b/platform/src/codatplatform/models/shared/pulloperation.py deleted file mode 100644 index 2425816b3..000000000 --- a/platform/src/codatplatform/models/shared/pulloperation.py +++ /dev/null @@ -1,105 +0,0 @@ -"""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 enum import Enum -from typing import Optional - -class DatasetStatus(str, Enum): - r"""The current status of the dataset.""" - INITIAL = 'Initial' - QUEUED = 'Queued' - FETCHING = 'Fetching' - MAP_QUEUED = 'MapQueued' - MAPPING = 'Mapping' - COMPLETE = 'Complete' - FETCH_ERROR = 'FetchError' - MAP_ERROR = 'MapError' - INTERNAL_ERROR = 'InternalError' - PROCESSING_QUEUED = 'ProcessingQueued' - PROCESSING = 'Processing' - PROCESSING_ERROR = 'ProcessingError' - VALIDATION_QUEUED = 'ValidationQueued' - VALIDATING = 'Validating' - VALIDATION_ERROR = 'ValidationError' - AUTH_ERROR = 'AuthError' - CANCELLED = 'Cancelled' - NOT_SUPPORTED = 'NotSupported' - RATE_LIMIT_ERROR = 'RateLimitError' - PERMISSIONS_ERROR = 'PermissionsError' - PREREQUISITE_NOT_MET = 'PrerequisiteNotMet' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PullOperation: - r"""Information about a queued, in progress or completed pull operation. - *Formally called `dataset`* - """ - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier of the company associated to this pull operation.""" - connection_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('connectionId') }}) - r"""Unique identifier of the connection associated to this pull operation.""" - data_type: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType') }}) - r"""The data type you are requesting in a pull operation.""" - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Unique identifier of the pull operation.""" - is_completed: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isCompleted') }}) - r"""`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.""" - is_errored: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isErrored') }}) - r"""`True` if the pull operation entered an error state.""" - progress: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('progress') }}) - r"""An integer signifying the progress of the pull operation.""" - requested: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requested') }}) - 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: - - ``` - 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. - """ - status: DatasetStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the dataset.""" - completed: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completed'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - error_message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is PullOperation.UNSET }}) - r"""A message about a transient or persistent error.""" - status_description: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusDescription'), 'exclude': lambda f: f is PullOperation.UNSET }}) - r"""Additional information about the dataset status.""" - - diff --git a/platform/src/codatplatform/models/shared/pulloperations.py b/platform/src/codatplatform/models/shared/pulloperations.py deleted file mode 100644 index bf0e73ee7..000000000 --- a/platform/src/codatplatform/models/shared/pulloperations.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .links import Links -from .pulloperation import PullOperation -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PullOperations: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[PullOperation]] = 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/pushchangetype.py b/platform/src/codatplatform/models/shared/pushchangetype.py deleted file mode 100644 index 55cd1990f..000000000 --- a/platform/src/codatplatform/models/shared/pushchangetype.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class PushChangeType(str, Enum): - r"""Type of change being applied to record in third party platform.""" - UNKNOWN = 'Unknown' - CREATED = 'Created' - MODIFIED = 'Modified' - DELETED = 'Deleted' - ATTACHMENT_UPLOADED = 'AttachmentUploaded' diff --git a/platform/src/codatplatform/models/shared/pushfieldvalidation.py b/platform/src/codatplatform/models/shared/pushfieldvalidation.py deleted file mode 100644 index c6b672d7c..000000000 --- a/platform/src/codatplatform/models/shared/pushfieldvalidation.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushFieldValidation: - UNSET='__SPEAKEASY_UNSET__' - details: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('details') }}) - r"""Details on the validation issue.""" - field: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('field'), 'exclude': lambda f: f is None }}) - r"""Field name that resulted in the validation issue.""" - ref: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ref'), 'exclude': lambda f: f is PushFieldValidation.UNSET }}) - r"""Unique reference identifier for the validation issue.""" - - diff --git a/platform/src/codatplatform/models/shared/pushoperation.py b/platform/src/codatplatform/models/shared/pushoperation.py deleted file mode 100644 index 6b431523a..000000000 --- a/platform/src/codatplatform/models/shared/pushoperation.py +++ /dev/null @@ -1,86 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from .pushoperationchange import PushOperationChange -from .pushoperationstatus import PushOperationStatus -from .validation import Validation -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperation: - UNSET='__SPEAKEASY_UNSET__' - company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) - r"""Unique identifier for your SMB in Codat.""" - data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey') }}) - 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.""" - requested_on_utc: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requestedOnUtc') }}) - 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: - - ``` - 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. - """ - status: PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current status of the push operation.""" - status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) - r"""Push status code.""" - changes: Optional[List[PushOperationChange]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is PushOperation.UNSET }}) - r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" - completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - 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""" - 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 }}) - r"""Number of minutes the push operation must complete within before it times out.""" - timeout_in_seconds: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is PushOperation.UNSET }}) - r"""Number of seconds the push operation must complete within before it times out. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - validation: Optional[Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - - diff --git a/platform/src/codatplatform/models/shared/pushoperationchange.py b/platform/src/codatplatform/models/shared/pushoperationchange.py deleted file mode 100644 index d45b4d37f..000000000 --- a/platform/src/codatplatform/models/shared/pushoperationchange.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushchangetype import PushChangeType -from .pushoperationref import PushOperationRef -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperationChange: - UNSET='__SPEAKEASY_UNSET__' - attachment_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('attachmentId'), 'exclude': lambda f: f is PushOperationChange.UNSET }}) - r"""Unique identifier for the attachment created otherwise null.""" - record_ref: Optional[PushOperationRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('recordRef'), 'exclude': lambda f: f is None }}) - type: Optional[PushChangeType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Type of change being applied to record in third party platform.""" - - diff --git a/platform/src/codatplatform/models/shared/pushoperationref.py b/platform/src/codatplatform/models/shared/pushoperationref.py deleted file mode 100644 index 029dffd71..000000000 --- a/platform/src/codatplatform/models/shared/pushoperationref.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@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""" - 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/pushoperations.py b/platform/src/codatplatform/models/shared/pushoperations.py deleted file mode 100644 index 671a7c51e..000000000 --- a/platform/src/codatplatform/models/shared/pushoperations.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .links import Links -from .pushoperation import PushOperation -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperations: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[PushOperation]] = 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/pushoperationstatus.py b/platform/src/codatplatform/models/shared/pushoperationstatus.py deleted file mode 100644 index 5b3fabf24..000000000 --- a/platform/src/codatplatform/models/shared/pushoperationstatus.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class PushOperationStatus(str, Enum): - r"""The current status of the push operation.""" - PENDING = 'Pending' - FAILED = 'Failed' - SUCCESS = 'Success' - TIMED_OUT = 'TimedOut' diff --git a/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py b/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py deleted file mode 100644 index 8dfd09f6d..000000000 --- a/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhook.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushoperationstatuschangedwebhookdata import PushOperationStatusChangedWebhookData -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperationStatusChangedWebhook: - r"""Webhook request body for a push operation status change.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[PushOperationStatusChangedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py b/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py deleted file mode 100644 index 83623e5e4..000000000 --- a/platform/src/codatplatform/models/shared/pushoperationstatuschangedwebhookdata.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from .pushoperationstatus import PushOperationStatus -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@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""" - 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 }}) - r"""The current status of the push operation.""" - - diff --git a/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhook.py b/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhook.py deleted file mode 100644 index 91ffbe7cf..000000000 --- a/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhook.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushoperationtimedoutwebhookdata import PushOperationTimedOutWebhookData -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOperationTimedOutWebhook: - r"""Webhook request body notifying that a push push operation has timed out.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('CompanyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - data: Optional[PushOperationTimedOutWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - 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.""" - 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. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py b/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py deleted file mode 100644 index f30a30691..000000000 --- a/platform/src/codatplatform/models/shared/pushoperationtimedoutwebhookdata.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@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""" - 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 }}) - 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.""" - - diff --git a/platform/src/codatplatform/models/shared/pushoption.py b/platform/src/codatplatform/models/shared/pushoption.py deleted file mode 100644 index 9158e6b6c..000000000 --- a/platform/src/codatplatform/models/shared/pushoption.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushoptionchoice import PushOptionChoice -from .pushoptionproperty import PushOptionProperty -from .pushoptiontype import PushOptionType -from .pushvalidationinfo import PushValidationInfo -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Dict, List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOption: - UNSET='__SPEAKEASY_UNSET__' - display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) - r"""The property's display name.""" - required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) - r"""The property is required if `True`.""" - type: PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The option type.""" - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""A description of the property.""" - options: Optional[List[PushOptionChoice]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('options'), 'exclude': lambda f: f is PushOption.UNSET }}) - properties: Optional[Dict[str, PushOptionProperty]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('properties'), 'exclude': lambda f: f is PushOption.UNSET }}) - validation: Optional[PushValidationInfo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/pushoptionchoice.py b/platform/src/codatplatform/models/shared/pushoptionchoice.py deleted file mode 100644 index e409b7bcb..000000000 --- a/platform/src/codatplatform/models/shared/pushoptionchoice.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushoptiontype import PushOptionType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOptionChoice: - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""A description of the property.""" - display_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName'), 'exclude': lambda f: f is None }}) - r"""The property's display name.""" - required: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required'), 'exclude': lambda f: f is None }}) - r"""The property is required if `True`.""" - type: Optional[PushOptionType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""The option type.""" - value: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('value'), 'exclude': lambda f: f is None }}) - r"""Allowed value for field.""" - - diff --git a/platform/src/codatplatform/models/shared/pushoptionproperty.py b/platform/src/codatplatform/models/shared/pushoptionproperty.py deleted file mode 100644 index edf8a35d2..000000000 --- a/platform/src/codatplatform/models/shared/pushoptionproperty.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushoptionchoice import PushOptionChoice -from .pushoptiontype import PushOptionType -from .pushvalidationinfo import PushValidationInfo -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Dict, List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushOptionProperty: - UNSET='__SPEAKEASY_UNSET__' - description: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description') }}) - r"""A description of the property.""" - display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) - r"""The property's display name.""" - required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) - r"""The property is required if `True`.""" - type: PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) - r"""The option type.""" - options: Optional[List[PushOptionChoice]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('options'), 'exclude': lambda f: f is PushOptionProperty.UNSET }}) - properties: Optional[Dict[str, PushOptionProperty]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('properties'), 'exclude': lambda f: f is PushOptionProperty.UNSET }}) - validation: Optional[PushValidationInfo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/pushoptiontype.py b/platform/src/codatplatform/models/shared/pushoptiontype.py deleted file mode 100644 index f069e2d84..000000000 --- a/platform/src/codatplatform/models/shared/pushoptiontype.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class PushOptionType(str, Enum): - r"""The option type.""" - ARRAY = 'Array' - OBJECT = 'Object' - STRING = 'String' - NUMBER = 'Number' - BOOLEAN = 'Boolean' - DATE_TIME = 'DateTime' - FILE = 'File' - MULTI_PART = 'MultiPart' diff --git a/platform/src/codatplatform/models/shared/pushvalidationinfo.py b/platform/src/codatplatform/models/shared/pushvalidationinfo.py deleted file mode 100644 index 2595e7278..000000000 --- a/platform/src/codatplatform/models/shared/pushvalidationinfo.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .pushfieldvalidation import PushFieldValidation -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class PushValidationInfo: - UNSET='__SPEAKEASY_UNSET__' - information: Optional[List[PushFieldValidation]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('information'), 'exclude': lambda f: f is PushValidationInfo.UNSET }}) - warnings: Optional[List[PushFieldValidation]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is PushValidationInfo.UNSET }}) - - diff --git a/platform/src/codatplatform/models/shared/schema_datatype.py b/platform/src/codatplatform/models/shared/schema_datatype.py deleted file mode 100644 index 38faff212..000000000 --- a/platform/src/codatplatform/models/shared/schema_datatype.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class SchemaDataType(str, Enum): - r"""Available data types""" - ACCOUNT_TRANSACTIONS = 'accountTransactions' - BALANCE_SHEET = 'balanceSheet' - BANK_ACCOUNTS = 'bankAccounts' - BANK_TRANSACTIONS = 'bankTransactions' - BILL_CREDIT_NOTES = 'billCreditNotes' - BILL_PAYMENTS = 'billPayments' - BILLS = 'bills' - CASH_FLOW_STATEMENT = 'cashFlowStatement' - CHART_OF_ACCOUNTS = 'chartOfAccounts' - COMPANY = 'company' - CREDIT_NOTES = 'creditNotes' - CUSTOMERS = 'customers' - DIRECT_COSTS = 'directCosts' - DIRECT_INCOMES = 'directIncomes' - INVOICES = 'invoices' - ITEM_RECEIPTS = 'itemReceipts' - ITEMS = 'items' - JOURNAL_ENTRIES = 'journalEntries' - JOURNALS = 'journals' - PAYMENT_METHODS = 'paymentMethods' - PAYMENTS = 'payments' - PROFIT_AND_LOSS = 'profitAndLoss' - PURCHASE_ORDERS = 'purchaseOrders' - SALES_ORDERS = 'salesOrders' - SUPPLIERS = 'suppliers' - TAX_RATES = 'taxRates' - TRACKING_CATEGORIES = 'trackingCategories' - TRANSFERS = 'transfers' - BANKING_ACCOUNT_BALANCES = 'banking-accountBalances' - BANKING_ACCOUNTS = 'banking-accounts' - BANKING_TRANSACTION_CATEGORIES = 'banking-transactionCategories' - BANKING_TRANSACTIONS = 'banking-transactions' - COMMERCE_COMPANY_INFO = 'commerce-companyInfo' - COMMERCE_CUSTOMERS = 'commerce-customers' - COMMERCE_DISPUTES = 'commerce-disputes' - COMMERCE_LOCATIONS = 'commerce-locations' - COMMERCE_ORDERS = 'commerce-orders' - COMMERCE_PAYMENT_METHODS = 'commerce-paymentMethods' - COMMERCE_PAYMENTS = 'commerce-payments' - COMMERCE_PRODUCT_CATEGORIES = 'commerce-productCategories' - COMMERCE_PRODUCTS = 'commerce-products' - COMMERCE_TAX_COMPONENTS = 'commerce-taxComponents' - COMMERCE_TRANSACTIONS = 'commerce-transactions' diff --git a/platform/src/codatplatform/models/shared/security.py b/platform/src/codatplatform/models/shared/security.py deleted file mode 100644 index 1d57f5faa..000000000 --- a/platform/src/codatplatform/models/shared/security.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses - - -@dataclasses.dataclass -class Security: - auth_header: str = dataclasses.field(metadata={'security': { 'scheme': True, 'type': 'apiKey', 'sub_type': 'header', 'field_name': 'Authorization' }}) - - diff --git a/platform/src/codatplatform/models/shared/sourcetype.py b/platform/src/codatplatform/models/shared/sourcetype.py deleted file mode 100644 index 40a90db43..000000000 --- a/platform/src/codatplatform/models/shared/sourcetype.py +++ /dev/null @@ -1,14 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class SourceType(str, Enum): - r"""The type of platform of the connection.""" - ACCOUNTING = 'Accounting' - BANKING = 'Banking' - BANK_FEED = 'BankFeed' - COMMERCE = 'Commerce' - EXPENSE = 'Expense' - OTHER = 'Other' - UNKNOWN = 'Unknown' diff --git a/platform/src/codatplatform/models/shared/status.py b/platform/src/codatplatform/models/shared/status.py deleted file mode 100644 index 2e91b3026..000000000 --- a/platform/src/codatplatform/models/shared/status.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class Status(str, Enum): - r"""The current status of the dataset.""" - INITIAL = 'Initial' - QUEUED = 'Queued' - FETCHING = 'Fetching' - MAP_QUEUED = 'MapQueued' - MAPPING = 'Mapping' - COMPLETE = 'Complete' - FETCH_ERROR = 'FetchError' - MAP_ERROR = 'MapError' - INTERNAL_ERROR = 'InternalError' - PROCESSING_QUEUED = 'ProcessingQueued' - PROCESSING = 'Processing' - PROCESSING_ERROR = 'ProcessingError' - VALIDATION_QUEUED = 'ValidationQueued' - VALIDATING = 'Validating' - VALIDATION_ERROR = 'ValidationError' - AUTH_ERROR = 'AuthError' - CANCELLED = 'Cancelled' - NOT_SUPPORTED = 'NotSupported' - RATE_LIMIT_ERROR = 'RateLimitError' - PERMISSIONS_ERROR = 'PermissionsError' - PREREQUISITE_NOT_MET = 'PrerequisiteNotMet' diff --git a/platform/src/codatplatform/models/shared/supplementaldataconfiguration.py b/platform/src/codatplatform/models/shared/supplementaldataconfiguration.py deleted file mode 100644 index c8217aeff..000000000 --- a/platform/src/codatplatform/models/shared/supplementaldataconfiguration.py +++ /dev/null @@ -1,29 +0,0 @@ -"""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 Dict, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SupplementalDataSourceConfiguration: - r"""The client's defined name for the object.""" - data_source: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataSource'), 'exclude': lambda f: f is None }}) - r"""The underlying endpoint of the source system which the configuration is targeting.""" - pull_data: Optional[Dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pullData'), 'exclude': lambda f: f is None }}) - r"""The additional properties that are required when pulling records.""" - push_data: Optional[Dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushData'), 'exclude': lambda f: f is None }}) - r"""The additional properties that are required to create and/or update records.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SupplementalDataConfiguration: - supplemental_data_config: Optional[Dict[str, SupplementalDataSourceConfiguration]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalDataConfig'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/supportedfeature.py b/platform/src/codatplatform/models/shared/supportedfeature.py deleted file mode 100644 index fb2eedad7..000000000 --- a/platform/src/codatplatform/models/shared/supportedfeature.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .featurestate import FeatureState -from .featuretype import FeatureType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SupportedFeature: - feature_state: FeatureState = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('featureState') }}) - r"""The current release state of the feature.""" - feature_type: FeatureType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('featureType') }}) - r"""The type of feature.""" - - diff --git a/platform/src/codatplatform/models/shared/syncsetting.py b/platform/src/codatplatform/models/shared/syncsetting.py deleted file mode 100644 index c33c94e89..000000000 --- a/platform/src/codatplatform/models/shared/syncsetting.py +++ /dev/null @@ -1,51 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .datatype import DataType -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -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""" - 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') }}) - r"""The sync in which data types are queued for a sync.""" - sync_schedule: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncSchedule') }}) - r"""Number of hours after which this data type should be refreshed.""" - is_locked: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isLocked'), 'exclude': lambda f: f is None }}) - r"""`True` if the [sync setting](https://docs.codat.io/knowledge-base/advanced-sync-settings) is locked.""" - months_to_sync: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('monthsToSync'), 'exclude': lambda f: f is None }}) - r"""Months of data to fetch, for report data types (`balanceSheet` & `profitAndLoss`) only.""" - sync_from_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncFromUtc'), 'exclude': lambda f: f is None }}) - r"""In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - - ``` - 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. - """ - sync_from_window: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('syncFromWindow'), 'exclude': lambda f: f is None }}) - r"""Number of months of data to be fetched. Set this *or* `syncFromUTC`.""" - - diff --git a/platform/src/codatplatform/models/shared/syncsettings.py b/platform/src/codatplatform/models/shared/syncsettings.py deleted file mode 100644 index 477c0847c..000000000 --- a/platform/src/codatplatform/models/shared/syncsettings.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .syncsetting import SyncSetting -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SyncSettings: - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('clientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - overrides_defaults: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('overridesDefaults'), 'exclude': lambda f: f is None }}) - r"""Set to `True` if you want to override the default [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings).""" - settings: Optional[List[SyncSetting]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('settings'), 'exclude': lambda f: f is None }}) - - diff --git a/platform/src/codatplatform/models/shared/updateconnectionstatus.py b/platform/src/codatplatform/models/shared/updateconnectionstatus.py deleted file mode 100644 index 222857687..000000000 --- a/platform/src/codatplatform/models/shared/updateconnectionstatus.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .dataconnectionstatus import DataConnectionStatus -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UpdateConnectionStatus: - status: Optional[DataConnectionStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) - r"""The current authorization status of the data connection.""" - - diff --git a/platform/src/codatplatform/models/shared/validation.py b/platform/src/codatplatform/models/shared/validation.py deleted file mode 100644 index 006455426..000000000 --- a/platform/src/codatplatform/models/shared/validation.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .validationitem import ValidationItem -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Validation: - r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" - UNSET='__SPEAKEASY_UNSET__' - errors: Optional[List[ValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errors'), 'exclude': lambda f: f is Validation.UNSET }}) - warnings: Optional[List[ValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is Validation.UNSET }}) - - diff --git a/platform/src/codatplatform/models/shared/validationitem.py b/platform/src/codatplatform/models/shared/validationitem.py deleted file mode 100644 index 4deb0c0af..000000000 --- a/platform/src/codatplatform/models/shared/validationitem.py +++ /dev/null @@ -1,21 +0,0 @@ -"""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 Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ValidationItem: - UNSET='__SPEAKEASY_UNSET__' - item_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemId'), 'exclude': lambda f: f is ValidationItem.UNSET }}) - r"""Unique identifier for a validation item.""" - message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message'), 'exclude': lambda f: f is ValidationItem.UNSET }}) - r"""A message outlining validation item's issue.""" - validator_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validatorName'), 'exclude': lambda f: f is ValidationItem.UNSET }}) - r"""Name of validator.""" - - diff --git a/platform/src/codatplatform/models/shared/webhook.py b/platform/src/codatplatform/models/shared/webhook.py deleted file mode 100644 index f7dddf7d2..000000000 --- a/platform/src/codatplatform/models/shared/webhook.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .webhooknotifier import WebhookNotifier -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Webhook: - r"""Configuration to provide an event notification to a URL or list of email addresses based on the 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.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - 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 configured notification.""" - - diff --git a/platform/src/codatplatform/models/shared/webhookconsumer.py b/platform/src/codatplatform/models/shared/webhookconsumer.py deleted file mode 100644 index ca1c3b425..000000000 --- a/platform/src/codatplatform/models/shared/webhookconsumer.py +++ /dev/null @@ -1,29 +0,0 @@ -"""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__' - company_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId'), 'exclude': lambda f: f is WebhookConsumer.UNSET }}) - r"""Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID.""" - 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 deleted file mode 100644 index f4f8411c9..000000000 --- a/platform/src/codatplatform/models/shared/webhookconsumerprototype.py +++ /dev/null @@ -1,23 +0,0 @@ -"""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__' - company_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId'), 'exclude': lambda f: f is WebhookConsumerPrototype.UNSET }}) - r"""Unique identifier of the company to indicate company-specific events. The associated webhook consumer will receive events only for the specified ID.""" - 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 deleted file mode 100644 index 6026d3bf2..000000000 --- a/platform/src/codatplatform/models/shared/webhookconsumers.py +++ /dev/null @@ -1,16 +0,0 @@ -"""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 deleted file mode 100644 index 220766bc4..000000000 --- a/platform/src/codatplatform/models/shared/webhooknotifier.py +++ /dev/null @@ -1,17 +0,0 @@ -"""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 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 use to post events.""" - - diff --git a/platform/src/codatplatform/models/shared/webhooks.py b/platform/src/codatplatform/models/shared/webhooks.py deleted file mode 100644 index 463ff6bc5..000000000 --- a/platform/src/codatplatform/models/shared/webhooks.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .links import Links -from .webhook import Webhook -from codatplatform import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Webhooks: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Webhook]] = 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/webhooks/__init__.py b/platform/src/codatplatform/models/webhooks/__init__.py deleted file mode 100644 index b0b49fa3a..000000000 --- a/platform/src/codatplatform/models/webhooks/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .client_rate_limit_reached import * -from .client_rate_limit_reset import * -from .company_data_connection_status_changed import * -from .data_sync_completed import * -from .dataset_data_changed import * -from .dataset_status_has_changed_to_an_error_state import * -from .new_company_synchronized import * -from .push_operation_has_timed_out import * -from .push_operation_status_has_changed import * - -__all__ = ["ClientRateLimitReachedResponse","ClientRateLimitResetResponse","CompanyDataConnectionStatusChangedResponse","DataSyncCompletedResponse","DatasetDataChangedResponse","DatasetStatusHasChangedToAnErrorStateResponse","NewCompanySynchronizedResponse","PushOperationHasTimedOutResponse","PushOperationStatusHasChangedResponse"] diff --git a/platform/src/codatplatform/models/webhooks/client_rate_limit_reached.py b/platform/src/codatplatform/models/webhooks/client_rate_limit_reached.py deleted file mode 100644 index 6f8ec4867..000000000 --- a/platform/src/codatplatform/models/webhooks/client_rate_limit_reached.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class ClientRateLimitReachedResponse: - 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/webhooks/client_rate_limit_reset.py b/platform/src/codatplatform/models/webhooks/client_rate_limit_reset.py deleted file mode 100644 index ecc722470..000000000 --- a/platform/src/codatplatform/models/webhooks/client_rate_limit_reset.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class ClientRateLimitResetResponse: - 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/webhooks/company_data_connection_status_changed.py b/platform/src/codatplatform/models/webhooks/company_data_connection_status_changed.py deleted file mode 100644 index 058fb16c7..000000000 --- a/platform/src/codatplatform/models/webhooks/company_data_connection_status_changed.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class CompanyDataConnectionStatusChangedResponse: - 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/webhooks/data_sync_completed.py b/platform/src/codatplatform/models/webhooks/data_sync_completed.py deleted file mode 100644 index 03c61337c..000000000 --- a/platform/src/codatplatform/models/webhooks/data_sync_completed.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DataSyncCompletedResponse: - 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/webhooks/dataset_data_changed.py b/platform/src/codatplatform/models/webhooks/dataset_data_changed.py deleted file mode 100644 index 901ca8e1b..000000000 --- a/platform/src/codatplatform/models/webhooks/dataset_data_changed.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DatasetDataChangedResponse: - 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/webhooks/dataset_status_has_changed_to_an_error_state.py b/platform/src/codatplatform/models/webhooks/dataset_status_has_changed_to_an_error_state.py deleted file mode 100644 index e16af6645..000000000 --- a/platform/src/codatplatform/models/webhooks/dataset_status_has_changed_to_an_error_state.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DatasetStatusHasChangedToAnErrorStateResponse: - 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/webhooks/new_company_synchronized.py b/platform/src/codatplatform/models/webhooks/new_company_synchronized.py deleted file mode 100644 index df7120b79..000000000 --- a/platform/src/codatplatform/models/webhooks/new_company_synchronized.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class NewCompanySynchronizedResponse: - 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/webhooks/push_operation_has_timed_out.py b/platform/src/codatplatform/models/webhooks/push_operation_has_timed_out.py deleted file mode 100644 index 745884c80..000000000 --- a/platform/src/codatplatform/models/webhooks/push_operation_has_timed_out.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class PushOperationHasTimedOutResponse: - 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/webhooks/push_operation_status_has_changed.py b/platform/src/codatplatform/models/webhooks/push_operation_status_has_changed.py deleted file mode 100644 index db1c910dd..000000000 --- a/platform/src/codatplatform/models/webhooks/push_operation_status_has_changed.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class PushOperationStatusHasChangedResponse: - 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/push_data.py b/platform/src/codatplatform/push_data.py deleted file mode 100644 index 58c21ded9..000000000 --- a/platform/src/codatplatform/push_data.py +++ /dev/null @@ -1,271 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class PushData: - r"""Initiate and monitor Create, Update, and Delete operations.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def get_model_options(self, request: operations.GetCreateUpdateModelOptionsByDataTypeRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateUpdateModelOptionsByDataTypeResponse: - r"""Get push options - This is the generic documentation for creation and updating of data. See the equivalent endpoint for a given data type for more specific information. - - Before pushing data into accounting software, it is often necessary to collect some details from the user as to how they would like the data to be inserted. This includes names and amounts on transactional entities, but also factors such as categorisation of entities, which is often handled differently between different accounting packages. A good example of this is specifying where on the balance sheet/profit and loss reports the user would like a newly-created nominal account to appear. - - Codat tries not to limit users to pushing to a very limited number of standard categories, so we have implemented \"options\" endpoints, which allow us to expose to our clients the fields which are required to be pushed for a specific linked company, and the options which may be selected for each field. - - - > **Supported Integrations** - > - > 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(base_url, '/companies/{companyId}/connections/{connectionId}/options/{dataType}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCreateUpdateModelOptionsByDataTypeResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) - res.push_option = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_operation(self, request: operations.GetPushOperationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPushOperationResponse: - 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(base_url, '/companies/{companyId}/push/{pushOperationKey}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetPushOperationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PushOperation]) - res.push_operation = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list_operations(self, request: operations.GetCompanyPushHistoryRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCompanyPushHistoryResponse: - 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(base_url, '/companies/{companyId}/push', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCompanyPushHistoryResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PushOperations]) - res.push_operations = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/refresh_data.py b/platform/src/codatplatform/refresh_data.py deleted file mode 100644 index f54121ea9..000000000 --- a/platform/src/codatplatform/refresh_data.py +++ /dev/null @@ -1,426 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class RefreshData: - r"""Initiate data refreshes, view pull status and history.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def all(self, request: operations.RefreshCompanyDataRequest, retries: Optional[utils.RetryConfig] = None) -> operations.RefreshCompanyDataResponse: - r"""Refresh all data - Refreshes all data types with `fetch on first link` set to `true` for a given company. - - This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - - [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(base_url, '/companies/{companyId}/data/all', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.RefreshCompanyDataResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def by_data_type(self, request: operations.RefreshDataTypeRequest, retries: Optional[utils.RetryConfig] = None) -> operations.RefreshDataTypeResponse: - r"""Refresh data type - Refreshes a given data type for a given company. - - 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(base_url, '/companies/{companyId}/data/queue/{dataType}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.RefreshDataTypeResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) - res.pull_operation = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetCompanyDataStatusRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCompanyDataStatusResponse: - 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(base_url, '/companies/{companyId}/dataStatus', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetCompanyDataStatusResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.DataStatuses]) - res.data_statuses = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_pull_operation(self, request: operations.GetPullOperationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPullOperationResponse: - 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(base_url, '/companies/{companyId}/data/history/{datasetId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetPullOperationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PullOperation]) - res.pull_operation = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list_pull_operations(self, request: operations.ListPullOperationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPullOperationsResponse: - 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(base_url, '/companies/{companyId}/data/history', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListPullOperationsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.PullOperations]) - res.pull_operations = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/sdkconfiguration.py b/platform/src/codatplatform/sdkconfiguration.py deleted file mode 100644 index a1e20729c..000000000 --- a/platform/src/codatplatform/sdkconfiguration.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - - -import requests as requests_http -from ._hooks import SDKHooks -from .utils import utils -from .utils.retries import RetryConfig -from codatplatform.models import shared -from dataclasses import dataclass -from typing import Callable, Dict, Optional, Tuple, Union - - -SERVERS = [ - 'https://api.codat.io', - # Production -] -"""Contains the list of servers available to the SDK""" - -@dataclass -class SDKConfiguration: - client: requests_http.Session - security: Union[shared.Security,Callable[[], shared.Security]] = None - server_url: Optional[str] = '' - server_idx: Optional[int] = 0 - language: str = 'python' - openapi_doc_version: str = '3.0.0' - sdk_version: str = '3.5.0' - gen_version: str = '2.314.0' - user_agent: str = 'speakeasy-sdk/python 3.5.0 2.314.0 3.0.0 codat-platform' - retry_config: Optional[RetryConfig] = None - - def __post_init__(self): - self._hooks = SDKHooks() - - def get_server_details(self) -> Tuple[str, Dict[str, str]]: - if self.server_url is not None and self.server_url != '': - return utils.remove_suffix(self.server_url, '/'), {} - if self.server_idx is None: - 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 deleted file mode 100644 index 8fdc931db..000000000 --- a/platform/src/codatplatform/settings.py +++ /dev/null @@ -1,612 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class Settings: - r"""Manage company profile configuration, sync settings, and API keys.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create_api_key(self, request: Optional[shared.CreateAPIKey], retries: Optional[utils.RetryConfig] = None) -> operations.CreateAPIKeyResponse: - r"""Create API key - Use the *Create API keys* endpoint to generate a new API key for your client. - - [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. - - 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. - - ### Tips and pitfalls - - * Your first API key is created for you. Access this key via [Codat's Portal](https://app.codat.io/developers/api-keys). - * 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CreateAPIKey], "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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','409','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateAPIKeyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 201: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.APIKeyDetails]) - res.api_key_details = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 409, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def delete_api_key(self, request: operations.DeleteAPIKeyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteAPIKeyResponse: - r"""Delete API key - Use the *Delete API keys* endpoint to delete an existing API key, providing its valid `id` as a parameter. Note that this operation is not reversible. - - [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. - - 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. - - ### Tips and pitfalls - - * 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(base_url, '/apiKeys/{apiKeyId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('DELETE', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.DeleteAPIKeyResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 204: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[errors.ErrorMessage]) - res.error_message = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_profile(self, retries: Optional[utils.RetryConfig] = None) -> operations.GetProfileResponse: - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetProfileResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Profile]) - res.profile = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_sync_settings(self, retries: Optional[utils.RetryConfig] = None) -> operations.GetProfileSyncSettingsResponse: - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetProfileSyncSettingsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.SyncSettings]) - res.sync_settings = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def list_api_keys(self, retries: Optional[utils.RetryConfig] = None) -> operations.ListAPIKeysResponse: - r"""List API keys - Use the *List API keys* endpoint to return a list of all API keys that currently exist for your client. This includes keys created via the Portal UI or the *Create API keys* endpoint. - - [API keys](https://docs.codat.io/platform-api#/schemas/apiKeys) are tokens used to control access to the API. Include this token in the `Authorization` header parameter when making API calls, following the word \"Basic\" and a space with your API key. - - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListAPIKeysResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.APIKeys]) - res.api_keys = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update_profile(self, request: Optional[shared.Profile], retries: Optional[utils.RetryConfig] = None) -> operations.UpdateProfileResponse: - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.Profile], "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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateProfileResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Profile]) - res.profile = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def update_sync_settings(self, request: Optional[operations.UpdateProfileSyncSettingsRequestBody], retries: Optional[utils.RetryConfig] = None) -> operations.UpdateProfileSyncSettingsResponse: - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, Optional[operations.UpdateProfileSyncSettingsRequestBody], "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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.UpdateProfileSyncSettingsResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 204: - pass - elif http_res.status_code in [401, 402, 403, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/supplemental_data.py b/platform/src/codatplatform/supplemental_data.py deleted file mode 100644 index 5d7c16a67..000000000 --- a/platform/src/codatplatform/supplemental_data.py +++ /dev/null @@ -1,185 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class SupplementalData: - r"""Configure and pull additional data you can include in Codat's standard data types.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def configure(self, request: operations.ConfigureSupplementalDataRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ConfigureSupplementalDataResponse: - r"""Configure - The *Configure* endpoint allows you to maintain or change configuration required to return supplemental data for each integration and data type combination. - - [Supplemental data](https://docs.codat.io/using-the-api/additional-data) is additional data you can include in Codat's standard data types. - - **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(base_url, '/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, operations.ConfigureSupplementalDataRequest, "supplemental_data_configuration", 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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('PUT', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ConfigureSupplementalDataResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - pass - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - def get_configuration(self, request: operations.GetSupplementalDataConfigurationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetSupplementalDataConfigurationResponse: - r"""Get configuration - The *Get configuration* endpoint returns supplemental data configuration previously created for each integration and data type combination. - - [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(base_url, '/integrations/{platformKey}/dataTypes/{dataType}/supplementalDataConfig', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetSupplementalDataConfigurationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.SupplementalDataConfiguration]) - res.supplemental_data_configuration = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/src/codatplatform/utils/__init__.py b/platform/src/codatplatform/utils/__init__.py deleted file mode 100644 index 94b739857..000000000 --- a/platform/src/codatplatform/utils/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .retries import * -from .utils import * diff --git a/platform/src/codatplatform/utils/retries.py b/platform/src/codatplatform/utils/retries.py deleted file mode 100644 index c40fc413c..000000000 --- a/platform/src/codatplatform/utils/retries.py +++ /dev/null @@ -1,119 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import random -import time -from typing import List - -import requests - - -class BackoffStrategy: - initial_interval: int - max_interval: int - exponent: float - max_elapsed_time: int - - def __init__(self, initial_interval: int, max_interval: int, exponent: float, max_elapsed_time: int): - self.initial_interval = initial_interval - self.max_interval = max_interval - self.exponent = exponent - self.max_elapsed_time = max_elapsed_time - - -class RetryConfig: - strategy: str - backoff: BackoffStrategy - retry_connection_errors: bool - - def __init__(self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool): - self.strategy = strategy - self.backoff = backoff - self.retry_connection_errors = retry_connection_errors - - -class Retries: - config: RetryConfig - status_codes: List[str] - - def __init__(self, config: RetryConfig, status_codes: List[str]): - self.config = config - self.status_codes = status_codes - - -class TemporaryError(Exception): - response: requests.Response - - def __init__(self, response: requests.Response): - self.response = response - - -class PermanentError(Exception): - inner: Exception - - def __init__(self, inner: Exception): - self.inner = inner - - -def retry(func, retries: Retries): - if retries.config.strategy == 'backoff': - def do_request(): - res: requests.Response - try: - res = func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if status_major >= code_range and status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except requests.exceptions.ConnectionError as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except requests.exceptions.Timeout as exception: - if retries.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return retry_with_backoff(do_request, retries.config.backoff.initial_interval, retries.config.backoff.max_interval, retries.config.backoff.exponent, retries.config.backoff.max_elapsed_time) - - return func() - - -def retry_with_backoff(func, initial_interval=500, max_interval=60000, exponent=1.5, max_elapsed_time=3600000): - start = round(time.time()*1000) - retries = 0 - - while True: - try: - return func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time()*1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = ((initial_interval/1000) * - exponent**retries + random.uniform(0, 1)) - sleep = min(sleep, max_interval / 1000) - time.sleep(sleep) - retries += 1 diff --git a/platform/src/codatplatform/utils/utils.py b/platform/src/codatplatform/utils/utils.py deleted file mode 100644 index 47e2c3042..000000000 --- a/platform/src/codatplatform/utils/utils.py +++ /dev/null @@ -1,1060 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import base64 -import json -import re -import sys -from dataclasses import Field, fields, is_dataclass, make_dataclass -from datetime import date, datetime -from decimal import Decimal -from email.message import Message -from enum import Enum -from typing import ( - Any, - Callable, - Dict, - List, - Optional, - Tuple, - Union, - get_args, - get_origin, -) -from xmlrpc.client import boolean -from typing_inspect import is_optional_type -import dateutil.parser -from dataclasses_json import DataClassJsonMixin - - -def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, str]]: - headers: Dict[str, str] = {} - query_params: Dict[str, str] = {} - - if security is None: - return headers, query_params - - sec_fields: Tuple[Field, ...] = fields(security) - for sec_field in sec_fields: - value = getattr(security, sec_field.name) - if value is None: - continue - - metadata = sec_field.metadata.get("security") - if metadata is None: - continue - if metadata.get("option"): - _parse_security_option(headers, query_params, value) - return headers, query_params - if metadata.get("scheme"): - # Special case for basic auth which could be a flattened struct - if metadata.get("sub_type") == "basic" and not is_dataclass(value): - _parse_security_scheme(headers, query_params, metadata, security) - else: - _parse_security_scheme(headers, query_params, metadata, value) - - return headers, query_params - - -def _parse_security_option( - headers: Dict[str, str], query_params: Dict[str, str], option: Any -): - opt_fields: Tuple[Field, ...] = fields(option) - for opt_field in opt_fields: - metadata = opt_field.metadata.get("security") - if metadata is None or metadata.get("scheme") is None: - continue - _parse_security_scheme( - headers, query_params, metadata, getattr(option, opt_field.name) - ) - - -def _parse_security_scheme( - headers: Dict[str, str], - query_params: Dict[str, str], - scheme_metadata: Dict, - scheme: Any, -): - scheme_type = scheme_metadata.get("type") - sub_type = scheme_metadata.get("sub_type") - - if is_dataclass(scheme): - if scheme_type == "http" and sub_type == "basic": - _parse_basic_auth_scheme(headers, scheme) - return - - scheme_fields: Tuple[Field, ...] = fields(scheme) - for scheme_field in scheme_fields: - metadata = scheme_field.metadata.get("security") - if metadata is None or metadata.get("field_name") is None: - continue - - value = getattr(scheme, scheme_field.name) - - _parse_security_scheme_value( - headers, query_params, scheme_metadata, metadata, value - ) - else: - _parse_security_scheme_value( - headers, query_params, scheme_metadata, scheme_metadata, scheme - ) - - -def _parse_security_scheme_value( - headers: Dict[str, str], - query_params: Dict[str, str], - scheme_metadata: Dict, - security_metadata: Dict, - value: Any, -): - scheme_type = scheme_metadata.get("type") - sub_type = scheme_metadata.get("sub_type") - - header_name = str(security_metadata.get("field_name")) - - if scheme_type == "apiKey": - if sub_type == "header": - headers[header_name] = value - elif sub_type == "query": - query_params[header_name] = value - else: - raise Exception("not supported") - elif scheme_type == "openIdConnect": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "oauth2": - if sub_type != "client_credentials": - headers[header_name] = _apply_bearer(value) - elif scheme_type == "http": - if sub_type == "bearer": - headers[header_name] = _apply_bearer(value) - else: - raise Exception("not supported") - else: - raise Exception("not supported") - - -def _apply_bearer(token: str) -> str: - return token.lower().startswith("bearer ") and token or f"Bearer {token}" - - -def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): - username = "" - password = "" - - scheme_fields: Tuple[Field, ...] = fields(scheme) - for scheme_field in scheme_fields: - metadata = scheme_field.metadata.get("security") - if metadata is None or metadata.get("field_name") is None: - continue - - field_name = metadata.get("field_name") - value = getattr(scheme, scheme_field.name) - - if field_name == "username": - username = value - if field_name == "password": - password = value - - data = f"{username}:{password}".encode() - headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" - - -def generate_url( - server_url: str, - path: str, - path_params: Any, - gbls: Optional[Any] = None, -) -> str: - path_param_values: Dict[str, str] = {} - - globals_already_populated = _populate_path_params( - path_params, gbls, path_param_values, [] - ) - if gbls is not None: - _populate_path_params(gbls, None, path_param_values, globals_already_populated) - - for key, value in path_param_values.items(): - path = path.replace("{" + key + "}", value, 1) - - return remove_suffix(server_url, "/") + path - - -def _populate_path_params( - path_params: Any, - gbls: Any, - path_param_values: Dict[str, str], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - path_param_fields: Tuple[Field, ...] = fields(path_params) - for field in path_param_fields: - if field.name in skip_fields: - continue - - param_metadata = field.metadata.get("path_param") - if param_metadata is None: - continue - - param = getattr(path_params, field.name) if path_params is not None else None - param, global_found = _populate_from_globals( - field.name, param, "path_param", gbls - ) - if global_found: - globals_already_populated.append(field.name) - - if param is None: - continue - - f_name = param_metadata.get("field_name", field.name) - serialization = param_metadata.get("serialization", "") - if serialization != "": - serialized_params = _get_serialized_params( - param_metadata, field.type, f_name, param - ) - for key, value in serialized_params.items(): - path_param_values[key] = value - else: - if param_metadata.get("style", "simple") == "simple": - if isinstance(param, List): - pp_vals: List[str] = [] - for pp_val in param: - if pp_val is None: - continue - pp_vals.append(_val_to_string(pp_val)) - path_param_values[param_metadata.get("field_name", field.name)] = ( - ",".join(pp_vals) - ) - elif isinstance(param, Dict): - pp_vals: List[str] = [] - for pp_key in param: - if param[pp_key] is None: - continue - if param_metadata.get("explode"): - pp_vals.append(f"{pp_key}={_val_to_string(param[pp_key])}") - else: - pp_vals.append(f"{pp_key},{_val_to_string(param[pp_key])}") - path_param_values[param_metadata.get("field_name", field.name)] = ( - ",".join(pp_vals) - ) - elif not isinstance(param, (str, int, float, complex, bool, Decimal)): - pp_vals: List[str] = [] - param_fields: Tuple[Field, ...] = fields(param) - for param_field in param_fields: - param_value_metadata = param_field.metadata.get("path_param") - if not param_value_metadata: - continue - - param_name = param_value_metadata.get("field_name", field.name) - - param_field_val = getattr(param, param_field.name) - if param_field_val is None: - continue - if param_metadata.get("explode"): - pp_vals.append( - f"{param_name}={_val_to_string(param_field_val)}" - ) - else: - pp_vals.append( - f"{param_name},{_val_to_string(param_field_val)}" - ) - path_param_values[param_metadata.get("field_name", field.name)] = ( - ",".join(pp_vals) - ) - else: - path_param_values[param_metadata.get("field_name", field.name)] = ( - _val_to_string(param) - ) - - return globals_already_populated - - -def is_optional(field): - return get_origin(field) is Union and type(None) in get_args(field) - - -def template_url(url_with_params: str, params: Dict[str, str]) -> str: - for key, value in params.items(): - url_with_params = url_with_params.replace("{" + key + "}", value) - - return url_with_params - - -def get_query_params( - query_params: Any, - gbls: Optional[Any] = None, -) -> Dict[str, List[str]]: - params: Dict[str, List[str]] = {} - - globals_already_populated = _populate_query_params(query_params, gbls, params, []) - if gbls is not None: - _populate_query_params(gbls, None, params, globals_already_populated) - - return params - - -def _populate_query_params( - query_params: Any, - gbls: Any, - query_param_values: Dict[str, List[str]], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - param_fields: Tuple[Field, ...] = fields(query_params) - for field in param_fields: - if field.name in skip_fields: - continue - - metadata = field.metadata.get("query_param") - if not metadata: - continue - - param_name = field.name - value = getattr(query_params, param_name) if query_params is not None else None - - value, global_found = _populate_from_globals( - param_name, value, "query_param", gbls - ) - if global_found: - globals_already_populated.append(param_name) - - f_name = metadata.get("field_name") - serialization = metadata.get("serialization", "") - if serialization != "": - serialized_parms = _get_serialized_params( - metadata, field.type, f_name, value - ) - for key, value in serialized_parms.items(): - if key in query_param_values: - query_param_values[key].extend(value) - else: - query_param_values[key] = [value] - else: - style = metadata.get("style", "form") - if style == "deepObject": - _populate_deep_object_query_params( - metadata, f_name, value, query_param_values - ) - elif style == "form": - _populate_delimited_query_params( - metadata, f_name, value, ",", query_param_values - ) - elif style == "pipeDelimited": - _populate_delimited_query_params( - metadata, f_name, value, "|", query_param_values - ) - else: - raise Exception("not yet implemented") - - return globals_already_populated - - -def get_headers(headers_params: Any, gbls: Optional[Any] = None) -> Dict[str, str]: - headers: Dict[str, str] = {} - - globals_already_populated = [] - if headers_params is not None: - globals_already_populated = _populate_headers(headers_params, gbls, headers, []) - if gbls is not None: - _populate_headers(gbls, None, headers, globals_already_populated) - - return headers - - -def _populate_headers( - headers_params: Any, - gbls: Any, - header_values: Dict[str, str], - skip_fields: List[str], -) -> List[str]: - globals_already_populated: List[str] = [] - - param_fields: Tuple[Field, ...] = fields(headers_params) - for field in param_fields: - if field.name in skip_fields: - continue - - metadata = field.metadata.get("header") - if not metadata: - continue - - value, global_found = _populate_from_globals( - field.name, getattr(headers_params, field.name), "header", gbls - ) - if global_found: - globals_already_populated.append(field.name) - value = _serialize_header(metadata.get("explode", False), value) - - if value != "": - header_values[metadata.get("field_name", field.name)] = value - - return globals_already_populated - - -def _get_serialized_params( - metadata: Dict, field_type: type, field_name: str, obj: Any -) -> Dict[str, str]: - params: Dict[str, str] = {} - - serialization = metadata.get("serialization", "") - if serialization == "json": - params[metadata.get("field_name", field_name)] = marshal_json(obj, field_type) - - return params - - -def _populate_deep_object_query_params( - metadata: Dict, field_name: str, obj: Any, params: Dict[str, List[str]] -): - if obj is None: - return - - if is_dataclass(obj): - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_param_metadata = obj_field.metadata.get("query_param") - if not obj_param_metadata: - continue - - obj_val = getattr(obj, obj_field.name) - if obj_val is None: - continue - - if isinstance(obj_val, List): - for val in obj_val: - if val is None: - continue - - if ( - params.get( - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]' - ) - is None - ): - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]' - ] = [] - - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]' - ].append(_val_to_string(val)) - else: - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]' - ] = [_val_to_string(obj_val)] - elif isinstance(obj, Dict): - for key, value in obj.items(): - if value is None: - continue - - if isinstance(value, List): - for val in value: - if val is None: - continue - - if ( - params.get(f'{metadata.get("field_name", field_name)}[{key}]') - is None - ): - params[f'{metadata.get("field_name", field_name)}[{key}]'] = [] - - params[f'{metadata.get("field_name", field_name)}[{key}]'].append( - _val_to_string(val) - ) - else: - params[f'{metadata.get("field_name", field_name)}[{key}]'] = [ - _val_to_string(value) - ] - - -def _get_query_param_field_name(obj_field: Field) -> str: - obj_param_metadata = obj_field.metadata.get("query_param") - - if not obj_param_metadata: - return "" - - return obj_param_metadata.get("field_name", obj_field.name) - - -def _populate_delimited_query_params( - metadata: Dict, - field_name: str, - obj: Any, - delimiter: str, - query_param_values: Dict[str, List[str]], -): - _populate_form( - field_name, - metadata.get("explode", True), - obj, - _get_query_param_field_name, - delimiter, - query_param_values, - ) - - -SERIALIZATION_METHOD_TO_CONTENT_TYPE = { - "json": "application/json", - "form": "application/x-www-form-urlencoded", - "multipart": "multipart/form-data", - "raw": "application/octet-stream", - "string": "text/plain", -} - - -def serialize_request_body( - request: Any, - request_type: type, - request_field_name: str, - nullable: bool, - optional: bool, - serialization_method: str, - encoder=None, -) -> Tuple[Optional[str], Optional[Any], Optional[Any]]: - if request is None: - if not nullable and optional: - return None, None, None - - if not is_dataclass(request) or not hasattr(request, request_field_name): - return serialize_content_type( - request_field_name, - request_type, - SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], - request, - encoder, - ) - - request_val = getattr(request, request_field_name) - - if request_val is None: - if not nullable and optional: - return None, None, None - - request_fields: Tuple[Field, ...] = fields(request) - request_metadata = None - - for field in request_fields: - if field.name == request_field_name: - request_metadata = field.metadata.get("request") - break - - if request_metadata is None: - raise Exception("invalid request type") - - return serialize_content_type( - request_field_name, - request_type, - request_metadata.get("media_type", "application/octet-stream"), - request_val, - ) - - -def serialize_content_type( - field_name: str, request_type: Any, media_type: str, request: Any, encoder=None -) -> Tuple[Optional[str], Optional[Any], Optional[List[List[Any]]]]: - if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None: - return media_type, marshal_json(request, request_type, encoder), None - if re.match(r"multipart\/.*", media_type) is not None: - return serialize_multipart_form(media_type, request) - if re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None: - return media_type, serialize_form_data(field_name, request), None - if isinstance(request, (bytes, bytearray)): - return media_type, request, None - if isinstance(request, str): - return media_type, request, None - - raise Exception( - f"invalid request body type {type(request)} for mediaType {media_type}" - ) - - -def serialize_multipart_form( - media_type: str, request: Any -) -> Tuple[str, Any, List[List[Any]]]: - form: List[List[Any]] = [] - request_fields = fields(request) - - for field in request_fields: - val = getattr(request, field.name) - if val is None: - continue - - field_metadata = field.metadata.get("multipart_form") - if not field_metadata: - continue - - if field_metadata.get("file") is True: - file_fields = fields(val) - - file_name = "" - field_name = "" - content = bytes() - - for file_field in file_fields: - file_metadata = file_field.metadata.get("multipart_form") - if file_metadata is None: - continue - - if file_metadata.get("content") is True: - content = getattr(val, file_field.name) - else: - field_name = file_metadata.get("field_name", file_field.name) - file_name = getattr(val, file_field.name) - if field_name == "" or file_name == "" or content == bytes(): - raise Exception("invalid multipart/form-data file") - - form.append([field_name, [file_name, content]]) - elif field_metadata.get("json") is True: - to_append = [ - field_metadata.get("field_name", field.name), - [None, marshal_json(val, field.type), "application/json"], - ] - form.append(to_append) - else: - field_name = field_metadata.get("field_name", field.name) - if isinstance(val, List): - for value in val: - if value is None: - continue - form.append([field_name + "[]", [None, _val_to_string(value)]]) - else: - form.append([field_name, [None, _val_to_string(val)]]) - return media_type, None, form - - -def serialize_dict( - original: Dict, explode: bool, field_name, existing: Optional[Dict[str, List[str]]] -) -> Dict[str, List[str]]: - if existing is None: - existing = {} - - if explode is True: - for key, val in original.items(): - if key not in existing: - existing[key] = [] - existing[key].append(val) - else: - temp = [] - for key, val in original.items(): - temp.append(str(key)) - temp.append(str(val)) - if field_name not in existing: - existing[field_name] = [] - existing[field_name].append(",".join(temp)) - return existing - - -def serialize_form_data(field_name: str, data: Any) -> Dict[str, Any]: - form: Dict[str, List[str]] = {} - - if is_dataclass(data): - for field in fields(data): - val = getattr(data, field.name) - if val is None: - continue - - metadata = field.metadata.get("form") - if metadata is None: - continue - - field_name = metadata.get("field_name", field.name) - - if metadata.get("json"): - form[field_name] = [marshal_json(val, field.type)] - else: - if metadata.get("style", "form") == "form": - _populate_form( - field_name, - metadata.get("explode", True), - val, - _get_form_field_name, - ",", - form, - ) - else: - raise Exception(f"Invalid form style for field {field.name}") - elif isinstance(data, Dict): - for key, value in data.items(): - form[key] = [_val_to_string(value)] - else: - raise Exception(f"Invalid request body type for field {field_name}") - - return form - - -def _get_form_field_name(obj_field: Field) -> str: - obj_param_metadata = obj_field.metadata.get("form") - - if not obj_param_metadata: - return "" - - return obj_param_metadata.get("field_name", obj_field.name) - - -def _populate_form( - field_name: str, - explode: boolean, - obj: Any, - get_field_name_func: Callable, - delimiter: str, - form: Dict[str, List[str]], -): - if obj is None: - return form - - if is_dataclass(obj): - items = [] - - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_field_name = get_field_name_func(obj_field) - if obj_field_name == "": - continue - - val = getattr(obj, obj_field.name) - if val is None: - continue - - if explode: - form[obj_field_name] = [_val_to_string(val)] - else: - items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, Dict): - items = [] - for key, value in obj.items(): - if value is None: - continue - - if explode: - form[key] = [_val_to_string(value)] - else: - items.append(f"{key}{delimiter}{_val_to_string(value)}") - - if len(items) > 0: - form[field_name] = [delimiter.join(items)] - elif isinstance(obj, List): - items = [] - - for value in obj: - if value is None: - continue - - if explode: - if not field_name in form: - form[field_name] = [] - form[field_name].append(_val_to_string(value)) - else: - items.append(_val_to_string(value)) - - if len(items) > 0: - form[field_name] = [delimiter.join([str(item) for item in items])] - else: - form[field_name] = [_val_to_string(obj)] - - return form - - -def _serialize_header(explode: bool, obj: Any) -> str: - if obj is None: - return "" - - if is_dataclass(obj): - items = [] - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_param_metadata = obj_field.metadata.get("header") - - if not obj_param_metadata: - continue - - obj_field_name = obj_param_metadata.get("field_name", obj_field.name) - if obj_field_name == "": - continue - - val = getattr(obj, obj_field.name) - if val is None: - continue - - if explode: - items.append(f"{obj_field_name}={_val_to_string(val)}") - else: - items.append(obj_field_name) - items.append(_val_to_string(val)) - - if len(items) > 0: - return ",".join(items) - elif isinstance(obj, Dict): - items = [] - - for key, value in obj.items(): - if value is None: - continue - - if explode: - items.append(f"{key}={_val_to_string(value)}") - else: - items.append(key) - items.append(_val_to_string(value)) - - if len(items) > 0: - return ",".join([str(item) for item in items]) - elif isinstance(obj, List): - items = [] - - for value in obj: - if value is None: - continue - - items.append(_val_to_string(value)) - - if len(items) > 0: - return ",".join(items) - else: - return f"{_val_to_string(obj)}" - - return "" - - -def unmarshal_json(data, typ, decoder=None): - unmarshal = make_dataclass("Unmarshal", [("res", typ)], bases=(DataClassJsonMixin,)) - json_dict = json.loads(data) - try: - out = unmarshal.from_dict({"res": json_dict}) - except AttributeError as attr_err: - raise AttributeError( - f"unable to unmarshal {data} as {typ} - {attr_err}" - ) from attr_err - - return out.res if decoder is None else decoder(out.res) - - -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}") - - marshal = make_dataclass("Marshal", [("res", typ)], bases=(DataClassJsonMixin,)) - marshaller = marshal(res=val) - json_dict = marshaller.to_dict() - val = json_dict["res"] if encoder is None else encoder(json_dict["res"]) - - return json.dumps(val, separators=(",", ":"), sort_keys=True) - - -def match_content_type(content_type: str, pattern: str) -> boolean: - if pattern in (content_type, "*", "*/*"): - return True - - msg = Message() - msg["content-type"] = content_type - media_type = msg.get_content_type() - - if media_type == pattern: - return True - - parts = media_type.split("/") - if len(parts) == 2: - if pattern in (f"{parts[0]}/*", f"*/{parts[1]}"): - return True - - 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: - return None - return _val_to_string(val) - - return isoformatoptional - - -def dateisoformat(optional: bool): - def isoformatoptional(val): - if optional and val is None: - return None - return date.isoformat(val) - - return isoformatoptional - - -def datefromisoformat(date_str: str): - return dateutil.parser.parse(date_str).date() - - -def bigintencoder(optional: bool): - def bigintencode(val: int): - if optional and val is None: - return None - return str(val) - - return bigintencode - - -def bigintdecoder(val): - if isinstance(val, float): - raise ValueError(f"{val} is a float") - return int(val) - - -def decimalencoder(optional: bool, as_str: bool): - def decimalencode(val: Decimal): - if optional and val is None: - return None - - if as_str: - return str(val) - - return float(val) - - return decimalencode - - -def decimaldecoder(val): - return Decimal(str(val)) - - -def map_encoder(optional: bool, value_encoder: Callable): - def map_encode(val: Dict): - if optional and val is None: - return None - - encoded = {} - for key, value in val.items(): - encoded[key] = value_encoder(value) - - return encoded - - return map_encode - - -def map_decoder(value_decoder: Callable): - def map_decode(val: Dict): - decoded = {} - for key, value in val.items(): - decoded[key] = value_decoder(value) - - return decoded - - return map_decode - - -def list_encoder(optional: bool, value_encoder: Callable): - def list_encode(val: List): - if optional and val is None: - return None - - encoded = [] - for value in val: - encoded.append(value_encoder(value)) - - return encoded - - return list_encode - - -def list_decoder(value_decoder: Callable): - def list_decode(val: List): - decoded = [] - for value in val: - decoded.append(value_decoder(value)) - - return decoded - - return list_decode - - -def union_encoder(all_encoders: Dict[str, Callable]): - def selective_encoder(val: Any): - if type(val) in all_encoders: - return all_encoders[type(val)](val) - return val - - return selective_encoder - - -def union_decoder(all_decoders: List[Callable]): - def selective_decoder(val: Any): - decoded = val - for decoder in all_decoders: - try: - decoded = decoder(val) - break - except (TypeError, ValueError): - continue - return decoded - - return selective_decoder - - -def get_field_name(name): - def override(_, _field_name=name): - return _field_name - - return override - - -def _val_to_string(val) -> str: - if isinstance(val, bool): - return str(val).lower() - if isinstance(val, datetime): - return str(val.isoformat().replace("+00:00", "Z")) - if isinstance(val, Enum): - return str(val.value) - - return str(val) - - -def _populate_from_globals( - param_name: str, value: Any, param_type: str, gbls: Any -) -> Tuple[Any, bool]: - if gbls is None: - return value, False - - global_fields = fields(gbls) - - found = False - for field in global_fields: - if field.name is not param_name: - continue - - found = True - - if value is not None: - return value, True - - global_value = getattr(gbls, field.name) - - param_metadata = field.metadata.get(param_type) - if param_metadata is None: - return value, True - - return global_value, True - - return value, found - - -def decoder_with_discriminator(field_name): - def decode_fx(obj): - kls = getattr(sys.modules["sdk.models.shared"], obj[field_name]) - return unmarshal_json(json.dumps(obj), kls) - - return decode_fx - - -def remove_suffix(input_string, suffix): - if suffix and input_string.endswith(suffix): - return input_string[: -len(suffix)] - return input_string diff --git a/platform/src/codatplatform/webhooks.py b/platform/src/codatplatform/webhooks.py deleted file mode 100644 index 6159fb86a..000000000 --- a/platform/src/codatplatform/webhooks.py +++ /dev/null @@ -1,518 +0,0 @@ -"""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 AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext -from codatplatform.models import errors, operations, shared -from typing import Optional - -class Webhooks: - r"""Create and manage webhooks that listen to Codat's events.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CreateRule], "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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateRuleResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Webhook]) - res.webhook = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - 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 - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('POST', url, params=query_params, data=data, files=form, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.CreateWebhookConsumerResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 201: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.WebhookConsumer]) - res.webhook_consumer = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', 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(base_url, '/webhooks/{webhookId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('DELETE', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.DeleteWebhookConsumerResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', 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(base_url, '/rules/{ruleId}', request) - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.GetWebhookResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Webhook]) - res.webhook = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - query_params = { **utils.get_query_params(request), **query_params } - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','404','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListRulesResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Webhooks]) - res.webhooks = out - else: - content_type = http_res.headers.get('Content-Type') - 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, 404, 429, 500, 503]: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - 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' - - if callable(self.sdk_configuration.security): - headers, query_params = utils.get_security(self.sdk_configuration.security()) - else: - headers, query_params = utils.get_security(self.sdk_configuration.security) - - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - client = self.sdk_configuration.client - - 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) - - req = None - def do_request(): - nonlocal req - try: - req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers)) - req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req) - http_res = client.send(req) - except Exception as e: - _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e) - if e is not None: - raise e - - if utils.match_status_codes(['400','401','402','403','429','4XX','500','503','5XX'], http_res.status_code): - result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None) - if e is not None: - raise e - if result is not None: - http_res = result - else: - http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res) - - return http_res - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - - - res = operations.ListWebhookConsumersResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.WebhookConsumers]) - res.webhook_consumers = out - else: - content_type = http_res.headers.get('Content-Type') - 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(http_res.headers.get('Content-Type') or '', 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - raise out - else: - content_type = http_res.headers.get('Content-Type') - 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) - else: - raise errors.SDKError('unknown status code received', http_res.status_code, http_res.text, http_res) - - return res - - - diff --git a/platform/tests/helpers.py b/platform/tests/helpers.py deleted file mode 100644 index b3d095040..000000000 --- a/platform/tests/helpers.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import re - - -def sort_query_parameters(url): - parts = url.split("?") - - if len(parts) == 1: - return url - - query = parts[1] - params = query.split("&") - - params.sort(key=lambda x: x.split('=')[0]) - - return parts[0] + "?" + "&".join(params) - - -def sort_serialized_maps(inp: any, regex: str, delim: str): - - def sort_map(m): - entire_match = m.group(0) - - groups = m.groups() - - for group in groups: - pairs = [] - if '=' in group: - pairs = group.split(delim) - - pairs.sort(key=lambda x: x.split('=')[0]) - else: - values = group.split(delim) - - if len(values) == 1: - pairs = values - else: - pairs = [''] * int(len(values)/2) - # loop though every 2nd item - for i in range(0, len(values), 2): - pairs[int(i/2)] = values[i] + delim + values[i+1] - - pairs.sort(key=lambda x: x.split(delim)[0]) - - entire_match = entire_match.replace(group, delim.join(pairs)) - - return entire_match - - if isinstance(inp, str): - return re.sub(regex, sort_map, inp) - elif isinstance(inp, list): - for i, v in enumerate(inp): - inp[i] = sort_serialized_maps(v, regex, delim) - return inp - elif isinstance(inp, dict): - for k, v in inp.items(): - inp[k] = sort_serialized_maps(v, regex, delim) - return inp - else: - raise Exception("Unsupported type")